mx_profiles | 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,
expand_grid = FALSE,
...
)
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 |
expand_grid |
Logical, whether or not to estimate all possible combinations of the |
... |
Additional arguments, passed to functions. |
Returns an OpenMx::mxModel()
.
Van Lissa, C. J., Garnier-Villarreal, M., & Anadria, D. (2023). Recommended Practices in Latent Class Analysis using the Open-Source R-Package tidySEM. Structural Equation Modeling. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10705511.2023.2250920")}
## Not run:
data("empathy")
df <- empathy[1:6]
mx_profiles(data = df,
classes = 2) -> res
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.