options(width=80) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
This R package performs regularization of differential item functioning (DIF) parameters in item response theory (IRT) models using a penalized expectation-maximization algorithm.
regDIF can:
To get the current released version from CRAN:
install.packages("regDIF")
To get the current development version from Github:
# install.packages("devtools") devtools::install_github("wbelzak/regDIF")
A simulated data example with 6 item responses (binary) and 3 background variables (gender, age, study) is available in the regDIF package:
library(regDIF) head(ida)
First, the item responses and predictor values are separately specified:
item.data <- ida[, 1:6] pred.data <- ida[, 7:9]
Second, the regDIF()
function fits a sequence of 10 tuning parameter values using a penalized
EM algorithm, which assumes a normal latent variable affects all item responses:
fit <- regDIF(item.data, pred.data, num.tau = 10)
The DIF results are shown below:
summary(fit)
When estimation speed is slow, proxy data may be used in place of latent score estimation:
fit_proxy <- regDIF(item.data, pred.data, prox.data = rowSums(item.data))
summary(fit_proxy)
Other penalty functions (besides LASSO) may also be used. For instance, the elastic net penalty uses
a second tuning parameter, alpha
, to vary the ratio of LASSO to ridge penalties:
fit_proxy_net <- regDIF(item.data, pred.data, prox.data = rowSums(item.data), alpha = .5)
summary(fit_proxy_net)
Please send any questions to wbelzak@gmail.com.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.