Title: | Regularized Differential Item Functioning |
---|---|
Description: | Performs regularization of differential item functioning (DIF) parameters in item response theory (IRT) models (Belzak & Bauer, 2020) <https://pubmed.ncbi.nlm.nih.gov/31916799/> using a penalized expectation-maximization algorithm. |
Authors: | William Belzak |
Maintainer: | William Belzak <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2025-03-06 03:33:10 UTC |
Source: | https://github.com/wbelzak/regdif |
Regularized Differential Item Functioning
regDIF is a package that performs regularization of differential item functioning (DIF) in item response theory (IRT) and confirmatory factor analysis (CFA) models using a penalized expectation-maximization algorithm.
William Belzak [email protected]
Coefficient function for regDIF function
## S3 method for class 'regDIF' coef(object, tau = NULL, method = "bic", ...)
## S3 method for class 'regDIF' coef(object, tau = NULL, method = "bic", ...)
object |
Fitted regDIF model object. |
tau |
Optional character or numeric indicating the tau(s) at
which the model coefficients are returned. For character value, may be
|
method |
Character value indicating the model fit statistic to be used
for determining |
... |
Additional arguments to be passed through to |
NULL
A simulated dataset containing six binary items and three DIF covariates
ida
ida
A data frame with 500 rows and 9 variables:
...
Plot function for regDIF function
## S3 method for class 'regDIF' plot(x, y = NULL, method = "bic", color.seed = 123, legend.plot = TRUE, ...)
## S3 method for class 'regDIF' plot(x, y = NULL, method = "bic", color.seed = 123, legend.plot = TRUE, ...)
x |
Fitted regDIF model object. |
y |
Unused for plotting regDIF model object. |
method |
Fit statistic to use for identifying DIF effects in plot. |
color.seed |
Random seed to sample line colors and line types for DIF effects in plot. |
legend.plot |
Logical indicating whether to plot a legend. Default is |
... |
Additional arguments to be passed through to |
a "plot"
object for a "regDIF"
fit
Print function for regDIF function
## S3 method for class 'regDIF' print(x, ...)
## S3 method for class 'regDIF' print(x, ...)
x |
Fitted regDIF model object. |
... |
Additional arguments to be passed through |
NULL
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 = FALSE, tau = NULL, num.tau = 100, alpha = 1, gamma = 3, anchor = NULL, stdz = TRUE, control = list())
regDIF(item.data, pred.data, prox.data = NULL, item.type = NULL, pen.type = NULL, pen.deriv = FALSE, 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 FALSE. |
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)
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)
Summary function for regDIF function
## S3 method for class 'regDIF' summary(object, method = "bic", ...)
## S3 method for class 'regDIF' summary(object, method = "bic", ...)
object |
Fitted regDIF model object. |
method |
Fit statistic to use for displaying minimum tau model. |
... |
Additional arguments to be passed through |
NULL