difLogReg: General logistic regression DIF method

difLogRegR Documentation

General logistic regression DIF method

Description

Performs DIF detection using logistic regression method with either two groups, more than two groups, or a continuous group variable.

Usage

difLogReg(Data, group, focal.name, anchor = NULL, group.type = "group", 
 	match = "score", type = "both", criterion = "LRT", alpha = 0.05, 
 	purify = FALSE, nrIter = 10, p.adjust.method = NULL, save.output = FALSE, 
 	output = c("out", "default"))
 

Arguments

Data

numeric: either the data matrix only, or the data matrix plus the vector of group membership. See Details.

group

numeric or character: either the vector of group membership or the column indicator (within data) of group membership. See Details.

focal.name

numeric or character indicating the level(s) of group which corresponds to the focal group(s). Ignored if group.type is not "group".

anchor

either NULL (default) or a vector of item names (or identifiers) to specify the anchor items. See Details.

group.type

character: either "group" (default) to specify that group membership is made of two (or more than two) groups, or "cont" to indicate that group membership is based on a continuous criterion. See Details.

match

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.

type

a character string specifying which DIF effects must be tested. Possible values are "both" (default), "udif" and "nudif". See Details.

criterion

a character string specifying which DIF statistic is computed. Possible values are "LRT" (default) or "Wald". See Details.

alpha

numeric: significance level (default is 0.05).

purify

logical: should the method be used iteratively to purify the set of anchor items? (default is FALSE). Ignored if match is not "score".

nrIter

numeric: the maximal number of iterations in the item purification process. (default is 10).

p.adjust.method

either NULL (default) or the acronym of the method for p-value adjustment for multiple comparisons. See Details.

save.output

logical: should the output be saved into a text file? (Default is FALSE).

output

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.

Details

The difLogReg function is a meta-function for logistic regression DIF analysis. It encompasses all possible cases that are currently implemented in difR and makes appropriate calls to the function difLogistic or difGenLogistic.

Three situations are embedded in this function.

  1. The group membership is defined by two distinct groups. In this case, group.type must be "group" and focal.name must be a single value, referring to the name or label of the focal group.

  2. The group membership is defined by a finite, yet larger than two, number of groups. In this case, group.type must be "group" and focal.name must be a vector with the names or labels of all focal groups.

  3. The group membership is a continuous or discrete (but treated as continuous) variable. In this case, DIF is tested with respect to this "membership" variable. Furthermore, group.type must be "cont" and focal.name is ignored (though some value must be specified, for instance NULL).

The specification of the data, the options for item purification, DIF statistic selection, and output saving, are identical to the options arising from the difLogistic and difGenLogistic functions.

Value

A list of class "Logistic" (if group.type is "cont" or with the length of focal.name is one) or "genLogistic", with related arguments (see difLogistic and difGenLogistic).

Author(s)

David Magis
Data science consultant at IQVIA Belux
Brussels, Belgium
Sebastien Beland
Faculte des sciences de l'education
Universite de Montreal (Canada)
sebastien.beland@umontreal.ca
Gilles Raiche
Universite du Quebec a Montreal
raiche.gilles@uqam.ca

References

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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/BRM.42.3.847")}

Swaminathan, H. and Rogers, H. J. (1990). Detecting differential item functioning using logistic regression procedures. Journal of Educational Measurement, 27, 361-370. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1745-3984.1990.tb00754.x")}

See Also

difLogistic, difGenLogistic, dichoDif, genDichoDif

Examples

## Not run: 

 # Loading of the verbal data
 data(verbal)
 attach(verbal)

 # Few examples
 difLogReg(Data=verbal[,1:24], group=verbal[,26], focal.name=1)
 difLogReg(Data = verbal[,1:24], group = verbal[,26], focal.name = 1, match = verbal[,25])
 difLogReg(Data = verbal[,1:24], group = verbal[,25], focal.name = 1, group.type = "cont")

 group<-rep("WomanLow",nrow(verbal))
 group[Anger>20 & Gender==0] <- "WomanHigh"
 group[Anger<=20 & Gender==1] <- "ManLow"
 group[Anger>20 & Gender==1] <- "ManHigh"
 names <- c("WomanHigh", "ManLow", "ManHigh")

 difLogReg(Data = verbal[,1:24], group = group, focal.name = names)
 
## End(Not run)
 

difR documentation built on June 8, 2025, 1:03 p.m.