This function is a wrapper around mx_mixture to simplify the specification of latent profile models, also known as finite mixture models. By default, the function estimates free means for all observed variables across classes.

mx_profiles(
data = NULL,
classes = 1L,
variances = "equal",
covariances = "zero",
run = TRUE,
...
)

## Arguments

data

The data.frame to be used for model fitting.

classes

A vector of integers, indicating which class solutions to generate. Defaults to 1L. E.g., classes = 1:6,

variances

Character vector. Specifies which variance components to estimate. Defaults to "equal" (constrain variances across classes); the other option is "varying" (estimate variances freely across classes). Each element of this vector refers to one of the models you wish to run.

covariances

Character vector. Specifies which covariance components to estimate. Defaults to "zero" (covariances constrained to zero; this corresponds to an assumption of conditional independence of the indicators); other options are "equal" (covariances between items constrained to be equal across classes), and "varying" (free covariances across classes).

run

Logical, whether or not to run the model. If run = TRUE, the function calls mixture_starts and run_mx.

...

## Value

Returns an mxModel.

## Examples

if (FALSE) {
data("empathy")
df <- empathy[1:6]
mx_profiles(data = df,
classes = 2) -> res
}