Plot cumulative and category probabilities of cumulative logit model
Plot cumulative and category probabilities of cumulative logit model
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")
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.
Returns
An object of class ggplot and/or gg.
Examples
# loading packageslibrary(VGAM)# loading datadata(Science, package ="mirt")# total score calculationscore <- rowSums(Science)Science[,1]<- factor(Science[,1], levels = sort(unique(Science[,1])), ordered =TRUE)# cumulative logit model for item 1fit <- vglm(Science[,1]~ score, family = cumulative(reverse =TRUE, parallel =TRUE))# coefficients for item 1coef(fit)plotCumulative(fit, type ="cumulative", matching.name ="Total score")plotCumulative(fit, type ="category", matching.name ="Total score")
See Also
VGAM::vglm()
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