formulaNLR: Creates a formula for non-linear regression DIF models.

View source: R/formulaNLR.R

formulaNLRR Documentation

Creates a formula for non-linear regression DIF models.

Description

The function returns the formula of the non-linear regression DIF model based on model specification and DIF type to be tested.

Usage

formulaNLR(model, constraints = NULL, type = "all", parameterization = "irt",
           outcome)

Arguments

model

character: generalized logistic regression model for which starting values should be estimated. 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.

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 any combination of parameters "a", "b", "c", and "d". Can be specified as a single value (for all items) or as an item-specific vector.

parameterization

character: parameterization of regression coefficients. Possible options are "irt" (IRT parameterization, default), "is" (intercept-slope), and "logistic" (logistic regression as in the glm function, available for the "2PL" model only). See Details.

outcome

character: name of outcome to be printed in formula. If not specified "y" is used.

Details

The unconstrained form of the 4PL generalized logistic regression model for probability of correct answer (i.e., Y_{pi} = 1) using IRT parameterization is

P(Y_{pi} = 1|X_p, G_p) = (c_{iR} \cdot G_p + c_{iF} \cdot (1 - G_p)) + (d_{iR} \cdot G_p + d_{iF} \cdot (1 - G_p) - c_{iR} \cdot G_p - c_{iF} \cdot (1 - G_p)) / (1 + \exp(-(a_i + a_{i\text{DIF}} \cdot G_p) \cdot (X_p - b_p - b_{i\text{DIF}} \cdot G_p))),

where X_p is the matching criterion (e.g., standardized total score) and G_p is a group membership variable for respondent p. Parameters a_i, b_i, c_{iR}, and d_{iR} are discrimination, difficulty, guessing, and inattention for the reference group for item i. Terms a_{i\text{DIF}} and b_{i\text{DIF}} then represent differences between the focal and reference groups in discrimination and difficulty for item i. Terms c_{iF}, and d_{iF} are guessing and inattention parameters for the focal group for item i. In the case that there is no assumed difference between the reference and focal group in the guessing or inattention parameters, the terms c_i and d_i are used.

Alternatively, intercept-slope parameterization may be applied:

P(Y_{pi} = 1|X_p, G_p) = (c_{iR} \cdot G_p + c_{iF} \cdot (1 - G_p)) + (d_{iR} \cdot G_p + d_{iF} \cdot (1 - G_p) - c_{iR} \cdot G_p - c_{iF} \cdot (1 - G_p)) / (1 + \exp(-(\beta_{i0} + \beta_{i1} \cdot X_p + \beta_{i2} \cdot G_p + \beta_{i3} \cdot X_p \cdot G_p))),

where parameters \beta_{i0}, \beta_{i1}, \beta_{i2}, \beta_{i3} are intercept, effect of the matching criterion, effect of the group membership, and their mutual interaction, respectively.

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 set the same 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.

Three possible parameterizations can be specified in the "parameterization" argument: "irt" returns the IRT parameters of the reference group and differences in these parameters between the reference and focal group. Parameters of asymptotes are printed separately for the reference and focal groups. "is" returns intercept-slope parameterization. Parameters of asymptotes are again printed separately for the reference and focal groups. "logistic" returns parameters in logistic regression parameterization as in the glm function, and it is available only for the 2PL model.

Value

A list of two models. Each includes a formula, parameters to be estimated, and their lower and upper constraints.

Author(s)

Adela Hladka (nee Drabinova)
Institute of Computer Science of the Czech Academy of Sciences
hladka@cs.cas.cz

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

See Also

difNLR

Examples

# 3PL model with the same guessing parameter for both groups
# to test both types of DIF
formulaNLR(model = "3PLcg", type = "both")
formulaNLR(model = "3PLcg", type = "both", parameterization = "is")

# 4PL model with the same guessing and inattention parameters
# to test uniform DIF
formulaNLR(model = "4PLcgdg", type = "udif")
formulaNLR(model = "4PLcgdg", type = "udif", parameterization = "is")

# 2PL model to test non-uniform DIF
formulaNLR(model = "2PL", type = "nudif")
formulaNLR(model = "2PL", type = "nudif", parameterization = "is")
formulaNLR(model = "2PL", type = "nudif", parameterization = "logistic")

# 4PL model to test all possible DIF
formulaNLR(model = "4PL", type = "all", parameterization = "irt")
formulaNLR(model = "4PL", type = "all", parameterization = "is")

# 4PL model with fixed a and c parameters
# to test difference in b
formulaNLR(model = "4PL", constraints = "ac", type = "b")
formulaNLR(model = "4PL", constraints = "ac", type = "b", parameterization = "is")

adelahladka/difNLR documentation built on Dec. 23, 2024, 2:20 a.m.