lzstar_mixed: Compute lz and lzstar person-fit statistics for mixed-format...

View source: R/lzstar_mixed.R

lzstar_mixedR Documentation

Compute lz and lzstar person-fit statistics for mixed-format tests

Description

Compute lz and lzstar person-fit statistics for mixed-format tests

Usage

lzstar_mixed(
  scores,
  theta,
  vtheta,
  a,
  c,
  b,
  extreme_handling = c("na", "cap", "none"),
  theta_cap = 4
)

Arguments

scores

Matrix of item scores (n_persons x n_items).

theta

Vector of ability estimates, length must equal nrow(scores).

vtheta

Vector of estimated variances Var(theta_hat), length must equal nrow(scores).

a

Vector of discrimination parameters, length must equal ncol(scores).

c

Vector of lower asymptote (guessing) parameters, length must equal ncol(scores).

b

Matrix of thresholds, with nrow(b) = ncol(scores) and NA padding for shorter items.

extreme_handling

Policy for extreme raw scores (all-0 or perfect): "na" returns NA for that person, "cap" truncates theta to +/- theta_cap, "none" does nothing.

theta_cap

Cap used when extreme_handling = "cap".

Details

The function implements the mixed-format person-fit statistic using 3PL for dichotomous items and GPCM for polytomous items. The calculation is kept unchanged: dichotomous item contributions are accumulated with pr3PL, polytomous item contributions are accumulated with prGPCM_stable and d1prGPCM, and lz and lzstar are computed from the same denominators used in the implementation.

Value

A matrix with columns "lz" and "lzstar".

References

Sinharay, S. (2026). Refining the asymptotically correct standardization of person-fit statistics for mixed-format tests. British Journal of Mathematical and Statistical Psychology, 00, 1–24.

Sinharay, S. (2016). Asymptotically correct standardization of person-fit statistics beyond dichotomous items. Psychometrika, 81(4), 992–1013.

Examples

scores <- matrix(c(
  1, 0, 2,
  0, 1, 1,
  1, 1, 3
), nrow = 3, byrow = TRUE)
theta  <- c(-0.5, 0.2, 1.1)
vtheta <- c(0.12, 0.10, 0.15)
a      <- c(1.1, 0.9, 1.3)
cpar   <- c(0.15, 0.10, 0.00)
b <- matrix(c(
  0.0,  NA,
 -0.2,  NA,
 -1.0,  0.3
), nrow = 3, byrow = TRUE)
lzstar_mixed(scores, theta, vtheta, a, cpar, b)

scores2 <- matrix(c(
  0, 1,
  1, 0
), nrow = 2, byrow = TRUE)
theta2  <- c(-1, 1)
vtheta2 <- c(0.08, 0.08)
a2      <- c(1.0, 1.2)
c2      <- c(0.05, 0.10)
b2 <- matrix(c(
  0.0, NA,
  0.3, NA
), nrow = 2, byrow = TRUE)
lzstar_mixed(scores2, theta2, vtheta2, a2, c2, b2)


PP documentation built on April 21, 2026, 5:09 p.m.