regDIF | R Documentation |
Identify DIF in item response theory models using regularization.
regDIF(item.data,
pred.data,
prox.data = NULL,
item.type = NULL,
pen.type = NULL,
pen.deriv = TRUE,
tau = NULL,
num.tau = 100,
alpha = 1,
gamma = 3,
anchor = NULL,
stdz = TRUE,
control = list())
item.data |
Matrix or data frame of item responses. See below for supported item types. |
pred.data |
Matrix or data frame of predictors affecting item responses
(DIF) and latent variable (impact). See |
prox.data |
Optional vector of observed scores to serve as a proxy for the latent variable. If a vector is supplied, a multivariate regression model will be fit to the data. The default is NULL, indicating that latent scores will be estimated during model estimation. |
item.type |
Optional character value or vector indicating the type of item to be modeled. The default is NULL, corresponding to a 2PL or graded item type. Different item types may be specified for a single model by providing a vector equal in length to the number of items in item.data. The options include:
|
pen.type |
Optional character value indicating the penalty function to use. The default is NULL, corresponding to the LASSO function. The options include:
|
pen.deriv |
Logical value indicating whether to use the second derivative of the penalized parameter during regularization. The default is TRUE. |
tau |
Optional numeric vector of tau values |
num.tau |
Numeric value indicating how many tau values to fit. The default is 100. |
alpha |
Numeric value indicating the alpha parameter in the elastic net penalty function. Alpha controls the degree to which LASSO or ridge is used during regularization. The default is 1, which is equivalent to LASSO. NOTE: If using MCP penalty, alpha may not be exactly 0. |
gamma |
Numeric value indicating the gamma parameter in the MCP function. Gamma controls the degree of tapering of DIF effects as tau decreases. Larger gamma leads to faster tapering (less bias but possibly more unstable optimization), whereas smaller gamma leads to slower tapering (more bias but more stable optimization). Default is 3. Must be greater than 1. |
anchor |
Optional numeric value or vector indicating which item
response(s) are anchors (e.g., |
stdz |
Logical value indicating whether to standardize DIF and
impact predictors for regularization. Default is |
control |
Optional list of different model specifications and optimization parameters. May be:
|
Function returns an object of class regDIF
, which is a list of results from
the regularization routine
library(regDIF)
head(ida)
item.data <- ida[,1:6]
pred.data <- ida[,7:9]
prox.data <- rowSums(item.data)
fit <- regDIF(item.data, pred.data, prox.data, num.tau = 10)
summary(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.