| multilca | R Documentation |
Two-level latent class analysis for categorical indicators: multilpa()
with discrete indicators in vars treated as categorical unless named
in ordinal or count through .... Each profile is described by
unrestricted response probabilities for categorical items and the
corresponding structured parameters for ordinal and count items,
and the group classes differ in how probable each profile is for their
observations. For models that combine categorical and continuous
indicators, call multilpa() and name the categorical ones in its
categorical argument.
multilca(data, vars, id, n_profiles, n_group_classes = 2L, ...)
data |
A data frame with one row per observation. |
vars |
Names of the categorical indicator columns. Numeric, integer, logical, character and factor columns are accepted; factor levels keep their declared order and other types are sorted. |
id |
Name of the group identifier column, or |
n_profiles |
Number of observation-level latent classes (profiles). |
n_group_classes |
Number of group-level latent classes. Defaults to 2,
or to 1 when |
... |
Further arguments to |
A fitted model of class multilpa (or multilpa_covariates when
membership covariates are given), exactly as multilpa() returns it with
the corresponding discrete indicator types. Categorical response
probabilities are in
get_results(fit, "responses"), one row per profile, item and category.
latents_bad_argument when categorical is supplied, since its
columns are derived from vars, ordinal and count here. Every condition of
multilpa() can also be raised.
multilpa() for continuous and mixed indicators, and
vignette("lca", package = "latents").
activities <- c("time_with_friends", "on_social_media", "tv_video_games")
fit <- multilca(subset(student_esm, day <= 1), vars = activities,
id = "student", n_profiles = 2, n_group_classes = 2,
n_starts = 1, seed = 1)
get_results(fit, "responses")
get_results(fit, "profile_probabilities")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.