Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Mplus Syntax Generation when Using estimate_profiles #189

Open
Matt4234 opened this issue Mar 17, 2022 · 2 comments
Open

Incorrect Mplus Syntax Generation when Using estimate_profiles #189

Matt4234 opened this issue Mar 17, 2022 · 2 comments

Comments

@Matt4234
Copy link

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!

@cjvanlissa
Copy link
Collaborator

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.

@Matt4234
Copy link
Author

Gotcha, thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants