plot.difNLR: ICC and test statistics plots for an object of '"difNLR"'...

View source: R/difNLR.R

plot.difNLRR Documentation

ICC and test statistics plots for an object of "difNLR" class.

Description

Plot method for an object of "difNLR" class using ggplot2.

Two types of plots are available. The first one is obtained by setting plot.type = "cc" (default). The characteristic curves for an item specified in item argument are plotted. Plotted curves represent the 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 converged 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.

Usage

## S3 method for class 'difNLR'
plot(
  x,
  plot.type = "cc",
  item = "all",
  group.names,
  draw.empirical = TRUE,
  draw.CI = FALSE,
  ...
)

Arguments

x

an object of "difNLR" class.

plot.type

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

item

numeric or character: either character "all" to apply for all converged items (default), or a vector of item names (column names of Data), or item identifiers (integers specifying the column number).

group.names

character: names of reference and focal group.

draw.empirical

logical: should empirical probabilities be plotted as points? Default value is TRUE.

draw.CI

logical: should confidence intervals for predicted values be plotted? Default value is FALSE.

...

other generic parameters for plot() function.

Value

For an option plot.type = "stat", returns object of class "ggplot". In case of plot.type = "cc", returns list of objects of class "ggplot".

Outputs can be edited and modified as standard "ggplot" object including colours, titles, shapes or linetypes.

Note that option draw.CI = TRUE returns confidence intervals for predicted values as calculated by predict.difNLR. Confidence intervals may overlap even in case that item functions differently.

Author(s)

Adela Hladka (nee Drabinova)
Institute of Computer Science of the Czech Academy of Sciences
Faculty of Mathematics and Physics, Charles University
hladka@cs.cas.cz

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

Karel Zvara
Faculty of Mathematics and Physics, Charles University

References

Drabinova, A. & Martinkova, P. (2017). Detection of differential item functioning with nonlinear regression: A non-IRT approach accounting for guessing. Journal of Educational Measurement, 54(4), 498–517, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/jedm.12158")}.

Hladka, A. & Martinkova, P. (2020). difNLR: Generalized logistic regression models for DIF and DDF detection. The R Journal, 12(1), 300–323, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.32614/RJ-2020-014")}.

Swaminathan, H. & Rogers, H. J. (1990). Detecting differential item functioning using logistic regression procedures. Journal of Educational Measurement, 27(4), 361–370, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1745-3984.1990.tb00754.x")}

See Also

difNLR for DIF detection among binary data using generalized logistic regression model.
predict.difNLR for prediction. ggplot for general function to plot a "ggplot" object.

Examples

## Not run: 
# loading data
data(GMAT)
Data <- GMAT[, 1:20] # items
group <- GMAT[, "group"] # group membership variable

# 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"))

# item characteristic curves
plot(x)
plot(x, item = x$DIFitems)
plot(x, item = 1)
plot(x, item = "Item1")

# item characteristic curves without empirical probabilities
plot(x, item = 1, draw.empirical = FALSE)

# item characteristic curves without empirical probabilities but with CI
plot(x, item = 1, draw.empirical = FALSE, draw.CI = TRUE)

# graphical devices - test statistics
plot(x, plot.type = "stat")

## End(Not run)

difNLR documentation built on May 3, 2023, 5:11 p.m.