Estimate parameters for profiles for a specific solution (requires purchasing and installing MPlus to use)

estimate_profiles_mplus(df, ..., n_profiles, idvar = NULL,
  the_title = "test", data_filename = "d.dat", script_filename = "i.inp",
  output_filename = "i.out", savedata_filename = "d-mod.dat", model = 1,
  starts = c(20, 4), m_iterations = 500, st_iterations = 10,
  convergence_criterion = 1e-06, remove_tmp_files = TRUE,
  print_input_file = FALSE, return_save_data = TRUE, optseed = NULL,
  n_processors = 1, 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

the number of profiles (or mixture components) to be estimated

idvar

optional name of the column to be used as the ID variable (should be supplied as a string). Defaults to NULL, in which case row numbers will be used. Note the ID can be numeric or string, but must be unique.

the_title

title of the model; defaults to test

data_filename

name of data file to prepare; defaults to d.dat

script_filename

name of script to prepare; defaults to i.inp

output_filename

name of the output; defaults to o.out

savedata_filename

name of the output for the save data (with the original data conditional probabilities); defaults to o-mod.out

model

the mclust model to explore: 1 (varying means, equal variances, and residual covariances fixed to 0); 2 (varying means, equal variances and covariances; 3 (varying means and variances, covariances fixed to 0), 4 (varying means and covariances, equal variances; can only be specified in Mplus); 5 (varying means, equal variances, varying covariances); and 6 (varying means, variances, and covariances), in order least to most freely-estimated; see the introductory vignette for more information

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)

remove_tmp_files

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

print_input_file

whether to print the input file to the console

return_save_data

whether to return the save data (with the original data and the posterior probabilities for the classes and the class assignment) as a data.frame along with the MPlus output; defaults to TRUE

optseed

random seed for analysis

n_processors

= 1

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

either a tibble or a ggplot2 plot of the BIC values for the explored models

Details

Creates an mplus model (.inp) and associated data file (.dat)

Examples

not_run({ m <- estimate_profiles_mplus(iris, Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, n_profiles = 2, model = 1) })