Learn R Programming

ShinyItemAnalysis (version 1.5.4)

plotAdjacent: Plot category probabilities of adjacent category logit model

Description

Function for plotting category probabilities function estimated by vglm() function from the VGAM package using the ggplot2 package.

Usage

plotAdjacent(x, matching.name = "matching")

Value

An object of class ggplot and/or gg.

Arguments

x

object of class vglm

matching.name

character: name of matching criterion used for estimation in x.

Author

Tomas Jurica
Institute of Computer Science of the Czech Academy of Sciences

Adela Hladka
Institute of Computer Science of the Czech Academy of Sciences
hladka@cs.cas.cz

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

See Also

VGAM::vglm()

Examples

Run this code
# loading packages
library(VGAM)

# loading data
data(Science, package = "mirt")

# total score calculation
score <- rowSums(Science)
Science[, 1] <- factor(Science[, 1], levels = sort(unique(Science[, 1])), ordered = TRUE)

# adjacent category logit model for item 1
fit <- vglm(Science[, 1] ~ score, family = acat(reverse = FALSE, parallel = TRUE))
# coefficients for item 1
coef(fit)

plotAdjacent(fit, matching.name = "Total score")

Run the code above in your browser using DataLab