# NOT RUN {
# loading packages
library(VGAM)
# loading data
data <- dataMedicalgraded[, 1:100]
# total score calculation
score <- apply(data, 1, sum)
data[, 1] <- ordered(factor(data[, 1], levels = 0:max(data[, 1])))
# cummulative logistic model for item 1
fit <- vglm(data[, 1] ~ score, family = cumulative(reverse = TRUE, parallel = TRUE))
# coefficients for item 1
coefs <- coef(fit)
plotCumulative(fit, type = "cumulative", matching.name = "Total score")
plotCumulative(fit, type = "category", matching.name = "Total score")
# }
Run the code above in your browser using DataLab