This function simplifies the specification of latent class models: models that estimate membership of a categorical latent variable based on binary or ordinal indicators.

mx_lca(data = NULL, classes = 1L, run = TRUE, ...)

Arguments

data

The data.frame to be used for model fitting.

classes

A vector of integers, indicating which class solutions to generate. Defaults to 1L. E.g., classes = 1:6,

run

Logical, whether or not to run the model. If run = TRUE, the function calls mxTryHardOrdinal.

...

Additional arguments, passed to functions.

Value

Returns an mxModel.

Examples

if (FALSE) {
df <- data_mixture_ordinal
df[1:4] <- lapply(df, ordered)
mx_lca(data = df,
       classes = 2) -> res
}