Explore BIC for various models and numbers of profiles using MPlus (requires purchasing and installing MPlus to use)

compare_solutions_mplus(df, ..., n_profiles_min = 2, n_profiles_max = 10,
  model = 1:6, starts = c(20, 4), m_iterations = 500,
  st_iterations = 10, convergence_criterion = 1e-06, save_models = FALSE,
  return_table = TRUE, n_processors = 1, return_stats_df = FALSE,
  include_VLMR = TRUE, include_BLRT = FALSE)

Arguments

df

data.frame with two or more columns with continuous variables

...

unquoted variable names separated by commas

n_profiles_min

lower bound of the number of profiles to explore; defaults to 2

n_profiles_max

upper bound of the number of profiles to explore; defaults to 10

model

which models to include; defaults to 1:6 (see https://jrosen48.github.io/tidyLPA/articles/Introduction_to_tidyLPA.html)

starts

number of initial stage starts and number of final stage optimizations; defaults to c(20, 4); can be set to be more conservative to c(500, 50)

m_iterations

number of iterations for the EM algorithm; defaults to 500

st_iterations

the number of initial stage iterations; defaults to 10; can be set more to be more conservative to 50

convergence_criterion

convergence criterion for the Quasi-Newton algorithm for continuous outcomes; defaults to 1E-6 (.000001); can be set more conservatively to 1E-7 (.0000001)

save_models

whether to save the models as rds files

return_table

logical (TRUE or FALSE) for whether to return a table of the output instead of a plot; defaults to FALSE

n_processors

= 1

return_stats_df

whether to return a list of fit statistics for the solutions explored; defaults to FALSE

include_VLMR

whether to include the Vu-Lo-Mendell-Rubin likelihood-ratio test; defaults to TRUE

include_BLRT

whether to include the bootstrapped LRT; defaults to FALSE because of the time this takes to run

Value

a list with a data.frame with the BIC values and a list with all of the model output; if save_models is the name of an rds file (i.e., "out.rds"), then the model output will be written with that filename and only the data.frame will be returned

Details

Explore the BIC values of a range of Mplus models in terms of a) the structure of the residual covariance matrix and b) the number of mixture components (or profiles)

Examples

not_run({ compare_solutions_mplus(iris, Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, n_profiles_max = 4) })