LassoData | R Documentation |
A Function that rearrange the matrix to use the lasso DIF detection for dichotomous items.
LassoData(Data, group)
Data |
numeric: either the data matrix only, or the data matrix plus the vector of group membership. |
group |
numeric or character: either the vector of group membership or the column indicator (within Data) of group membership. |
This function rearranges the data matrix for use in lasso-based DIF detection with dichotomous items. It requires a matrix of dichotomous item responses and a vector indicating group membership.
A matrix of five columns where, respectively,:
SCORE |
is the total score. |
GROUP |
is the group membership. |
PERS |
is the number of the respondent. |
Y |
is the dichotomous answer to the item. Only "0" and "1" are allowed. |
ITEM |
is the item name (must be a character). |
Sebastien Beland
Faculte des sciences de l'education
Universite de Montreal (Canada)
sebastien.beland@umontreal.ca
Carl F. Falk
Department of Psychology
McGill University (Canada)
carl.falk@mcgill.ca, https://www.mcgill.ca/psychology/carl-f-falk
Magis, D., Tuerlinckx, F., & De Boeck, P. (2015). Detection of Differential Item Functioning Using the Lasso Approach. Journal of Educational and Behavioral Statistics, 40(2), 111–135. https://doi.org/10.3102/1076998614559747
## Not run:
# Example with the verbal data
data(verbal)
LassoData(Data=verbal[,1:24], group=verbal[,26])
# Example with SimDichoDif to generate uniform DIF
It <- 15 # number of items
ItDIFa <- NULL
ItDIFb <- c(1,3)
NR <- 100 # number of responses for group 1 (reference)
NF <- 100 # number of responses for group 2 (focal)
a <- rep(1,It)
b <- rnorm(It,1,.5)
Gb <- rep(2,2) # Group value for U-DIF
Ga <- 0 # Group value for NU-DIF: need to be fix to 0 for U-DIF
Out1 <- SimDichoDif(It,ItDIFa,ItDIFb,NR,NF,a,b,Ga,Gb)
Data<-Out1$data[,1:15]
Member<-Out1$data[,16]
LassoData(Data=Data, group=Member)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.