Learn R Programming

difNLR (version 1.3.7)

plot.difORD: ICC plots for an object of "difORD" class.

Description

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

The characteristic curves (category probabilities) for an item specified in item argument are plotted. Plotted curves represent the best model. For cumulative logit model, also cumulative probabilities may be plotted.

Usage

# S3 method for difORD
plot(x, item = "all", plot.type, group.names, ...)

Arguments

x

an object of "difORD" class.

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

plot.type

character: which plot should be displayed for cumulative logit regression model. Either "category" (default) for category probabilities or "cumulative" for cumulative probabilities.

group.names

character: names of reference and focal group.

...

other generic parameters for plot() function.

Value

Returns list of objects of class "ggplot".

See Also

difORD for DIF detection among ordinal data. ggplot for general function to plot a "ggplot" object.

Examples

Run this code
# NOT RUN {
# Loading data
data(dataMedicalgraded, package = "ShinyItemAnalysis")
Data <- dataMedicalgraded[, 1:5]
group <- dataMedicalgraded[, 101]

# Testing both DIF effects with adjacent category logit model
(x <- difORD(Data, group, focal.name = 1, model = "adjacent"))

# Graphical devices
plot(x, item = 3)
plot(x, item = "X2003", group.names = c("Group 1", "Group 2"))

# Testing both DIF effects with cumulative logit model
(x <- difORD(Data, group, focal.name = 1, model = "cumulative"))
plot(x, item = 3, plot.type = "cumulative")
plot(x, item = 3, plot.type = "category")
# }

Run the code above in your browser using DataLab