dif.test: DIF Test

View source: R/functions.r

dif.testR Documentation

DIF Test

Description

Performs a Wald-type test for Differential Item Functioning detection.

Usage

dif.test(coef, var, names = NULL, reference = NULL, method = "mean-mean",
  quadrature = TRUE, nq = 30, DIFtype = NULL, purification = FALSE, 
  signif.level = 0.05, trace = FALSE, maxiter = 30, anchor = NULL)

Arguments

coef

list of matrices (one for each group) containing the item parameter estimates. Guessing, difficulty and discrimination parameters should strictly be given in this order and they are contained in different columns of the matrix. The names of the rows of each matrix should be the names of the items.

var

list of matrices (one for each group) containing the covariance matrix of item parameter estimates. They should be given in the same order of coefficients.

names

character vector containing the names of the groups. This should have the same length of coef and var. If NULL, the names of the groups will be "T1", "T2", ...

reference

reference group. Can be specified by name or number. The default is the first group.

method

the equating method to be used in function direc to convert the item parameters to the scale of the reference group. This should be one of "mean-mean", "mean-gmean", "mean-sigma", "Haebara" or "Stocking-Lord".

quadrature

logical; if TRUE the Gauss-Hermite quadrature is used in function direc to approximate the integral in the function that is minimized in the Haebara and Stocking-Lord methods. If FALSE the integral is replaced with a sum over 40 equally spaced values ranging from -4 to 4 with an increment of 0.05 and weights equal to one for all values.

nq

number of quadrature points used for the Gauss-Hermite quadrature if quadrature is TRUE.

DIFtype

character indicating which parameters to test for DIF. If NULL all parameters are tested for DIF. Use "beta1" for β_1, "beta2" for β_2, "beta3" for β_3, "beta12" for β_1 and β_2, "beta123" for β_1, β_2 and β_3. See details.

purification

logical. if TRUE the procedure described in Candell and Drasgow (1988) is applied.

signif.level

significance level to use in the purification process.

trace

logical. If TRUE tracing information is produced.

maxiter

The maximum number of iterations in the purification process.

anchor

Optional character vector containing the names of the items to use for equating. These should be items free of DIF.

Details

The parameterization of the IRT model is that commonly used for estimation. Under this parameterization, the three-parameter logistic model is as follows

π_i = c_i + (1 - c_i) * {exp(β_{1i} + β_{2i} z)}/ {1 + exp(β_{1i} + β_{2i} z)},

where π_i denotes the conditional probability of responding correctly to the ith item given z, c_i denotes the guessing parameter, β_{1i} is the easiness parameter, β_{2i} is the discrimination parameter, and z denotes the latent ability. Furthermore, the guessing parameter is equal to

c_i = \frac{\exp(β_{3i})}{1+\exp(β_{3i})}

.

The test verifies whether the item parameters β_{1i}, β_{2i}, β_{3i} are invariant across two or more groups as explained in Battauz (2018).

Value

An object of class dift with components

test

matrix containing the test statistic and the p-value for each item. "noGuess" is equal to 1 if the guessing parameter of a 3PL model was set to a fixed value.

eqmet

the equating method used.

DIFtype

character indicating which parameters were tested for DIF.

reference

the reference group.

focal

the focal groups.

names

names of the groups.

purification

logical. If TRUE thre purification procedure was applied.

signif.level

significance level used in the purification process

equatings

list containing the output of function direc.

coef_trasf

list containing the item parameters of each group transformed to the scale of the reference group.

var_trasf

list containing the covariance matrix of item parameters of each group transformed to the scale of the reference group.

items.dif

names of the items for which the null hypothesis of the test is rejected.

anchor

names of the items used as anchors.

niter

number of iterations.

Author(s)

Michela Battauz

References

Battauz, M. (2019). On Wald tests for differential item functioning detection. Statistical Methods and Applications. 28, 103-118.

Candell, G.L., Drasgow, F. (1988). An iterative procedure for linking metrics and assessing item bias in item response theory. Applid Psychological Measurement, 12, 253-260.

Examples

# load the data
data(dataDIF)
head(dataDIF)
# estimate a 2PL model for each group using the R package mirt
library(mirt)
data1 <- dataDIF[dataDIF$group == 1, 1:20]
data2 <- dataDIF[dataDIF$group == 2, 1:20]
data3 <- dataDIF[dataDIF$group == 3, 1:20]
mod1 <- mirt(data1, SE = TRUE)
mod2 <- mirt(data2, SE = TRUE)
mod3 <- mirt(data3, SE = TRUE)
# extract the coefficients and the covariance matrix
est1 <- import.mirt(mod1, display = FALSE)
est2 <- import.mirt(mod2, display = FALSE)
est3 <- import.mirt(mod3, display = FALSE)

# perform the test for DIF on two groups
res_diftest2 <- dif.test(coef = list(est1$coef, est2$coef),
  var = list(est1$var, est2$var))
res_diftest2

# perform the test for DIF on three groups
res_diftest3 <- dif.test(coef = list(est1$coef, est2$coef, est3$coef),
  var = list(est1$var, est2$var, est3$var))
res_diftest3

# perform the test for DIF on three groups
# reference group: 2
# equating method: Haebara
# purification applied
res_diftest3 <- dif.test(coef = list(est1$coef, est2$coef, est3$coef),
  var = list(est1$var, est2$var, est3$var), reference = 2,
  method = "Haebara", purification = TRUE)
res_diftest3

equateIRT documentation built on Aug. 8, 2022, 5:08 p.m.