Introducing covariate into GMM PreviousNext
Mplus Discussion > Growth Modeling of Longitudinal Data >
Message/Author
 ph posted on Sunday, April 19, 2015 - 7:58 pm
Hi there

Trying to run a GMM and introduce one covariate (BMI) . If I do not add BMI into the USEVAR section, it cannot read the variable and I get the error message: "Unknown variable(s) in an ON statement: BMI"

If I do add my covariate into the USEVAR list, I get another error message:
"Variable is uncorrelated with all other variables within class: BMI"

Not sure what to do. Here's the syntax:
Thanks

VARIABLE: names are ID age length pre wk5 wk10 wk15 wk20 wk25 wk30 wk35 wk40
wk45 wk50 wk55 wk60 post bmi;
USEVAR= pre wk5 wk10 wk15 wk20 wk25 wk30 wk35 wk40 wk45 wk50 wk55 wk60 post bmi;
MISSING = all(999);
CLASSES = c(2);
ANALYSIS: type= MIXTURE;
MODEL: %OVERALL%
I S| pre@0 wk5@1 wk10@2 wk15@3 wk20@4 wk25@5 wk30@6 wk35@7 wk40@8 wk45@9 wk50@10 wk55@11 wk60@12 post@13;
%c#1%
I S;
%c#2%
I S;
I S ON bmi;
c#1 ON bmi;
c#2 ON bmi;
 Linda K. Muthen posted on Monday, April 20, 2015 - 10:29 am
You should move the ON statements to the overall part of the MODEL command.
 ph posted on Monday, April 20, 2015 - 5:09 pm
I tried doing that and now I am getting one of two error messages depending on what part of the "overall" section I put the ON statements in

"to declare random effect variables, TYPE = RANDOM must be specified in the ANALYSIS command" (which I don't want?)

or

"No reference to the slopes of the last class is allowed."
 Linda K. Muthen posted on Monday, April 20, 2015 - 5:37 pm
Try the following. You can't refer to class 2. It is the reference class in the multinomial logistic regression.

MODEL: %OVERALL%
I S| pre@0 wk5@1 wk10@2 wk15@3 wk20@4 wk25@5 wk30@6 wk35@7 wk40@8 wk45@9 wk50@10 wk55@11 wk60@12 post@13;
I S ON bmi;
c#1 ON bmi;
%c#1%
I S;
%c#2%
I S;
 ph posted on Monday, April 20, 2015 - 6:09 pm
Thank you so much, it worked! Now that I am reading the syntax I was copying from I realise that there was in fact 1 less class in the "MODEL" section than they were testing for - can't believe I missed that.
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: