An R package that performs regularization of differential item functioning (DIF) parameters in item response theory (IRT) models using a penalized expectation-maximization algorithm.
To get the current development version from Github:
A simulated data example with 6 item responses (binary) and 3 background variables (gender, age, study) is used to demonstrate 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.
Second, the regDIF()
function fits a sequence of 10 tuning parameter values.
Finally, the DIF results are shown.
summary(fit)
#> Call:
#> regDIF(item.data = item.data, pred.data = pred.data, num.tau = 10)
#>
#> Optimal model (out of 10):
#> tau bic
#> 0.1934603 4074.7270000
#>
#> Non-zero DIF effects:
#> item4.int.age item5.int.age item5.int.gender item5.int.study
#> 0.263 -0.247 -0.656 0.349
Please send any questions to wbelzak@gmail.com.