Explore fit statistics 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, models = list(c("equal", "zero"), c("varying",
  "zero"), c("equal", "equal"), c("varying", "varying")), starts = c(100,
  10), cluster_ID = NULL, m_iterations = 500, st_iterations = 20,
  convergence_criterion = 1e-06, remove_tmp_files = FALSE,
  save_models = FALSE, return_table = TRUE, n_processors = 1,
  return_stats_df = TRUE, include_VLMR = TRUE, include_BLRT = FALSE,
  dir_name = NULL, latent_vars = NULL)

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

models

which models to include as a list of vectors; for each vector, the first value represents how the variances are estimated and the second value represents how the covariances are estimated; defaults to list(c("equal", "zero"), c("varying", "zero"), c("equal", "equal"), c("varying", "varying"))

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)

cluster_ID

clustering variable to use as part of MPlus 'type is complex' command

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)

remove_tmp_files

whether to remove data, script, and output files; defaults to TRUE

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 TRUE

n_processors

= 1

return_stats_df

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

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

dir_name

character; name for directory .out files are saved to if save_models = TRUE; defaults to the present date

latent_vars

defaults to NULL; specification for the latent varibles as a list, i.e. list(beh = c(1, 2), cog = c(3, 4), aff = (5, 6)), where the integers represent the position of the variables passed to the function and how they correspond to the latent variables, which are named

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 {
o <- compare_solutions_mplus(iris, Sepal.Length, Sepal.Width, Petal.Length, Petal.Width,
n_profiles_max = 3)
# }