| multilpa | R Documentation |
Fits individual Gaussian profiles nested within observed groups. A discrete latent group class determines the profile proportions. Profile means and variances are shared across group classes (measurement invariance), and indicators are independent conditional on individual profile membership by default. Full residual covariance and observed-data maximum likelihood for missing indicators are available.
multilpa(
data,
vars,
id,
n_profiles,
n_group_classes = 2L,
profile_covariates = character(),
group_covariates = character(),
variance_model = c("varying", "equal"),
n_starts = 10L,
max_iter = 1000L,
tol = 1e-08,
min_variance = 1e-06,
seed = NULL,
start = NULL,
missing = c("error", "fiml"),
profile_slopes = c("shared", "group_class"),
covariance_model = c("diagonal", "full"),
categorical = character(),
min_probability = 1e-10,
time = NULL,
fixed = character(),
centering = c("none", "person", "grand"),
volume = NULL,
shape = NULL,
orientation = NULL,
model = NULL,
select_start = c("likelihood", "converged"),
prior = NULL,
noise = FALSE,
acceleration = c("squarem", "none"),
family = c("profiles", "additive", "dispersion", "additive_dispersion",
"restricted_cross_level", "full_cross_level"),
between_variance = c("varying", "equal"),
weights = NULL,
ordinal = character(),
count = character(),
count_model = c("poisson", "negative_binomial"),
count_dispersion = c("varying", "equal")
)
data |
A data frame containing indicators and a group identifier. | |||||||||||||||||||||||||
vars |
Unique character vector of continuous indicator column names. | |||||||||||||||||||||||||
id |
Name of the observed group identifier column. Character, factor, or numeric identifiers are supported; missing identifiers are not.
| |||||||||||||||||||||||||
n_profiles |
Positive integer number of individual profiles. | |||||||||||||||||||||||||
n_group_classes |
Positive integer number of latent group classes. With
| |||||||||||||||||||||||||
profile_covariates, group_covariates |
Names of numeric columns of
| |||||||||||||||||||||||||
variance_model |
Either | |||||||||||||||||||||||||
n_starts |
Positive integer number of EM starts. The first is
deterministic: Ward's hierarchical clustering of the standardized
indicators (on at most 2000 evenly spaced rows), each cluster described by
its own means and spread, which is the start mclust's name refers to and
finds solutions whose profiles differ in shape. The rest are k-means from
random centres. When | |||||||||||||||||||||||||
max_iter |
Nonnegative integer maximum number of EM updates per start.
| |||||||||||||||||||||||||
tol |
Positive relative log-likelihood tolerance. Convergence requires
absolute change no greater than | |||||||||||||||||||||||||
min_variance |
Positive lower bound on each variance, or each covariance eigenvalue for full covariance, in squared input units. This defines a constrained maximum-likelihood problem. Bound-active estimates are explicitly reported and generate a warning. | |||||||||||||||||||||||||
seed |
Optional random seed: any whole number | |||||||||||||||||||||||||
start |
Optional list of | |||||||||||||||||||||||||
missing |
| |||||||||||||||||||||||||
profile_slopes |
| |||||||||||||||||||||||||
covariance_model |
| |||||||||||||||||||||||||
categorical |
Character vector naming indicators to treat as categorical. Each is modelled by unrestricted, profile-specific response probabilities over its observed categories, which is the latent class measurement model. Binary, ordinal and unordered indicators are all handled by the same unrestricted parameterization; numeric, integer, logical, character and factor columns are accepted. Indicators not named here stay Gaussian, so naming a subset fits a mixed-mode model. | |||||||||||||||||||||||||
min_probability |
Positive lower bound on every categorical response
probability, defining a constrained maximum-likelihood problem in the same
way | |||||||||||||||||||||||||
time |
Optional name of a column giving each observation's position
within its group, such as a wave, occasion or course number. The model does
not use it; it is stored so that | |||||||||||||||||||||||||
fixed |
Character vector naming measurement blocks to hold at the
values | |||||||||||||||||||||||||
centering |
How to centre the continuous indicators before fitting.
| |||||||||||||||||||||||||
volume, shape, orientation |
The covariance structure, in the three
pieces it is made of. Each profile's covariance decomposes as
The estimates are those of Celeux and Govaert (1995); the two models with
a shared orientation and a free shape, EVE and VVE, have no closed form
and use the minorize-maximize step of Browne and McNicholas (2014).
Parameter counts match Anything other than EEI, VVI, EEE or VVV is maximized across every profile
at once, so it cannot be combined with a held | |||||||||||||||||||||||||
model |
The covariance structure named by its mclust code, one of
| |||||||||||||||||||||||||
select_start |
Which start the fit reports. | |||||||||||||||||||||||||
prior |
| |||||||||||||||||||||||||
noise |
| |||||||||||||||||||||||||
acceleration |
| |||||||||||||||||||||||||
family |
The model family.
These families take only Two cross-level families estimate individual profiles and group classes from the same indicators, following the manifest-aggregation specification of Houle et al. (2026, supplement): each group's means of the indicators are between-level indicators of its group class, with class-specific means and variances.
These take | |||||||||||||||||||||||||
between_variance |
For the additive and additive-dispersion families:
| |||||||||||||||||||||||||
weights |
| |||||||||||||||||||||||||
ordinal |
Names of indicators in | |||||||||||||||||||||||||
count |
Names of indicators in | |||||||||||||||||||||||||
count_model |
| |||||||||||||||||||||||||
count_dispersion |
For |
Infinite and constant observed indicators are rejected. Each
indicator must have at least two distinct observed values. No rows are
silently dropped. In FIML mode, fully missing individuals contribute no
direct measurement likelihood but receive posterior probabilities from
their group's information. Observation counts retain these individuals;
the individual-level BIC excludes them through n_informative, while the
group-level BIC uses all observed groups. Missing patterns can prevent parameter
identification; no general identification guarantee is made. Initialization
alone uses indicator-mean filling. EM uses conditional Gaussian sufficient
statistics and observed marginal densities. More than one group class requires more than one profile
and at least one group with multiple individuals; these checks are necessary
but do not establish identification. By default the highest finite
likelihood across starts is returned, even if that start did not converge;
select_start = "converged" prefers a converged start, and converged and
starts show which was chosen. Profile and group-class labels are arbitrary.
An multilpa object containing means, variances, optional
covariances (indicators by indicators by profiles),
profile_probabilities, group_probabilities, posterior matrices,
classifications, log likelihood, information criteria, restart diagnostics,
and convergence history. Individual rows retain their input order; groups
retain first-occurrence order. bic and bic_groups use the observed group
count; bic_individual uses n_informative, the number of rows carrying at
least one observed indicator. These are alternative
conventions, not interchangeable criteria. boundary identifies variance
bounds; small_classes flags effective memberships below one. The fit
itself carries no standard errors: parameter_inference() computes them
from the fit and the data it was fitted to, and bootstrap_lrt() tests
nested models. No guarantee of global optimality is
given, whatever n_starts is used.
Read the tidy form with as.data.frame(); what selects which table.
Vermunt, J. K. (2003). Multilevel latent class models. Sociological Methodology, 33, 213–239. doi:10.1111/j.0081-1750.2003.t01-1-00131.x.
Banfield, J. D., & Raftery, A. E. (1993). Model-based Gaussian and non-Gaussian clustering. Biometrics, 49, 803–821. doi:10.2307/2532201.
Houle, S. A., Morin, A. J. S., & Harvey, J.-F. (2026). Multilevel latent profile analyses: A comprehensive guide. Organizational Research Methods. doi:10.1177/10944281261469432.
Skinner, C. J. (1989). Domain means, regression and multivariate analysis. In C. J. Skinner, D. Holt, & T. M. F. Smith (Eds.), Analysis of complex surveys (pp. 59–87). Wiley.
Asparouhov, T. (2005). Sampling weights in latent variable modeling. Structural Equation Modeling, 12, 411–434. doi:10.1207/s15328007sem1203_4.
Fraley, C., & Raftery, A. E. (2007). Bayesian regularization for normal mixture estimation and model-based clustering. Journal of Classification, 24, 155–181. doi:10.1007/s00357-007-0004-5.
multilca() for a model in which every indicator is categorical.
# Course sessions nested in students: engagement profiles of sessions, and
# classes of students that differ in how often they are engaged.
activity <- c("browse", "lectures", "forum_read", "forum_post", "attendance")
fit <- multilpa(course_engagement, activity, "student",
n_profiles = 2, n_group_classes = 2, n_starts = 4,
seed = 42)
summary(fit)
as.data.frame(fit)
get_results(fit, what = "profile_probabilities")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.