| enumerate_classes | R Documentation |
Fits every requested combination and retains errors and warnings alongside successful fits. Information criteria are descriptive: neither the smallest BIC nor high entropy guarantees the correct number of classes. Unconverged, boundary, and unreplicated fits are reported, not silently selected.
enumerate_classes(
data,
vars,
id,
n_profiles = 1:4,
n_group_classes = 1:3,
model = "basic",
seed = NULL,
family = "profiles",
between_variance = c("varying", "equal"),
time = NULL,
...
)
data |
Data frame. |
vars |
Continuous indicator names. |
id |
The column that identifies the groups the observations are
nested in (students in schools, reports in students). |
n_profiles |
Positive integer profile counts to try. |
n_group_classes |
Positive integer group-class counts to try. With
|
model |
The covariance structures to cross with the class counts.
|
seed |
Optional reproducible seed for each fit. |
family |
|
between_variance |
For group-class families: the between-variance
restrictions to cross, |
time |
The occasion column: enumerate latent transition models
( |
... |
Further arguments to |
An object of class multilpa_enumeration. Read it with the verbs
that describe it rather than by reaching into it: as.data.frame() gives
one row per candidate model with every criterion and diagnostic,
summary() gives one row per information criterion naming the candidate
that minimises it, plot() draws one criterion across the grid, and
candidate_fit() returns the fitted model for one cell of the grid.
latents_bad_argument when model names an unknown structure, when it is
given together with another way of setting the structure, or when it is
given although every indicator is categorical.
Celeux, G., & Govaert, G. (1995). Gaussian parsimonious clustering models. Pattern Recognition, 28(5), 781–793.
candidate_fit() to take one fitted model out of the grid,
summary.multilpa_enumeration() for the criterion-by-criterion comparison.
set.seed(1)
d <- data.frame(g = rep(1:10, each = 10), y = rnorm(100))
candidates <- enumerate_classes(d, "y", "g", n_profiles = 1:2,
n_group_classes = 1, n_starts = 2, seed = 1)
as.data.frame(candidates)
summary(candidates)
# Single level, crossing class counts with two named structures:
single <- enumerate_lpa(iris, c("Sepal.Length", "Sepal.Width",
"Petal.Length", "Petal.Width"),
n_profiles = 1:3, model = c("VVV", "EEE"),
n_starts = 2, seed = 1)
summary(single)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.