tidyLPA icon indicating copy to clipboard operation
tidyLPA copied to clipboard

Incorrect Mplus Syntax Generation when Using estimate_profiles

Open Matt4234 opened this issue 2 years ago • 2 comments

Hello!

I am attempting to use a clustering variable when running an LPA model.

estimate_profiles(n_profiles = 2, variance = "equal", covariances = "zero", package = "mplusautomation", VARIABLE = " USEVARIABLES = beh aff cog; Cluster = uniqueid;", ANALYSIS = "starts = 1000 200; processors = 2; Type = Complex;", keepfiles = T)

The mplus syntax specified in the R code is added to the mplus input file; however, mplus also includes the clustering variable in the model syntax to use it as an indicator of the profiles (beh, aff, and cog are the indicators). The "uniqueid" variable should not be used as an indicator, it is only the clustering variable. Below is the mplus input syntax generated from the above R code:

VARIABLE: NAMES = uniqueid beh aff cog; MISSING=.; USEVARIABLES = beh aff cog; Cluster = uniqueid;CLASSES = c1(2);

ANALYSIS: TYPE = mixture; starts = 1000 200; processors = 2; Type = Complex; MODEL: %c1#1% uniqueid (vuniqueid); beh (vbeh); aff (vaff); cog (vcog);

uniqueid WITH beh@0; uniqueid WITH aff@0; uniqueid WITH cog@0; beh WITH aff@0; beh WITH cog@0; aff WITH cog@0;

%c1#2% uniqueid (vuniqueid); beh (vbeh); aff (vaff); cog (vcog);

uniqueid WITH beh@0; uniqueid WITH aff@0; uniqueid WITH cog@0; beh WITH aff@0; beh WITH cog@0; aff WITH cog@0;

Do I need to specify something differently?

Thank you!

Matt4234 avatar Mar 17 '22 16:03 Matt4234

tidyLPA does not support this type of use case; it's really only meant for latent profile analysis without bells and whistles. You probably want MplusAutomation::createMixtures(), which allows full customization.

cjvanlissa avatar Mar 17 '22 17:03 cjvanlissa

Gotcha, thank you for the quick response!

Matt4234 avatar Mar 17 '22 17:03 Matt4234