The lordif
package can be used to perform an ordinal
(common odds-ratio) logistic regression differential item functioning
(DIF) analysis using IRT theta estimates as the conditioning variable.
The graded response model (GRM) or the generalized partial credit model
(GPCM) is used for IRT parameter estimation. Items flagged for DIF are
treated as unique to each group and group-specific item parameters are
obtained. Non-DIF items serve as anchor items to the initial
calibration. The procedure runs iteratively until the same set of items
is flagged over two consecutive iterations, unless anchor items are
specified a priori.
Load the PROMIS Anxiety data (containing 766 observations on 29
five-point rating scale items measuring anxiety; try
?Anxiety
for more information):
data("Anxiety")
The dataset also includes three demographic variables
(age
, gender
, and education
).
Create a data frame containing only the item responses:
<- Anxiety[paste0("R", 1:29)] resp.data
Create a DIF grouping variable:
<- Anxiety$gender gender
This numeric variable and coded as 0 = Male
and
1 = Female
. The lowest level serves as the reference group
(0 = Male
).
Running lordif
accepting all default settings:
<- lordif(resp.data, gender) gender_DIF
By default, the graded response model is fitted to the response data and the likelihood-ratio \(\chi^2\) statistic is used to flag DIF items with \(\alpha = 0.01\).
Displaying the DIF effects graphically:
plot(gender_DIF, labels = c("Male", "Female"))
The plots can be saved as a PDF file (or in other formats), e.g.,
pdf(...)
plot(gender_DIF, labels = c("Male", "Female"))
dev.off()
The flagging criterion can be determined empirically through Monte Carlo simulations:
lordif(resp.data, gender, MonteCarlo = TRUE)
The MonteCarlo = TRUE
option above calls the
montecarlo()
function internally to generate and apply
empirically determined thresholds in lieu of pre-specified or
theoretically determined thresholds. We can call the
montecarlo()
function separately to generate empirical
thresholds. The following generates empirical thresholds based on 200
DIF-free datasets (conforming to the dimension of the observed data,
resp.data
):
<- montecarlo(gender_DIF, nr = 200) gender_DIF_MC
Displaying the empirical thresholds graphically:
plot(gender_DIF_MC)