difORD: DIF detection among ordinal data.

View source: R/difORD.R

difORDR Documentation

DIF detection among ordinal data.

Description

Performs DIF detection procedure for ordinal data based either on adjacent category logit model or on cumulative logit model and likelihood ratio test of a submodel.

Usage

difORD(Data, group, focal.name, model = "adjacent", type = "both", match = "zscore",
       anchor = NULL, purify = FALSE, nrIter = 10, p.adjust.method = "none",
       alpha = 0.05, parametrization)

Arguments

Data

data.frame or matrix: dataset which rows represent ordinaly scored examinee answers and columns correspond to the items. In addition, Data can hold the vector of group membership.

group

numeric or character: a dichotomous vector of the same length as nrow(Data) or a column identifier of Data.

focal.name

numeric or character: indicates the level of group which corresponds to focal group.

model

character: logistic regression model for ordinal data (either "adjacent" (default) or "cumulative"). See Details.

type

character: type of DIF to be tested. Either "both" for uniform and non-uniform DIF (default), or "udif" for uniform DIF only, or "nudif" for non-uniform DIF only. Can be specified as a single value (for all items) or as an item-specific vector.

match

numeric or character: matching criterion to be used as an estimate of trait. Can be either "zscore" (default, standardized total score), "score" (total test score), or vector of the same length as number of observations in Data.

anchor

numeric or character: specification of DIF free items. Either NULL (default), or a vector of item names (column names of Data), or item identifiers (integers specifying the column number) determining which items are currently considered as anchor (DIF free) items. Argument is ignored if match is not "zscore" or "score".

purify

logical: should the item purification be applied? (default is FALSE).

nrIter

numeric: the maximal number of iterations in the item purification (default is 10).

p.adjust.method

character: method for multiple comparison correction. Possible values are "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", and "none" (default). For more details see p.adjust.

alpha

numeric: significance level (default is 0.05).

parametrization

deprecated. Use coef.difORD for different parameterizations.

Details

Calculates DIF likelihood ratio statistics based either on adjacent category logit model or on cumulative logit model for ordinal data.

Using adjacent category logit model, logarithm of ratio of probabilities of two adjacent categories is

log(P(y = k) / P(y = k - 1)) = b_0k + b_1 * x + b_2k * g + b_3 * x:g,

where x is by default standardized total score (also called Z-score) and g is a group membership.

Using cumulative logit model, probability of gaining at least k points is given by 2PL model, i.e.,

P(y >= k) = exp(b_0k + b_1 * x + b_2k * g + b_3 * x:g) / (1 + exp(b_0k + b_1 * x + b_2k * g + b_3 * x:g)).

The category probability (i.e., probability of gaining exactly k points) is then P(y = k) = P(y >= k) - P(y >= k + 1).

Both models are estimated by iteratively reweighted least squares. For more details see vglm.

Missing values are allowed but discarded for item estimation. They must be coded as NA for both, Data and group parameters.

Value

The difORD() function returns an object of class "difORD". The output including values of the test statistics, p-values, and items marked as DIF is displayed by the print() method.

A list of class "difORD" with the following arguments:

Sval

the values of likelihood ratio test statistics.

ordPAR

the estimates of the final model.

ordSE

standard errors of the estimates of the final model.

parM0

the estimates of null model.

parM1

the estimates of alternative model.

llM0

log-likelihood of null model.

llM1

log-likelihood of alternative model.

AICM0

AIC of null model.

AICM1

AIC of alternative model.

BICM0

BIC of null model.

BICM1

BIC of alternative model.

DIFitems

either the column identifiers of the items which were detected as DIF, or "No DIF item detected" in case no item was detected as DIF.

model

model used for DIF detection.

type

character: type of DIF that was tested.

purification

purify value.

nrPur

number of iterations in item purification process. Returned only if purify is TRUE.

difPur

a binary matrix with one row per iteration of item purification and one column per item. "1" in i-th row and j-th column means that j-th item was identified as DIF in i-th iteration. Returned only if purify is TRUE.

conv.puri

logical indicating whether item purification process converged before the maximal number nrIter of iterations. Returned only if purify is TRUE.

p.adjust.method

character: method for multiple comparison correction which was applied.

pval

the p-values by likelihood ratio test.

adj.pval

the adjusted p-values by likelihood ratio test using p.adjust.method.

df

the degress of freedom of likelihood ratio test.

alpha

numeric: significance level.

Data

the data matrix.

group

the vector of group membership.

group.names

levels of grouping variable.

match

matching criterion.

For an object of class "difORD" several methods are available (e.g., methods(class = "difORD")).

Author(s)

Adela Hladka (nee Drabinova)
Institute of Computer Science of the Czech Academy of Sciences
Faculty of Mathematics and Physics, Charles University
hladka@cs.cas.cz

Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz

References

Agresti, A. (2010). Analysis of ordinal categorical data. Second edition. John Wiley & Sons.

Hladka, A. (2021). Statistical models for detection of differential item functioning. Dissertation thesis. Faculty of Mathematics and Physics, Charles University.

Hladka, A. & Martinkova, P. (2020). difNLR: Generalized logistic regression models for DIF and DDF detection. The R Journal, 12(1), 300–323, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.32614/RJ-2020-014")}.

See Also

plot.difORD for graphical representation of item characteristic curves.
coef.difORD for extraction of item parameters with their standard errors.
predict.difORD for calculation of predicted values.
logLik.difORD, AIC.difORD, BIC.difORD for extraction of log-likelihood and information criteria.

p.adjust for multiple comparison corrections.
vglm for estimation function using iteratively reweighted least squares.

Examples

# loading data
data(Anxiety, package = "ShinyItemAnalysis")
Data <- Anxiety[, paste0("R", 1:29)] # items
group <- Anxiety[, "gender"] # group membership variable

# testing both DIF effects with adjacent category logit model
(x <- difORD(Data, group, focal.name = 1, model = "adjacent"))
## Not run: 
# graphical devices
plot(x, item = 6)
plot(x, item = "R6")
plot(x, item = "R6", group.names = c("Males", "Females"))

# estimated parameters
coef(x)
coef(x, SE = TRUE) # with SE
coef(x, SE = TRUE, simplify = TRUE) # with SE, simplified

# AIC, BIC, log-likelihood
AIC(x)
BIC(x)
logLik(x)

# AIC, BIC, log-likelihood for the first item
AIC(x, item = 1)
BIC(x, item = 1)
logLik(x, item = 1)

# testing both DIF effects with Benjamini-Hochberg adjustment method
difORD(Data, group, focal.name = 1, model = "adjacent", p.adjust.method = "BH")

# testing both DIF effects with item purification
difORD(Data, group, focal.name = 1, model = "adjacent", purify = TRUE)

# testing uniform DIF effects
difORD(Data, group, focal.name = 1, model = "adjacent", type = "udif")
# testing non-uniform DIF effects
difORD(Data, group, focal.name = 1, model = "adjacent", type = "nudif")

# testing both DIF effects with total score as matching criterion
difORD(Data, group, focal.name = 1, model = "adjacent", match = "score")

testing both DIF effects with cumulative logit model
(x <- difORD(Data, group, focal.name = 1, model = "cumulative"))
# graphical devices
plot(x, item = 7, plot.type = "cumulative")
plot(x, item = 7, plot.type = "category")

# estimated parameters
coef(x, simplify = TRUE)

## End(Not run)

difNLR documentation built on May 3, 2023, 5:11 p.m.