| scDIFtest {scDIFtest} | R Documentation | 
A score-based item-wise DIF test
Description
A function that executes item-wise score-based DIF tests. After fitting an
IRT model with mirt, the fitted object can be used to
assess and test measurement invariance, using
sctest. However, by default, all parameters of
the fitted model are tested simultaneously. This function applies the
sctest to test for item-wise DIF, in an efficient
way.
Usage
scDIFtest(
  object,
  DIF_covariate = NULL,
  functional = NULL,
  item_selection = NULL,
  decorrelate = TRUE,
  ...
)
Arguments
| object | a fitted model object of class  | 
| DIF_covariate | a vector with the person covariate to use for the DIF-test. The covariate can be categorical, ordered categorical or numerical. | 
| functional | a character specifying the functional (or test statistic) to be used. See details for more information. | 
| item_selection | either  | 
| decorrelate | a logical. Should the process be decorrelated? | 
| ... | other arguments passed to the  | 
Details
For more information about the functional see the documentation of
sctest.default or
sctest.formula. When functional = NULL
(which is the default), the functional is chosen based on the class of
DIF_covariate. In this case, for integer and numeric vectors
the Double Maximum ("DM") is used; for ordered vectors the
Maximum Lagrange Multiplier Test for Ordered Groups ("maxLMo") is
used; and for factor, character, and logical vectors the
Lagrange Multiplier Test for Unordered Groups is used.
Value
An object of class scDIFtest scDIFtest-Methods, which is a list with three elements
- tests
- A named list with a number of elements equal to the number of the items for which DIF should be detected. Each element contains information both about the test - single_testas well as the- efpFunctional
- info
- A named list with two elements. - test_infocontains information such as used test statistic and the used covariate.- item_infocontains information about the items such as the item types as well as the column numbers of the score matrix that correspond to the estimated parameters of the items.
- gefp
- The Generalized Empirical M-Fluctuation Process ( - gefp) based on the complete model with all the estimated parameters (see- gefp).
Examples
library(mirt)
library(scDIFtest)
### data and model
dat <- expand.table(LSAT7)
nObs <- dim(dat)[1]
mod <- mirt(dat, 1, itemtype = "2PL", constr = list(c(2, 1)))
### DIF along a metric variable
###  the default test statistic is the Double Maximum (dm)
metric <- rnorm(nObs) 
DIF_metric <- scDIFtest(mod, DIF_covariate = metric)
DIF_metric
plot(DIF_metric, 1)
### DIF along an ordered categorical variable
###  the default test statistic is the Maximum Lagrange Multiplier Test 
###  for Ordered Groups (maxlmo)
ordered <- ordered(sample(1:5, size = nObs, replace = TRUE))
DIF_ordered <- scDIFtest(mod, DIF_covariate = ordered)
summary(DIF_ordered)
### Note that the Generalized Empirical M-Fluctuation Process (gefp) based on all
###  the estimated parameters in the model is an element of the resulting
###  scDIFtest object. This means that one can use this gefp to test the
###  general hypothesis of measurement invariance with respect to the
###  chosen covariate.
 strucchange::sctest(DIF_metric$gefp)
 strucchange::sctest(DIF_ordered$gefp)