| dif_analysis | R Documentation |
Evaluates differential item functioning (DIF) using loess, Mantel-Haenszel (MH), logistic regression, and item response theory (IRT) approaches.
dif_analysis(
dif.data,
dif.methods = "default",
match.type = "Total",
match.bins = NULL,
item.type = NULL,
stop = TRUE
)
dif.data |
an object returned from |
dif.methods |
character vector with one or more methods of of investigating DIF:
locally estimated scatterplot smoothing ( |
match.type |
For the loess, MH, and logistic methods, a character indicating whether a
total summed score ( |
match.bins |
For MH, an optional vector of bin sizes for stratifying the |
item.type |
For IRT, the type of model to fit for each item. The default is |
stop |
If |
This is a wrapper for the functions dif_loess, dif_mh,
dif_logistic, and dif_irt, which run the requested DIF analyses
on dif.data$item.data by dif.data$dif.groups.
Usage notes:
Dichotomous items must be coded 0 = incorrect, 1 = correct.
The Mantel-Haenszel and logistic methods can only accommodate dichotomous items.
Polytomous item responses are expected to be sequential integers (e.g., 1, 2, 3) but the lowest code does not have to be 0. Polytomous items are unit scaled when calculating the total or rest score.
Items with different number of response categories across levels of dif.data$dif.groups are removed from dif.data$item.data for the "IRT" method.
A list containing dif.data and the results from each selected method.
The list is not formatted in a directly usable manner; it is intended to be passed to
dif_models for further processing or to dif_report for user-friendly formatting.
data("mdat")
# prep data
dif.data <- dif_prep(item.data = mdat`[`5:ncol(mdat)],
dif.groups = mdat$gender,
na.to.0 = TRUE)
# DIF analysis by dif.groups
# using rest scores and binning match scores by deciles to avoid empty cells in MH analysis
dif.analysis <- dif_analysis(dif.data = dif.data,
dif.methods = c("MH", "IRT"),
match.type = "Rest",
match.bins = seq(0, 1, by = .1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.