Description Usage Arguments Details Value Examples
View source: R/estimateprofiles.R
Estimates latent profiles (finite mixture models) using the open
source package mclust
, or the commercial program
Mplus (using the Rinterface of
MplusAutomation
).
1 2  estimate_profiles(df, n_profiles, models = NULL, variances = "equal",
covariances = "zero", package = "mclust", ...)

df 
data.frame of numeric data; continuous indicators are required for mixture modeling. 
n_profiles 
Integer vector of the number of profiles (or mixture components) to be estimated. 
models 
Integer vector. Set to 
variances 
Character vector. Specifies which variance components to estimate. Defaults to "equal" (constrain variances across profiles); the other option is "varying" (estimate variances freely across profiles). 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" (do not estimate covariances; this corresponds to an assumption of conditional independence of the indicators); other options are "equal" (estimate covariances between items, constrained across profiles), and "varying" (free covariances across profiles). 
package 
Character. Which package to use; 'mclust' or 'MplusAutomation' (requires Mplus to be installed). Default: 'mclust'. 
... 
Additional arguments are passed to the estimating function; i.e.,

Six models are currently available in tidyLPA, corresponding to the most common requirements. These are:
Equal variances and covariances fixed to 0
Varying variances and covariances fixed to 0
Equal variances and equal covariances
Varying variances and equal covariances
Equal variances and varying covariances
Varying variances and varying covariances
Two interfaces are available to estimate these models; specify their numbers
in the models
argument (e.g., models = 1
, or
models = c(1, 2, 3)
), or specify the variances/covariances to be
estimated (e.g.,: variances = c("equal", "varying"), covariances =
c("zero", "equal")
).
A list of class 'tidyLPA'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  ## Not run:
# Example 1:
iris %>%
select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
estimate_profiles(df, 3)
# Example 2:
iris %>%
select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
estimate_profiles(df, n_profiles = 1:4, models = 1:3)
# Example 3:
iris %>%
select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
estimate_profiles(df, n_profiles = 1:4, variances = c("equal", "varying"),
covariances = c("zero", "zero"))
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.