Description Usage Arguments Details Value Author(s) References See Also Examples

Performs DIF detection procedure based on non-linear regression model (generalized logistic regression) and either likelihood-ratio or F test of submodel.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
difNLR(Data, group, focal.name, model, constraints, type = "both", method = "nls",
match = "zscore", anchor = NULL, purify = FALSE, nrIter = 10, test = "LR", alpha = 0.05,
p.adjust.method = "none", start, initboot = T, nrBo = 20)
## S3 method for class 'difNLR'
print(x, ...)
## S3 method for class 'difNLR'
fitted(object, item = "all", ...)
## S3 method for class 'difNLR'
coef(object, ...)
## S3 method for class 'difNLR'
logLik(object, item = "all", ...)
## S3 method for class 'difNLR'
AIC(object, item = "all", ...)
## S3 method for class 'difNLR'
BIC(object, item = "all", ...)
## S3 method for class 'difNLR'
residuals(object, item = "all", ...)
``` |

`Data` |
numeric: either the scored data matrix only, or the scored data
matrix plus the vector of group. See |

`group` |
numeric or character: either the binary vector of group membership or
the column indicator (in |

`focal.name` |
numeric or character: indicates the level of |

`model` |
character: generalized logistic regression model to be fitted. See |

`constraints` |
character: which parameters should be the same for both groups. See |

`type` |
character: type of DIF to be tested. Possible values are |

`method` |
character: method used to estimate parameters. The options are |

`match` |
character or numeric: specifies matching criterion. Can be either |

`anchor` |
Either |

`purify` |
logical: should the item purification be applied? (default is |

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

`test` |
character: test to be performed for DIF detection. Can be either |

`alpha` |
numeric: significance level (default is 0.05). |

`p.adjust.method` |
character: method for multiple comparison correction. See |

`start` |
numeric: list with as many elements as number of items. Each element is a named
numeric vector with values representing initial values for parameter estimation. See |

`initboot` |
logical: in case of convergence issues, should be starting values recalculated based on
bootstraped samples? (default is |

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

`x` |
an object of "difNLR" class |

`...` |
other generic parameters for S3 methods. |

`object` |
an object of "difNLR" class |

`item` |
either character ( |

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 scored examinee answers (`"1"`

correct,
`"0"`

incorrect) and columns correspond to the items. In addition, `Data`

can hold
the vector of group membership. If so, `group`

is a column indicator of `Data`

.
Otherwise, `group`

must be a dichotomous 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 by default standardized total score (also called Z-score) and g is 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 in relevant parameters.

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
parameters 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`

.

A set of anchor items (DIF free) can be specified through the `anchor`

argument. It need to be a vector of either
item names (as specified in column names of `Data`

) or item identifiers (integers specifying the column number).
In case anchor items are provided, only these items are used to compute matching criterion `match`

. If the `match`

argument is not either `"zscore"`

or `"score"`

, `anchor`

argument is ignored. When anchor items are
provided, purification is not applied.

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"`

.

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.

Missing values are allowed but discarded for item estimation. They must be coded as
`NA`

for both, `data`

and `group`

parameters.

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.

The `difNLR()`

function returns an object of class `"difNLR"`

. The output
is displayed by the `print()`

method.

Item characteristic curves and graphical representation of DIF statistics can be displayed
with `plot()`

method. For more details see `plot.difNLR`

.
Estimated parameters can be displayed with `coef()`

method.

Fitted values can be extracted by the `fitted()`

method for converged item(s)
specified in `item`

argument.

Predicted values are produced by the `predict()`

method for converged item(s)
specified in `item`

argument. New data can be introduced with `match`

and `group`

arguments.
For more details see `predict.difNLR`

.

Residuals are extracted with the `residuals()`

method for converged item(s)
specified in `item`

argument.

Log-likelihood, Akaike's information criterion and Schwarz's Bayesian criterion can be
extracted with methods `logLik()`

, `AIC()`

, `BIC()`

for converged item(s)
specified in `item`

argument.

Object of class `"difNLR"`

is a list with the following components:

`Sval`

the values of test statistics.

`nlrPAR`

the estimates of final model.

`nlrSE`

the standard errors of estimates of final model.

`parM0`

the estimates of null model.

`seM0`

the standard errors of estimates of null model.

`covM0`

the covariance matrices of estimates of null model.

`parM1`

the estimates of alternative model.

`seM1`

the standard errors of estimates of alternative model.

`covM1`

the covariance matrices of estimates of alternative model.

`alpha`

numeric: significance level.

`DIFitems`

either the column indicators of the items which were detected as DIF, or

`"No DIF item detected"`

.`match`

matching criterion.

`model`

fitted model.

`type`

character: type of DIF that was tested. If parameters were specified, the value is

`"other"`

.`types`

character: the parameters (specified by user,

`type`

has value`"other"`

) which were tested for difference.`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.

`test`

used test.

`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-1-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`

.`group`

the vector of group membership.

`Data`

the data matrix.

`method`

used estimation method.

`conv.fail`

numeric: number of convergence issues.

`conv.fail.which`

the indicators of the items which did not converge.

`llM0`

log-likelihood of null model.

`llM1`

log-likelihood of alternative model.

Adela Drabinova

Institute of Computer Science, The Czech Academy of Sciences

Faculty of Mathematics and Physics, Charles University

[email protected]

Patricia Martinkova

Institute of Computer Science, The Czech Academy of Sciences

[email protected]

Karel Zvara

Faculty of Mathematics and Physics, Charles University

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.

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | ```
## Not run:
# loading data based on GMAT
data(GMAT)
Data <- GMAT[, 1:20]
group <- GMAT[, "group"]
# Testing both DIF effects using likelihood-ratio test and
# 3PL model with fixed guessing for groups
(x <- difNLR(Data, group, focal.name = 1, model = "3PLcg"))
# Testing both DIF effects using F test and
# 3PL model with fixed guessing for groups
difNLR(Data, group, focal.name = 1, model = "3PLcg", test = "F")
# Testing both DIF effects using LR test,
# 3PL model with fixed guessing for groups
# and Benjamini-Hochberg correction
difNLR(Data, group, focal.name = 1, model = "3PLcg", p.adjust.method = "BH")
# Testing both DIF effects using LR test,
# 3PL model with fixed guessing for groups
# and item purification
difNLR(Data, group, focal.name = 1, model = "3PLcg", purify = T)
# Testing both DIF effects using 3PL model with fixed guessing for groups
# and total score as matching criterion
difNLR(Data, group, focal.name = 1, model = "3PLcg", match = "score")
# Testing uniform DIF effects using 4PL model with the same
# guessing and inattention
difNLR(Data, group, focal.name = 1, model = "4PLcgdg", type = "udif")
# Testing non-uniform DIF effects using 2PL model
difNLR(Data, group, focal.name = 1, model = "2PL", type = "nudif")
# Testing difference in parameter b using 4PL model with fixed
# a and c parameters
difNLR(Data, group, focal.name = 1, model = "4PL", constraints = "ac", type = "b")
# Testing both DIF effects using LR test,
# 3PL model with fixed guessing for groups
# with maximum likelihood estimation method
difNLR(Data, group, focal.name = 1, model = "3PLcg", method = "likelihood")
# Graphical devices
plot(x)
plot(x, item = x$DIFitems)
plot(x, plot.type = "stat")
# Coefficients
coef(x)
# Fitted values
fitted(x)
fitted(x, item = 1)
# Residuals
residuals(x)
residuals(x, item = 1)
# Predicted values
predict(x)
predict(x, item = 1)
# Predicted values for new subjects
predict(x, item = 1, match = 0, group = 1)
predict(x, item = 1, match = 0, group = 0)
# AIC, BIC, logLik
AIC(x); AIC(x, item = 1)
BIC(x); BIC(x, item = 1)
logLik(x); logLik(x, item = 1)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.