modsem implements a Monte-Carlo correction for LMS and
QML models with ordinal data. Here we refer to these informally as
MC-LMS-ORD and MC-QML-ORD.
The MC-LMS-ORD and MC-QML-ORD algorithms
are based on Slupphaug, Mehmetoglu,
and Mittner (2026) For a more direct implementation of the original
algorithm, we recommend checking out the plssem
package.
Here we ordinalize the data in the oneInt dataset.
ordinalize <- function(x, probs = c(0, 0.35, 0.7, 1)) {
x <- (x - mean(x)) / sd(x)
cut(
x,
breaks = stats::quantile(x, probs = probs),
include.lowest = TRUE,
ordered_result = TRUE
)
}
oneIntOrd <- as.data.frame(lapply(oneInt, ordinalize))Now we can estimate our model, indicating which variables are
ordinal, using the ordered= argument.