mx_profiles {tidySEM} | R Documentation |
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, ... )
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., |
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 |
... |
Additional arguments, passed to functions. |
Returns an mxModel
.
## Not run: data("empathy") df <- empathy[1:6] mx_profiles(data = df, classes = 2) -> res ## End(Not run)