NLR {difNLR}R Documentation

DIF statistics based on non-linear regression model.

Description

Calculates either DIF likelihood ratio statistics or F statistics for dichotomous data based on non-linear regression model (generalized logistic regression model).

Usage

NLR(Data, group, model, constraints = NULL, type = "all", method = "nls",
    match = "zscore", anchor = 1:ncol(Data), start, p.adjust.method = "none", test = "LR",
    alpha = 0.05, initboot = TRUE, nrBo = 20, sandwich = FALSE)

Arguments

Data

data.frame or matrix: dataset which rows represent scored examinee answers ("1" correct, "0" incorrect) and columns correspond to the items.

group

numeric: binary vector of group membership. "0" for reference group, "1" for focal group.

model

character: generalized logistic regression model to be fitted. See Details.

constraints

character: which parameters should be the same for both groups. Possible values are any combinations of parameters "a", "b", "c", and "d". Default value is NULL. See Details.

type

character: type of DIF to be tested. Possible values are "all" for detecting difference in any parameter (default), "udif" for uniform DIF only (i.e., difference in difficulty parameter "b"), "nudif" for non-uniform DIF only (i.e., difference in discrimination parameter "a"), "both" for uniform and non-uniform DIF (i.e., difference in parameters "a" and "b"), or combination of parameters "a", "b", "c", and "d". Can be specified as a single value (for all items) or as an item-specific vector.

method

character: method used to estimate parameters. The options are "nls" for non-linear least squares (default), "likelihood" for maximum likelihood method with "L-BFGS-B" algorithm, or "irls" for maximum likelihood method with iteratively reweighted least squares (available only for model = "2PL").

match

character or numeric: matching criterion to be used as estimate of trait. Can be either "zscore" (default, standardized total score), "score" (total test score), or numeric 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".

start

numeric: initial values for estimation of parameters. If not specified, starting values are calculated with startNLR function. Otherwise, list with as many elements as number of items. Each element is a named numeric vector of length 8 representing initial values for parameter estimation. Specifically, parameters "a", "b", "c", and "d" are initial values for discrimination, difficulty, guessing, and inattention for reference group. Parameters "aDif", "bDif", "cDif", and "dDif" are then differences in these parameters between reference and focal group.

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.

test

character: test to be performed for DIF detection. Can be either "LR" for likelihood ratio test of a submodel (default), "W" for Wald test, or "F" for F-test of a submodel.

alpha

numeric: significance level (default is 0.05).

initboot

logical: in case of convergence issues, should be starting values re-calculated based on bootstraped samples? (default is TRUE; newly calculated initial values are applied only to items/models with convergence issues).

nrBo

numeric: the maximal number of iterations for calculation of starting values using bootstraped samples (default is 20).

sandwich

logical: should be sandwich estimator used for covariance matrix of parameters when using method = "nls"? Default is FALSE.

Details

Calculation of the test statistics using DIF detection procedure based on non-linear regression (extension of logistic regression procedure; Swaminathan and Rogers, 1990; Drabinova and Martinkova, 2017).

The unconstrained form of 4PL generalized logistic regression model for probability of correct answer (i.e., y = 1) is

P(y = 1) = (c + cDif * g) + (d + dDif * g - c - cDif * g) / (1 + exp(-(a + aDif * g) * (x - b - bDif * g))),

where x is by default standardized total score (also called Z-score) and g is a group membership. Parameters a, b, c, and d are discrimination, difficulty, guessing, and inattention. Terms aDif, bDif, cDif, and dDif then represent differences between two groups (reference and focal) in relevant parameters.

This 4PL model can be further constrained by model and constraints arguments. The arguments model and constraints can be also combined. Both arguments can be specified as a single value (for all items) or as an item-specific vector (where each element correspond to one item).

The model argument offers several predefined models. The options are as follows: Rasch for 1PL model with discrimination parameter fixed on value 1 for both groups, 1PL for 1PL model with discrimination parameter fixed for both groups, 2PL for logistic regression model, 3PLcg for 3PL model with fixed guessing for both groups, 3PLdg for 3PL model with fixed inattention for both groups, 3PLc (alternatively also 3PL) for 3PL regression model with guessing parameter, 3PLd for 3PL model with inattention parameter, 4PLcgdg for 4PL model with fixed guessing and inattention parameter for both groups, 4PLcgd (alternatively also 4PLd) for 4PL model with fixed guessing for both groups, 4PLcdg (alternatively also 4PLc) for 4PL model with fixed inattention for both groups, or 4PL for 4PL model.

The model can be specified in more detail with constraints argument which specifies what parameters should be fixed for both groups. For example, choice "ad" means that discrimination (parameter "a") and inattention (parameter "d") are fixed for both groups and other parameters ("b" and "c") are not. The NA value for constraints means no constraints.

In case that the model considers a difference in guessing or inattention parameter, different parameterization is used and parameters with standard errors are re-calculated by delta method.

Value

A list with the following arguments:

Sval

the values of test statistics.

pval

the p-values by test.

adjusted.pval

adjusted p-values by p.adjust.method.

df

the degrees of freedom of test.

test

used test.

par.m0

the matrix of estimated item parameters for null model.

se.m0

the matrix of standard errors of item parameters for null model.

cov.m0

list of covariance matrices of item parameters for null model.

par.m1

the matrix of estimated item parameters for alternative model.

se.m1

the matrix of standard errors of item parameters for alternative model.

cov.m1

list of covariance matrices of item parameters for alternative model.

conv.fail

numeric: number of convergence issues.

conv.fail.which

the indicators of the items which did not converge.

ll.m0

log-likelihood of null model.

ll.m1

log-likelihood of alternative model.

startBo0

the binary matrix. Columns represents iterations of initial values re-calculations, rows represents items. The value of 0 means no convergence issue in null model, 1 means convergence issue in null model.

startBo1

the binary matrix. Columns represents iterations of initial values re-calculations, rows represents items. The value of 0 means no convergence issue in alternative model, 1 means convergence issue in alternative model.

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

Karel Zvara
Faculty of Mathematics and Physics, Charles University

References

Drabinova, A. & Martinkova, P. (2017). Detection of differential item functioning with nonlinear regression: A non-IRT approach accounting for guessing. Journal of Educational Measurement, 54(4), 498–517, doi:10.1111/jedm.12158.

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, doi:10.32614/RJ-2020-014.

Swaminathan, H. & Rogers, H. J. (1990). Detecting differential item functioning using logistic regression procedures. Journal of Educational Measurement, 27(4), 361–370, doi:10.1111/j.1745-3984.1990.tb00754.x

See Also

p.adjust

Examples

## Not run: 
# loading data
data(GMAT)
Data <- GMAT[, 1:20] # items
group <- GMAT[, "group"] # group membership variable

# testing both DIF effects using LR test (default)
# and model with fixed guessing for both groups
NLR(Data, group, model = "3PLcg")

# using F test
NLR(Data, group, model = "3PLcg", test = "F")

# testing both DIF effects with Benjamini-Hochberg correction
NLR(Data, group, model = "3PLcg", p.adjust.method = "BH")

# 4PL model with the same guessing and inattention
# to test uniform DIF
NLR(Data, group, model = "4PLcgdg", type = "udif")

# 2PL model to test non-uniform DIF
NLR(Data, group, model = "2PL", type = "nudif")

# 4PL model with fixed a and c parameter
# to test difference in b
NLR(Data, group, model = "4PL", constraints = "ac", type = "b")

# using maximum likelihood estimation method with L-BFGS-B algorithm
NLR(Data, group, model = "3PLcg", method = "likelihood")

# using maximum likelihood estimation method with iteratively reweighted least squares algorithm
NLR(Data, group, model = "2PL", method = "irls")

## End(Not run)


[Package difNLR version 1.4.2-1 Index]