MyNixOS website logo
Description

Regularized Differential Item Functioning.

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.

Travis buildstatus

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.1 Features

regDIF can:

  • Handle multiple continuous and categorical DIF covariates;
  • Support binary, ordinal, and continuous item responses;
  • Use LASSO, ridge, MCP, elastic net, and group penalty functions for regularization;
  • Allow for proxy data to be used in place of estimating latent variable scores, which leads to much faster estimation speed.

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)
#>   item1 item2 item3 item4 item5 item6 age gender study
#> 1     0     0     0     0     0     0  -2     -1    -1
#> 2     0     0     0     0     0     0   0     -1    -1
#> 3     0     0     0     0     0     0   3     -1    -1
#> 4     0     1     1     1     1     1   1     -1    -1
#> 5     0     0     0     0     0     0  -2     -1    -1
#> 6     1     0     0     0     0     0   1     -1    -1

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)
#> Call:
#> regDIF(item.data = item.data, pred.data = pred.data, num.tau = 10)
#> 
#> Optimal model (out of 10):
#>          tau          bic 
#>    0.1753246 4081.6941000 
#> 
#> Non-zero DIF effects:
#>    item4.int.age    item5.int.age item5.int.gender  item5.int.study 
#>           0.2153          -0.0897          -0.5717           0.6018 
#>  item4.slp.study item5.slp.gender 
#>          -0.0936          -0.1764

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)
#> Call:
#> regDIF(item.data = item.data, pred.data = pred.data, prox.data = rowSums(item.data))
#> 
#> Optimal model (out of 100):
#>          tau          bic 
#>    0.2766486 3540.8070000 
#> 
#> Non-zero DIF effects:
#> item3.int.gender    item4.int.age item5.int.gender  item5.int.study 
#>           0.0955           0.2200          -0.5118           0.7040 
#> item2.slp.gender  item4.slp.study item5.slp.gender 
#>           0.1102          -0.1413          -0.1384

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)
#> Call:
#> regDIF(item.data = item.data, pred.data = pred.data, prox.data = rowSums(item.data), 
#>     alpha = 0.5)
#> 
#> Optimal model (out of 100):
#>          tau          bic 
#>    0.5685967 3563.7495000 
#> 
#> Non-zero DIF effects:
#> item3.int.gender    item4.int.age    item5.int.age item5.int.gender 
#>           0.0681           0.1672          -0.0939          -0.3463 
#>  item5.int.study item2.slp.gender  item4.slp.study item5.slp.gender 
#>           0.4346           0.0778          -0.1172          -0.1379

Questions

Please send any questions to [email protected].

Metadata

Version

1.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows