plotCumulative: Plot cumulative and category probabilities of cumulative...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plotCumulative.R

Description

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

Usage

1
plotCumulative(x, type = "cumulative", matching.name = "matching")

Arguments

x

object of class vglm

type

character: type of plot to be displayed. Options are "cumulative" (default) for cumulative probabilities and "category" for category probabilities.

matching.name

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

Value

An object of class ggplot and/or gg.

Author(s)

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

vglm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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)

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

plotCumulative(fit, type = "cumulative", matching.name = "Total score")
plotCumulative(fit, type = "category", matching.name = "Total score")

netique/ShinyItemAnalysis documentation built on Dec. 22, 2021, 12:10 a.m.