Travis build status

options(width=80)
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

regDIF: Regularized Differential Item Functioning

This R package performs regularization of differential item functioning (DIF) parameters in item response theory (IRT) models using a penalized expectation-maximization algorithm.

Version 1.1.0 Features

regDIF can:

Installation

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")

Getting Started

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)

Questions

Please send any questions to wbelzak@gmail.com.



wbelzak/regDIF documentation built on Jan. 5, 2023, 9:53 p.m.