View source: R/plotCumulative.R
plotCumulative | R Documentation |
Function for plotting cumulative and category probabilities
function estimated by vglm()
function from the VGAM
package
using the ggplot2 package.
plotCumulative(x, type = "cumulative", matching.name = "matching")
x |
object of class |
type |
character: type of plot to be displayed. Options are
|
matching.name |
character: name of matching criterion used for
estimation in |
An object of class ggplot
and/or gg
.
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
VGAM::vglm()
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.