Learn R Programming

difNLR (version 1.3.7)

ORD: DIF likelihood ratio statistics for ordinal data.

Description

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

Usage

ORD(Data, group, model = "adjacent", type = "both", match = "zscore",
    anchor = 1:ncol(Data), p.adjust.method = "none", parametrization = "irt",
    alpha = 0.05)

Arguments

Data

data.frame or matrix: dataset which rows represent ordinaly scored examinee answers and columns correspond to the items.

group

numeric: binary vector of group membership. "0" for reference group, "1" for 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 (i.e., difference in parameters "a" and "b") (default), or "udif" for uniform DIF only (i.e., difference in difficulty parameter "b"), or "nudif" for non-uniform DIF only (i.e., difference in discrimination parameter "a"). 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

character or numeric: specification of DIF free items. A vector of item identifiers (integers specifying the column number) specifying which items are currently considered as anchor (DIF free) items. Argument is ignored if match is not "zscore" or "score".

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.

parametrization

character: parametrization of regression coefficients. Possible options are "irt" for difficulty-discrimination parametrization (default) and "classic" for intercept-slope parametrization. See Details.

alpha

numeric: significance level (default is 0.05).

Value

A list with the following arguments:

Sval

the values of likelihood ratio test statistics.

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.

par.m0

the estimates of null model.

par.m1

the estimates of alternative model.

se.m0

standard errors of parameters in null model.

se.m1

standard errors of parameters in alternative model.

ll.m0

log-likelihood of null model.

ll.m1

log-likelihood of alternative model.

AIC.m0

AIC of null model.

AIC.m1

AIC of alternative model.

BIC.m0

BIC of null model.

BIC.m1

BIC of alternative model.

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)) = (a + aDif*g)*(x - b_k - b_kDif*g),$$ where \(x\) is by default standardized total score (also called Z-score) and \(g\) is a group membership. Parameter \(a\) is a discrimination of the item and parameter \(b_k\) is difficulty for the \(k\)-th category of the item. Terms \(a_Dif\) and \(b_kDif\) then represent differences between two groups (reference and focal) in relevant parameters.

Using cumulative logit model, probability of gaining at least \(k\) points is given by 2PL model, i.e., $$P(y >= k) = exp((a + aDif*g)*(x - b_k - b_kDif*g))/(1 + exp((a + aDif*g)*(x - b_k - b_kDif*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.

Argument parametrization is a character which specifies parametrization of regression parameters. Default option is "irt" which returns IRT parametrization (difficulty-discrimination, see above). Option "classic" returns intercept-slope parametrization with effect of group membership and interaction with matching criterion, i.e. \(b_0k + b_1*x + b_2k*g + b_3*x*g\) instead of \((a + a_Dif*g)*(x - b_k - b_kDif*g))\).

References

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

Hladka, A. & Martinkova, P. (2020). difNLR: Generalized logistic regression models for DIF and DDF detection. The R journal, 12(1), 300--323, 10.32614/RJ-2020-014.

See Also

p.adjust vglm

Examples

Run this code
# NOT RUN {
# loading data
data(dataMedicalgraded, package = "ShinyItemAnalysis")
df <- dataMedicalgraded[, c(1:5, 101)]
df <- df[complete.cases(df), ]

Data <- df[, 1:5]
group <- df[, 6]

# Testing both DIF effects
ORD(Data, group, type = "both")

# Testing uniform DIF effects
ORD(Data, group, type = "udif")

# Testing non-uniform DIF effects
ORD(Data, group, type = "nudif")

# Testing DIF using cumulative logit model
ORD(Data, group, model = "cumulative")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab