GMM with predictor covariates and dis... PreviousNext
Mplus Discussion > Growth Modeling of Longitudinal Data >
Message/Author
 Miguel Freitas posted on Monday, June 02, 2014 - 9:44 am
Hi,
I am new to MPlus and I am a bit lost in all the information available.
I am interested in identifying different trajectories of a continuous indicator (3 time-points), as well as a set of cavariates that predicts class inclusion. Finally, I want to see if the trajectories have different consequences (distal outcomes at T3 - continuous).
Below is my syntax:

MODEL:
%OVERALL%
int slp | sw1@0 sw2@1 sw3@2;
int WITH slp;

int slp ON sex Excl1 Vict1 PrSoc1 F_Inv1 FQ1 M_SSup1 M_NgI1 M_Pow1;

C#1-C#3 ON sex Excl1 Vict1 PrSoc1 F_Inv1 FQ1 M_SSup1 M_NgI1 M_Pow1;

%c#1%
int;
slp;

%c#2%
int;
slp;

%c#3%
int;
slp;

%c#4%
int;
slp;

My questions are:
1. Is it necessary to include the regression command of the intercept and slope in all classes (or just in the Overall model)?
2. How to compare the trajectories regarding the distal outcomes?

Thank you!
Miguel
 Bengt O. Muthen posted on Tuesday, June 03, 2014 - 5:58 pm
1. The standard and more parsimonious approach is to not let the regression vary across classes, so you specify it only in Overall.

2.The distal outcome means will vary across classes as the default. If you want to test mean differences you label these means and then compute their difference in Model Constraint. if you don't want to include the distal in the model, you can study these means using the Auxiliary option DCON.

Note that as a first step you may want to use the default of class-invariant variances and therefore not mention int, slp in each class.
 Miguel Freitas posted on Wednesday, June 04, 2014 - 3:51 am
Hello, Professor,

Thank you for your reply!

I've tried using your suggestion, but I keep getting this error message:

*** ERROR in VARIABLE command
Unrecognized type in the AUXILIARY option: DCON

The syntax is as follows (I've tried different possibilities, though, like writing the DCON option after every variable name, and the result was the same):

AUXILIARY=(DCON) actout3 shy3 lrnprob3 sc_comp3 soc_ac3 behav3;


Also, when I use the E or the DU3STEP options, I don't get any errors.


Thank you!
Miguel
 Linda K. Muthen posted on Wednesday, June 04, 2014 - 11:32 am
DCON was introduced in Version 7.1. Perhaps you are using an earlier version.
 Miguel Freitas posted on Wednesday, June 04, 2014 - 11:49 am
Yes, in fact, I'm using version 7.

In that case, what is your recomendation? Is the AUXILIARY=(E) option ok (contrary to what I said before, the DU3STEP option doesn't work either)?

Miguel
 Bengt O. Muthen posted on Wednesday, June 04, 2014 - 6:30 pm
I would recommend getting Version 7.2. E and DU3STEP have been replaced by a better method. See also Web Note 15 on our website for a manual 3-step method.
 Miguel Freitas posted on Thursday, June 05, 2014 - 5:34 am
Thank you, Professor,

I'm trying to perform the 3 step method, but I can't seem to find the "Logits for the Classification Probabilities the Most Likely Latent Class Membership (Row) by Latent Class (Column)" table. I can only find the "Average Latent Class Probabilities".
Can you tell me why this happens?

Also, if my original model has an entropy of .889 (sample size =260), do you think there will be severe bias if I choose the AUXILIARY=(E) option?

Thank you!
 Linda K. Muthen posted on Thursday, June 05, 2014 - 1:34 pm
I don't think we added these logits until Version 7.11.
 Anne Arnett posted on Tuesday, August 12, 2014 - 10:27 am
I am fitting a growth mixture model with a continuous outcome (a3-a15, 5 time points measured at different ages for each participant). Latent classes are predicted by a continuous variable (x). I also have a distal binary outcome. My data includes siblings, so the model TYPE= MIXTURE RANDOM COMPLEX. The model is:

MODEL:
%OVERALL%
i s | a3-a15 AT cage3-cage15;
i s on x;
C on x;

My question is, is it necessary to include the statement 'i s on x'? When I do this with more than 2 classes estimated, I get a non-positive PSI, and when I remedy this by fixing s@0, it makes it very difficult to replicate the -LL. What would it mean to have x only predicting C, rather than all of the latent variables?

Thank you.
 Bengt O. Muthen posted on Tuesday, August 12, 2014 - 3:24 pm
i s on x;

says that these growth factors vary as a function of x also within classes. So for instance, a high x value tends to create a high i, a high starting point, within each of the classes.

You can check BIC to see if i s on x; is needed.
 Anna King posted on Tuesday, September 16, 2014 - 1:35 pm
Dear Professor,

I'm trying to use the PC method to analyze a GMM model. I included AUXILIARY into the VARIABLE part. I don't know why it didn't work. It kept telling me that X is an unknown variable. Could you please tell me why? Below is the codes I wrote. Thanks!

Title: PC Method

VARIABLE:
NAMES = y1-y4 x;
USEVARIABLES ARE y1-y4 x;
CLASSES = c(2);
AUXILIARY=x(R);

DATA:
FILE IS Math.dat;

analysis: type=mixture;

model:
%overall%
i s | y1@0 y2@1 y3@2 y4@3;
[y1-y4@0];
i* s*;
i with s*;
y1-y4*;
[c#1*0];
c#1 on x1*;

%c#1%
[i*];
[s*];

%c#2%
[i*];
[s*];

Output: tech9;
 Bengt O. Muthen posted on Tuesday, September 16, 2014 - 1:52 pm
A better method is Auxiliary x(R3STEP).

You should not include x in the modeling as you do when saying:

c#1 on x1*;
 Anna King posted on Tuesday, September 16, 2014 - 4:26 pm
Thanks, Professor! I did run the program but I couldn't find any regression coefficients for class and the covariate. Do you know how to get that? Thanks!
 Bengt O. Muthen posted on Tuesday, September 16, 2014 - 5:11 pm
Check that you are doing it correctly as described in Appendix A page 3 of the paper on our website:

Asparouhov, T. & Muthén, B. (2014). Auxiliary variables in mixture modeling: Three-step approaches using Mplus. Structural Equation Modeling: A Multidisciplinary Journal, 21:3, 329-341. The posted version corrects several typos in the published version. An earlier version of this paper was posted as web note 15. Appendices with Mplus scripts are available here.
 Anna King posted on Wednesday, September 17, 2014 - 8:32 am
Sorry to disturb you again, Professor! I did use the 3-step method this time and I have the codes like:

Title: 3-step Method

VARIABLE:
NAMES = y1-y4 x1 x2;
USEVAR ARE y1-y4 x1 x2 x3 x4 ;
CLASSES = c(2);
AUXILIARY = x1-x2(R3STEP);

DEFINE: x3=x1; x4=x2;

DATA: FILE IS Math.dat;

ANALYSIS: type=mixture;

model:
%overall%
i s | y1@0 y2@1 y3@2 y4@3;
[y1-y4@0];
i* s*;
i with s*;
y1-y4*;
[c#1*0];
c#1 on x3*;
c#1 on x4*;

%c#1%
[i*];
[s*];

%c#2%
[i*];
[s*];

Output: tech1 Tech8;

The output part shows the regression coefficients from Categorical Latent Variables on X3 and X4. Then there is also "TESTS OF CATEGORICAL LATENT VARIABLE MULTINOMIAL LOGISTIC REGRESSIONS USING THE 3-STEP PROCEDURE". May I know which numbers I should take? Also, does my code make any sense?

Many thanks in advance!
 Bengt O. Muthen posted on Wednesday, September 17, 2014 - 9:16 am
This is not what Appendix A shows. I don't understand why you have this Define statement. Instead, to see the effects of x1 and x2 on c, say

Title: 3-step Method

VARIABLE:
NAMES = y1-y4 x1 x2;
USEVAR ARE y1-y4;
CLASSES = c(2);
AUXILIARY = x1-x2(R3STEP);

DATA: FILE IS Math.dat;

ANALYSIS: type=mixture;

model:
%overall%
i s | y1@0 y2@1 y3@2 y4@3;
 Anna King posted on Wednesday, September 17, 2014 - 9:52 am
So, "TESTS OF CATEGORICAL LATENT VARIABLE MULTINOMIAL LOGISTIC REGRESSIONS USING THE 3-STEP PROCEDURE" shows the regression coefficients between class and covariates?

I wrote the last codes based on Appendix C because the No.15 paper mentions that in MPlus Version 7 estimations using the 3-step method is not allowed although within a montecarlo simulation it is allowed. So, the DEFINE command is used to duplicate the variable that is to be used in the model. It seems that I don't need to do this any more. Is that correct? Thanks!
 Bengt O. Muthen posted on Wednesday, September 17, 2014 - 10:45 am
Q1. Yes.

Q2. Use Version 7.2
 Anna King posted on Saturday, October 04, 2014 - 7:27 pm
Dear Professors,

May I know if I can get result report on variance explained by the covariates for each growth factor under the growth mixture model? Thanks!
 Linda K. Muthen posted on Sunday, October 05, 2014 - 8:54 am
R-square is provided by using the STANDARDIZED option.
 Anna King posted on Tuesday, October 14, 2014 - 6:50 pm
Sorry to disturb you again, Professor. How can I save variance explained in an output? Also, is there any command that can save covariate effects on the latent class? That is: Is there a way to save the regression coefficients for covariates on each latent class? It looks like I can save all other parameter estimates but these coefficients... Many thanks, as always!
 Anna King posted on Wednesday, October 15, 2014 - 9:21 am
Dear Professor, I hope I made my question clear. As per what I asked in my last posted message, I meant to ask if there is a way to save the regression coefficients estimates from "TESTS OF CATEGORICAL LATENT VARIABLE MULTINOMIAL LOGISTIC REGRESSIONS USING THE 3-STEP PROCEDURE"?

Many thanks!
Anna
 Linda K. Muthen posted on Wednesday, October 15, 2014 - 1:46 pm
Variance explained is R-square. You get that by asking for STANDARDIZED in the OUTPUT command.

No, these values cannot be saved.
 Anna King posted on Friday, November 28, 2014 - 7:33 pm
Dear Professor,

I'm using both 1-step and the new 3-step method to estimate covariates effects on the growth part (intercept and slope) of a 2-class growth mixture model. It seems I get exactly the same results from the two methods. Could you please check if my codes are correct or, I should get the same results? My codes will be followed in the next message. Thanks, Anna
 Anna King posted on Friday, November 28, 2014 - 7:43 pm
Title: 1-step method
VARIABLE:
NAMES = y1-y4 x1 x2;
USEVARIABLES ARE y1-y4 x1 x2;
CLASSES = c(2);
...
MODEL:
%overall%
i s | y1@0 y2@1 y3@2 y4@3;
i*2 s*.4;
i with s*.45;
y1-y4*.75(ve);
[c#1*0.02]; !Class proportion
i s on x1 x2;
%c#1%
[i*10];
[s*2];
i on x1*0.3 x2*0.5;
s on x1*0.2 x2*0.2;
%c#2%
[i*11];
[s*2.5];
i on x1*0.5 x2*0.2;
s on x1*0.2 x2*0.1;

Title: 3-Step method
VARIABLE:
NAMES = y1-y4 x1 x2;
USEVARIABLES ARE y1-y4 x1 x2 x3 x4;
CLASSES = c(2);
AUXILIARY = x1-x2(R3STEP);
DEFINE:x3=x1;x4=x2;
...
MODEL:
%overall%
... (same as the above)
i s on x3 x4;
%c#1%
[i*10];
[s*2];
i on x3*0.3 x4*0.5;
s on x3*0.2 x4*0.2;
%c#2%
[i*11.22];
[s*2.55];
i on x3*0.5 x4*0.2;
s on x3*0.2 x4*0.1;
Many thanks! ~ Anna
 Bengt O. Muthen posted on Saturday, November 29, 2014 - 6:20 pm
Please send the outputs for the two runs to support along with your license number.
 Daniel Lee posted on Saturday, March 14, 2015 - 1:17 pm
Hi Dr. Muthen,

I conducted a GMM for religiosity and found a 3 class trajectory - high throughout (1), high-but declining across time, and consistently low (3). I would like to now examine if these three classes might condition the protective role of religion on the stress-depression link. That is, can I run a parallel process model between religion and depression, where the effect of religion on depression is conditioned by the person's latent growth class membership? So - people who are constantly religious at a high level (class 1) may benefit MORE from religion than a person who is constantly at a low level (class 3). I'm not sure how to include these classes into the parallel process model between religion and depression to examine whether the effect of religion is conditional on the person's growth trajectory (class 1, 2 or 3).

Any insight would be greatly appreciated! Thank you!
 Bengt O. Muthen posted on Saturday, March 14, 2015 - 5:36 pm
How is the effect of religion on depression different from the effect of GMM trajectory classes for religiosity on depression?
 Daniel Lee posted on Saturday, March 14, 2015 - 9:04 pm
Oh! I didn't know I can run a parallel process with a GMM trajectory on a LGM trajectory. Is that possible? If so, I would appreciate any resources that can help me write the mplus stytax for this kind of analysis!
 Bengt O. Muthen posted on Sunday, March 15, 2015 - 3:08 pm
Start from UG ex7.14 and modify it for your purposes.
 Daniel Lee posted on Tuesday, October 18, 2016 - 12:25 pm
Hi Dr. Muthen,

I'm using the BCH method for GMM. I have intercepts of alcohol, nicotine, and marijuana use (distal outcomes) for each class (3).


1) Gender (0= female, 1 = male), a covariate, was included within- and between- classes, and was significant all around. When conducting tests to examine the mean difference of (lets say) alcohol use between class 1 and class 2, what would be the best approach in conducting these tests, now that sex is a significant predictor of alcohol use? would it make sense to calculate two means for alcohol use - females (intercept of alcohol) and males (intercept + effect of alcohol on sex) - and then do the chi-square tests between classes (e.g., male alcohol use class 1 vs. male alcohol use class 2)?

2) Would omnibus chi-square tests with pairwise contrasts be appropriate?

Thank you!
 Bengt O. Muthen posted on Tuesday, October 18, 2016 - 6:16 pm
1) If you just have the main effect of gender on the distal, then just consider the mean/threshold difference across classes. If you think there is an interaction between gender and class, then let the regression of distal on gender vary across classes in the model.

2) Don't know how that would work.
 Daniel Lee posted on Wednesday, October 19, 2016 - 8:20 am
Thank you. Is there a way to do mean difference tests across the mean/thresholds (which I assume is the mean of distal outcomes represented in the intercept) of distal outcomes by class (so I can report whether the differences are statistically significant)? If so, can you can direct me to some resources so that I can learn the syntax?
 Bengt O. Muthen posted on Wednesday, October 19, 2016 - 5:46 pm
You can use Model Constraint to express any differences you want.
 Daniel Lee posted on Friday, July 27, 2018 - 7:45 pm
Hi Dr. Muthen,

If I have an interaction term between two predictors (e.g., income, percent White residents) predicting trajectory classes in a growth mixture model (using R3STEP). I was wondering how one might probe that interaction? Would you have any (un)published resource with Mplus code for probing this kind of interaction?

As always, thank you for your help.
 Bengt O. Muthen posted on Saturday, July 28, 2018 - 5:34 pm
You would use Model Constraint for this. First express the interaction as usual via the simple slope expression

(b1 + b3*Z)

where Z moderates (interacts with) the X predictor. But you then have to realize that this refers to a logit DV for one category/class of your latent nominal DV, namely the latent class variable. You can then translate that logit expression into a probability for the category/class (again in Model Constraint)- Chapter 14 of the UG shows how to do that. Then you use the PLOT and LOOP options of Model Constraint to do the plot.
 Boyu Zhai posted on Tuesday, August 18, 2020 - 2:47 am
Dear Professor,

I tried to compare the differences of the dependent variables between the different class.

Looking at the previous post, I wrote the following code. However, in the output, the chi-square difference test were not provided in the output. What's wrong with my code?

Analysis:
Type=Mixture;
Starts=0;
Stiterations=10;
Estimator=MLR;

Model:
%Overall%
c on Zw1yy; !Zw1yy is control variables
[Zw3yy];

%c#1%
[N#1@8.227];
[N#2@-5.588];
[Zw3yy](m1);

%c#2%
[N#1@-7.818];
[N#2@5.995];
[Zw3yy](m2);

%c#3%
[N#1@-13.724];
[N#2@-2.348];
[Zw3yy](m3);

model test:
0=m2-m1;
0=m3-m1;

OUTPUT:SAMPSTAT;

Sincerely
Boyu
 Bengt O. Muthen posted on Tuesday, August 18, 2020 - 9:10 am
We need to see your full output to diagnose this - send to Support along with your license number.
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: