This function compares the specified DIF detection methods among multiple groups, with respect to the detected items.
genDichoDif(Data, group, focal.names, method, anchor = NULL, match = "score",
type = "both", criterion = "LRT", alpha = 0.05, model = "2PL", c = NULL,
engine = "ltm", discr = 1, irtParam = NULL, nrFocal = 2, same.scale = TRUE,
purify = FALSE, nrIter = 10, p.adjust.method = NULL, save.output = FALSE,
output = c("out", "default"))
# S3 method for genDichoDif
print(x, ...)
numeric: either the data matrix only, or the data matrix plus the vector of group membership. See Details.
numeric or character: either the vector of group membership or the column indicator (within data) of group membership. See Details.
numeric or character vector indicating the levels of group
which correspond to the focal groups.
character: the name of the selected methods. See Details.
either NULL
(default) or a vector of item names (or identifiers) to specify the anchor items. See Details.
specifies the type of matching criterion. Can be either "score"
(default) to compute the test score, or any continuous or discrete variable with the same length as the number of rows of Data
. See Details.
a character string specifying which DIF effects must be tested (default is "both"
). See Details.
character: the type of test statistic used to detect DIF items with generalized logistic regression. Possible values are "LRT"
(default) and "Wald"
. See Details.
numeric: significance level (default is 0.05).
character: the IRT model to be fitted (either "1PL"
, "2PL"
or "3PL"
). Default is "2PL"
.
optional numeric value or vector giving the values of the constrained pseudo-guessing parameters. See Details.
character: the engine for estimating the 1PL model, either "ltm"
(default) or "lme4"
.
either NULL
or a real positive value for the common discrimination parameter (default is 1). Used onlky if model
is "1PL"
and engine
is "ltm"
. See Details.
matrix with 2J rows (where J is the number of items) and at most 9 columns containing item parameters estimates. See Details.
numeric: the number of focal groups (default is 2).
logical: are the item parameters of the irtParam
matrix on the same scale? (default is "TRUE"). See Details.
logical: should the method be used iteratively to purify the set of anchor items? (default is FALSE).
numeric: the maximal number of iterations in the item purification process (default is 10).
either NULL
(default) or the acronym of the method for p-value adjustment for multiple comparisons. See Details.
logical: should the output be saved into a text file? (Default is FALSE
).
character: a vector of two components. The first component is the name of the output file, the second component is either the file path or "default"
(default value). See Details.
result from a genDichoDif
class object.
other generic parameters for the print
function.
Either the output of one of the DIF detection methods, or a list of class "genDichoDif" with the following arguments:
a character matrix with one row per item and whose columns refer to the different specified detection methods. See Details.
the significance level alpha
.
the value of method
argument.
the value of match
argument.
the value of type
argument.
the value of the criterion
argument.
the value of model
option.
the value of c
option.
The value of the engine
argument.
the value of the discr
argument.
the value of irtParam
option.
the value of same.scale
option.
the value of the p.adjust.method
argument.
the value of purify
option.
an integer vector (of length equal to the number of methods) with the number of iterations in the purification process. Returned only if purify
is TRUE.
a logical vector (of length equal to the number of methods) indicating whether the iterative purification process converged. Returned only if purify
is TRUE.
the value of the anchor
argument.
the value of the save.output
argument.
the value of the output
argument.
genDichoDif
is a generic function which calls one or several DIF detection methods among multiple groups, and summarize their output. The possible methods are: "GMH"
for Generalized Mantel-Haenszel (Penfield, 2001), "genLogistic"
for generalized logistic regression (Magis, Raiche Beland and Gerard, 2011) and "genLord"
for generalized Lord's chi-square test (Kim, Cohen and Park, 1995).
If method
has a single component, the output of genDichoDif
is exactly the one provided by the method itself. Otherwise, the main output is a matrix with one row per item and one column per method. For each specified method and related arguments, items detected as DIF and non-DIF are respectively encoded as "DIF"
and "NoDIF"
. When printing the output an additional column is added, counting the number of times each item was detected as functioning differently (Note: this is just an informative summary, since the methods are obviously not independent for the detection of DIF items).
The Data
is a matrix whose rows correspond to the subjects and columns to the items. In addition, Data
can hold the vector of group membership. If so, group
indicates the column of Data
which corresponds to the group membership, either by specifying its name or by giving the column number. Otherwise, group
must be a vector of same length as nrow(Data)
.
Missing values are allowed for item responses (not for group membership) but must be coded as NA
values. They are discarded from either the computation of the sum-scores, the fitting of the logistic models or the IRT models (according to the method).
The vector of group membership must hold at least three different values, either as numeric or character. The focal groups are defined by the values of the argument focal.names
.
For generalized Mantel-Haenszel and generalized logistic methods, the matching criterion can be either the test score or any other continuous or discrete variable to be passed in the DIF function. This is specified by the match
argument. By default, it takes the value "score"
and the test score (i.e. raw score) is computed. The second option is to assign to match
a vector of continuous or discrete numeric values, which acts as the matching criterion. Note that for consistency this vector should not belong to the Data
matrix.
For the generalized logistic regression method, the argument type
permits to test either both uniform and nonuniform effects simultaneously (with type="both"
), only uniform DIF effect (with type="udif"
) or only nonuniform DIF effect (with type="nudif"
). Furthermore, the argument criterion
defines which test must be used, either the Wald test ("Wald"
) or the likelihood ratio test ("LRT"
). See difGenLord
for further details.
For generalized Lord method, one can specify either the IRT model to be fitted (by means of model
, c
, engine
and discr
arguments), or the item parameter estimates with arguments irtParam
and same.scale
. See difGenLord
for further details.
The threshold for detecting DIF items depends on the method and is depending on the significance level set by alpha
.
Item purification can be requested by specifying purify
option to TRUE
. Recall that item purification process is slightly different for IRT and for non-IRT based methods. See the corresponding methods for further information.
Adjustment for multiple comparisons is possible with the argument p.adjust.method
. See the corresponding methods for further information.
A pre-specified set of anchor items can be provided through the anchor
argument. For non-IRT methods, anchor items are used to compute the test score (as matching criterion). For IRT methods, anchor items are used to rescale the item parameters on a common metric. See the corresponding methods for further information.
The output of the genDichoDif
function can be stored in a text file by fixing save.output
and output
appropriately. See the help file of selectGenDif
function (or any other DIF method) for further information.
Kim, S.-H., Cohen, A.S. and Park, T.-H. (1995). Detection of differential item functioning in multiple groups. Journal of Educational Measurement, 32, 261-276. 10.1111/j.1745-3984.1995.tb00466.x
Magis, D., Beland, S., Tuerlinckx, F. and De Boeck, P. (2010). A general framework and an R package for the detection of dichotomous differential item functioning. Behavior Research Methods, 42, 847-862. 10.3758/BRM.42.3.847
Magis, D., Raiche, G., Beland, S. and Gerard, P. (2011). A logistic regression procedure to detect differential item functioning among multiple groups. International Journal of Testing, 11, 365--386. 10.1080/15305058.2011.602810
Penfield, R. D. (2001). Assessing differential item functioning among multiple groups: a comparison of three Mantel-Haenszel procedures. Applied Measurement in Education, 14, 235-259. 10.1207/S15324818AME1403_3
# NOT RUN {
# Loading of the verbal data
data(verbal)
attach(verbal)
# Creating four groups according to gender ("Man" or "Woman") and trait
# anger score ("Low" or "High")
group <- rep("WomanLow", nrow(verbal))
group[Anger>20 & Gender==0] <- "WomanHigh"
group[Anger<=20 & Gender==1] <- "ManLow"
group[Anger>20 & Gender==1] <- "ManHigh"
# New data set
Verbal <- cbind(verbal[,1:24], group)
# Reference group: "WomanLow"
names <- c("WomanHigh", "ManLow", "ManHigh")
# Comparing the three available methods
# with item purification
genDichoDif(Verbal, group = 25, focal.names = names, method = c("GMH", "genLogistic",
"genLord"), purify = TRUE)
# Same analysis, but saving the output into the 'genDicho' file
genDichoDif(Verbal, group = 25, focal.names = names, method = c("GMH", "genLogistic",
"genLord"), purify = TRUE, save.output = TRUE,
output = c("genDicho", "default"))
# }
Run the code above in your browser using DataLab