# Performs DIF detection using Non-Linear Regression method.

### Description

Performs DIF detection procedure based on Non-Linear Regression and either F-test or likelihood ratio test of submodel.

### Usage

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
difNLR(data, group, type = "both", p.adjust.method = "BH",
start, test = "F", alpha = 0.05)
## 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, ...)
``` |

### Arguments

`data` |
numeric: binary data matrix. See |

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

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

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

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

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

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

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

### 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 whose rows represents examinee 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 `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 `start`

is a matrix with a number of rows equal to number of items. The number of columns correspond to number of parameters in model in alternative hypothesis (5 for values `"both"`

and `"nudif"`

in type, 4 for `"udif"`

in type). If start missing, initial values are calculated by `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"`

.

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 F-test, or LR-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.

### Value

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

`DIF`

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

`"NONE"`

.`test`

the test used for DIF detection.

`Sval`

the values of

`test`

statistics.`pval`

the p-values by

`test`

.`df`

the degress of freedom of

`test`

.`coef`

the matrix of estimated item parameters.

`vcov`

the list of estimated covariance matrices of item parameters.

`group`

the vector of group membership.

`data`

the binary data matrix.

`type`

character: type of DIF that was tested.

`alpha`

numeric: significance level.

`conv.fail`

numeric: number of convergence issues.

`conv.fail.which`

the indicators of the items which did not converge.

`p.adjust.method`

character: method for multiple comparison correction which was applied.

### Author(s)

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

### References

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.

### See Also

`p.adjust`

### Examples

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 | ```
## Not run:
# loading data based on GMAT
data(GMAT)
data <- GMAT[, colnames(GMAT) != "group"]
group <- GMAT[, "group"]
# Testing both DIF effects using F test and Benjamini-Hochberg correction (default)
x <- difNLR(data, group)
# Testing both DIF effects using likelihood-ratio test
x <- difNLR(data, group, test = "LR")
# Testing both DIF effects with none multiple comparison correction
difNLR(data, group, type = "both", p.adjust.method = "none")
# Testing uniform DIF effects
difNLR(data, group, type = "udif")
# Testing non-uniform DIF effects
difNLR(data, group, type = "nudif")
# Graphical devices
plot(x)
plot(x, item = x$DIF)
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)
## End(Not run)
``` |