lpa: Latent profile analysis

View source: R/lpa.R

lpaR Documentation

Latent profile analysis

Description

Fits a single-level latent profile model: a finite mixture of multivariate normal distributions, in which each observation belongs to one of n_profiles unobserved profiles and each profile has its own mean on every indicator. It is the model multilpa() fits with id = NULL, and it returns the same object, so every accessor, plot and inference verb of the package applies to it.

Usage

lpa(data, vars, n_profiles, ...)

Arguments

data

A data frame with one row per observation.

vars

Names of the indicator columns. Numeric columns are continuous indicators; name categorical ones in categorical.

n_profiles

Number of profiles, a positive whole number.

...

Further arguments for multilpa(): the covariance structure (variance_model, covariance_model, or volume, shape, orientation), missing, categorical, n_starts, seed, prior, noise, profile_covariates and the others it documents, except id and n_group_classes, which a single-level model does not have.

Details

For observations nested in groups (students in schools, occasions in persons), use multilpa() with the grouping column as id, which adds latent classes of groups above the profiles.

Value

A fitted multilpa object, as multilpa() returns.

Conditions

latents_bad_argument when id or n_group_classes is passed; the conditions multilpa() raises otherwise.

References

Oberski, D. (2016). Mixture models: Latent profile and latent class analysis. In J. Robertson & M. Kaptein (Eds.), Modern Statistical Methods for HCI (pp. 275–287). Springer.

See Also

lca() for categorical indicators; multilpa() for the two-level model; enumerate_lpa() to compare numbers of profiles.

Examples

fit <- lpa(srl, c("cognitive_strategies", "intrinsic_value",
                  "self_efficacy", "self_regulation", "test_anxiety"),
           n_profiles = 2, variance_model = "equal",
           covariance_model = "full", n_starts = 3, seed = 1)
fit
plot(fit, what = "raincloud")

latents documentation built on Oct. 16, 2026, 5:09 p.m.