Skip to contents

Source: SIBTEST in the CRAN package mirt (mirt 1.46.1, R/SIBTEST.R), implementing Shealy, R. and Stout, W. (1993), Psychometrika 58, 159-194. (difR::sibTest is a thin wrapper that delegates to it.) The 1993 paper is paywalled here; the package source states the estimator explicitly. The estimator is computed natively here; mirt is not called. Grouping examinees on the matching score k: pstar_k = n_k / sum n_k, beta = sum_k pstar_k (Ystar_R,k - Ystar_F,k), sigma = sqrt(sum_k pstar_k^2 (s2_F,k/n_F,k + s2_R,k/n_R,k)), X2 = (beta/sigma)^2 on one degree of freedom.

Usage

Difsib(
  y,
  group,
  studied = NULL,
  matching = NULL,
  correction = FALSE,
  reference = NULL
)

Arguments

y

Score on the suspect item, one per examinee.

group

Group membership; exactly two distinct values, the first encountered being the reference group.

studied

Optional alias for y, accepted for the original argument order; when given it overrides y.

matching

Matching (valid subtest) score, one per examinee. Required.

correction

Apply the Shealy-Stout regression correction. Default FALSE.

reference

Which value of group is the reference group. Defaults to the first value encountered, which makes the SIGN of beta depend on row order; pass this explicitly whenever the direction of the DIF matters.

Value

list: beta, sigma, statistic, p_value, df, n_levels, levels, pstar, correction, n, method.

Details

A level contributes only when both groups are present there and both within-cell variances are non-zero; mirt drops the rest and renormalises pstar, and so does this, since a zero-variance level contributes nothing to sigma and would otherwise deflate it.

Ystar is Ybar unless correction = TRUE, which applies the Shealy-Stout true-score regression correction as mirt writes it, M_g = (Ybar_g,k+1 - Ybar_g,k-1)/(V_g,k+1 - V_g,k-1) and Ystar_g,k = Ybar_g,k + M_g (V_k - V_g,k), skipped at the two end levels where k-1 or k+1 does not exist. The default is FALSE, which is the estimator this row specifies.

Examples

set.seed(1)
m <- rep(0:2, each = 20)
g <- rep(c("r", "f"), 30)
Difsib(rbinom(60, 1, 0.5), g, matching = m)$beta
#> [1] 0.1333333