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 25 26 27 28 | ```
difNLR(Data, group, focal.name, model, type = "both",
test = "LR", alpha = 0.05, p.adjust.method = "none", start)
## S3 method for class 'difNLR'
print(x, ...)
## S3 method for class 'difNLR'
plot(x, plot.type = "cc", item = "all",
col = c("dodgerblue2", "goldenrod2"), shape = 21, size = 0.8,
linetype = c(2, 1), title, ...)
## S3 method for class 'difNLR'
fitted(object, item = "all", ...)
## S3 method for class 'difNLR'
predict(object, item = "all", score, group, ...)
## S3 method for class 'difNLR'
coef(object, ...)
## S3 method for class 'difNLR'
logLik(object, ...)
## S3 method for class 'difNLR'
AIC(object, ...)
## S3 method for class 'difNLR'
BIC(object, ...)
``` |

`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 of group membership. See |

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

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

`type` |
character: type of DIF to be tested (either "both" (default), "udif", or "nudif").
See |

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

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

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

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

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

`...` |
other generic parameters for |

`plot.type` |
character: type of plot to be plotted (either "cc" for characteristic curve
(default), or "stat" for test statistics). See |

`item` |
either character ("all"), or numeric vector, or single number corresponding to column indicators. See |

`col` |
character: single value, or vector of two values representing colors for plot. |

`shape` |
integer: shape parameter for plot. |

`size` |
numeric: single number, or vector of two numbers representing line width in plot. |

`linetype` |
numeric: single number, or vector of two numbers representing line type in plot for reference and focal group. |

`title` |
string: title of plot. |

`object` |
an object of 'difNLR' class |

`score` |
numeric: standardized total score of subject. |

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

The `Data`

is a matrix whose 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 either a vector of the same length as `nrow(Data)`

.

The options of `model`

are as follows: `Rasch`

for one-parameter logistic model with
discrimination parameter fixed on value 1 for both groups, `1PL`

for one-parameter logistic
model with discrimination parameter fixed for both groups, `2PL`

for logistic regression model,
`3PLcg`

for three-parameter logistic regression model with fixed guessing for both groups,
`3PLdg`

for three-parameter logistic regression model with fixed inattention for both groups, or
`4PLcgdg`

for four-parameter logistic regression model with fixed guessing and inattention
parameter for both groups.

The `type`

corresponds to type of DIF to be tested. Possible values are `"both"`

to
detect any DIF (uniform and/or non-uniform), `"udif"`

to detect only uniform DIF or
`"nudif"`

to detect only non-uniform DIF.

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 matrix with a number of rows equal to number of items and with 8 columns.
First 4 columns represent parameters (a, b, c, d) of generalized logistic regression model
for reference group. Last 4 columns represent differences of parameters (aDif, bDif, cDif, dDif)
of generalized logistic regression model between reference and focal group. If not specified, starting
values are calculated with `startNLR`

function.

The output of the difNLR is displayed by the `print.difNLR`

function.

Two types of plots are available. The first one is obtained by setting `plot.type = "cc"`

(default). The characteristic curve for item specified in `item`

option is plotted. For default
option `"all"`

of item, characteristic curves of all converged items are plotted. The drawn
curves represent best model.
The second plot is obtained by setting `plot.type = "stat"`

. The test statistics
(either LR-test, or F-test, depends on argument `test`

) are displayed on the Y axis,
for each coverged item. The detection threshold is displayed by a horizontal line and items
detected as DIF are printed with the red color. Only parameters `size`

and `title`

are used.

Fitted values are extracted by the `fitted.difNLR`

function for item(s) specified in
`item`

argument.

Predicted values are produced by the `predict.difNLR`

function for item(s) specified in
`item`

argument. `score`

represents standardized total score of new subject and
`group`

argument represents group membership of new subject.

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

for both, `data`

and `group`

parameters.

A list of class 'difNLR' with the following arguments:

`Sval`

the values of likelihood ratio 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"`

.`model`

fitted model.

`type`

character: type of DIF that was tested.

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

`group`

the vector of group membership.

`Data`

the data matrix.

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

`AICM0`

AIC of null model.

`AICM1`

AIC of alternative model.

`BICM0`

BIC of null model.

`BICM1`

BIC of alternative model.

Adela Drabinova

Institute of Computer Science, The Czech Academy of Sciences

Faculty of Mathematics and Physics, Charles University

adela.drabinova@gmail.com

Patricia Martinkova

Institute of Computer Science, The Czech Academy of Sciences

martinkova@cs.cas.cz

Karel Zvara

Faculty of Mathematics and Physics, Charles University

Drabinova, A. and Martinkova P. (2016). Detection of Differenctial Item Functioning Based on Non-Linear Regression, Technical Report, V-1229, http://hdl.handle.net/11104/0259498.

Swaminathan, H. and 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 | ```
## Not run:
# loading data based on GMAT
data(GMAT)
Data <- GMAT[, colnames(GMAT) != "group"]
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 Rasch model
difNLR(Data, group, focal.name = 1, model = "Rasch")
# Testing both DIF effects using 2PL model
difNLR(Data, group, focal.name = 1, model = "2PL")
# Testing uniform DIF effects
difNLR(Data, group, focal.name = 1, model = "2PL", type = "udif")
# Testing non-uniform DIF effects
difNLR(Data, group, focal.name = 1, model = "2PL", type = "nudif")
# Graphical devices
plot(x)
plot(x, item = x$DIFitems)
plot(x, plot.type = "stat")
# Fitted values
fitted(x)
fitted(x, item = 1)
# Predicted values
predict(x)
predict(x, item = 1)
# Predicted values for new subjects
predict(x, item = 1, score = 0, group = 1)
predict(x, item = 1, score = 0, group = 0)
# AIC, BIC, logLik
AIC(x)
BIC(x)
logLik(x)
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.