Learn R Programming

difNLR (version 1.3.0)

NLR: DIF statistics based on non-linear regression model.

Description

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

Usage

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

Arguments

Data

numeric: either binary data matrix only, or the binary data matrix plus the vector of group . See Details.

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. Default value is NULL. See Details.

type

character: type of DIF to be tested. Possible values are "both" (default), "udif", "nudif", "all", or combination of parameters "a", "b", "c" and "d". See Details.

method

character: what method should be used for estimation of parameters in model. The options are "nls" for non-linear least squares (default) and "likelihood" for maximum likelihood method.

match

specifies matching criterion. Can be either "zscore" (default, standardized total score), "score" (total test score), or vector of the same length as number of observations in Data. See Details.

anchor

a vector of integers specifying which items are currently considered as anchor (DIF free) items. By default, all items are considered as anchors. Argument is ignored if match is not "zscore" or "score". See Details.

start

numeric: matrix with n rows (where n is the number of items) and 8 columns containing initial item parameters estimates. See Details.

p.adjust.method

character: method for multiple comparison correction. See Details.

test

character: test to be performed for DIF detection (either "LR" (default), or "F"). See Details.

alpha

numeric: significance level (default is 0.05).

initboot

logical: in case of convergence issues, should be starting values recalculated based on bootstraped samples? (default is TRUE). See Details.

nrBo

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

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 degress of freedom of test.

test

used test.

par.m0

the matrix of estimated item parameters for m0 model.

se.m0

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

cov.m0

list of covariance matrices of item parameters for m0 model.

par.m1

the matrix of estimated item parameters for m1 model.

se.m1

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

cov.m1

list of covariance matrices of item parameters for m1 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 m0 model.

ll.m1

log-likelihood of m1 model.

startBo0

the binary matrix. Columns represents iterations of initial values recalculations, rows represents items. The value of 0 means no convergence issue in m0 model, 1 means convergence issue in m0 model.

startBo1

the binary matrix. Columns represents iterations of initial values recalculations, rows represents items. The value of 0 means no convergence issue in m1 model, 1 means convergence issue in m1 model.

Details

DIF detection procedure based on Non-Linear Regression is the extension of Logistic Regression procedure (Swaminathan and Rogers, 1990).

The Data is a matrix which rows represents examinee scored answers (1 - correct, 0 - incorrect) and columns correspond to the items. The group must be a vector of the same length as nrow(Data).

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 standardized total score (also called Z-score) and g is group membership. Parameters a, b, c and d are discrimination, difficulty, guessing and inattention. Parameters aDif, bDif, cDif and dDif then represent differences between two groups in discrimination, difficulty, guessing and inattention.

This 4PL model can be further constrained by model and constraints arguments. The arguments model and constraints can be also combined.

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 arguments should be fixed for both groups. For example, choice "ad" means that discrimination (a) and inattention (d) are fixed for both groups and other parameters (b and c) are not.

The type corresponds to type of DIF to be tested. Possible values are "both" to detect any DIF caused by difference in difficulty or discrimination (i.e., uniform and/or non-uniform), "udif" to detect only uniform DIF (i.e., difference in difficulty b), "nudif" to detect only non-uniform DIF (i.e., difference in discrimination a), or "all" to detect DIF caused by difference caused by any parameter that can differed between groups. The type of DIF can be also specified in more detail by using combination of parameters a, b, c and d. For example, with an option "c" for 4PL model only the difference in parameter c is tested.

Argument match represents the matching criterion. It can be either the standardized test score (default, "zscore"), total test score ("score"), or any other continuous or discrete variable of the same length as number of observations in Data. Matching criterion is used in NLR function as a covariate in non-linear regression model.

The start is a list with as many elements as number of items. Each element is a named numeric vector 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. If not specified, starting values are calculated with startNLR function.

The p.adjust.method is a character for p.adjust function from the stats package. Possible values are "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none".

In case of convergence issues, with an option initboot = TRUE, the starting values are re-calculated based on bootstraped samples. Newly calculated initial values are applied only to items/models with convergence issues.

In case that model considers difference in guessing or inattention parameter, the different parameterization is used and parameters with standard errors are recalculated by delta method. However, covariance matrices stick with alternative parameterization.

References

Drabinova, A. & Martinkova P. (2017). Detection of Differential Item Functioning with NonLinear Regression: Non-IRT Approach Accounting for Guessing. Journal of Educational Measurement, 54(4), 498-517, https://doi.org/10.1111/jedm.12158.

Swaminathan, H. & Rogers, H. J. (1990). Detecting Differential Item Functioning Using Logistic Regression Procedures. Journal of Educational Measurement, 27, 361-370.

See Also

p.adjust

Examples

Run this code
# NOT RUN {
# loading data based on GMAT
data(GMAT)

Data  <- GMAT[, 1:20]
group <- GMAT[, "group"]

# 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
NLR(Data, group, model = "3PLcg", method = "likelihood")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab