| enumerate_lca | R Documentation |
Fits single-level latent class models with each number of classes in
n_classes and returns them in one table for comparison by information
criteria, entropy and the diagnostics of each fit. Every indicator is
categorical unless named in ordinal or count, as in lca(). It is
enumerate_classes() with id = NULL,
and it returns the same object; the number of classes is its n_profiles
column.
enumerate_lca(data, vars, n_classes = 1:4, ...)
data |
A data frame with one row per observation. |
vars |
Names of the categorical indicator columns. |
n_classes |
Positive whole numbers of classes to compare. |
... |
Further arguments for |
For observations nested in groups, use enumerate_classes() with the
grouping column as id and the indicators as categorical.
An object of class multilpa_enumeration, as enumerate_classes()
returns: as.data.frame() gives one row per candidate, summary() the
candidate each criterion prefers, plot() the criteria against the
number of classes, and candidate_fit() one fitted candidate, named by
its n_profiles.
latents_bad_argument when id, n_group_classes, categorical or
model is passed.
lca() to fit one model; enumerate_lpa() for continuous
indicators.
models <- enumerate_lca(student_esm, c("time_with_friends",
"on_social_media", "sports"),
n_classes = 1:3, n_starts = 2, seed = 1)
summary(models)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.