I am performing LGM with binary variable(obesity)in long format. My baseline model including age, cohort,femal, education. While the baseline model runs very well, I have not been succesful to run model when adding any other variables(i.e., marital status, employment status etc).
usevariables are female urban marital newid cage chrt edu2 edu3 edu4 agesq agechrt overwght; categorical are overwght; cluster=newid; within= marital cage edu2 edu3 edu4 agesq agechrt; between= female urban chrt; Analysis: Type = twolevel random; estimator=ml; !default is mlr Model: %within% overwght on marital edu2 edu3 edu4 agesq agechrt ; s | overwght on cage; %between% overwght on female urban chrt; overwght with s;
*** ERROR in VARIABLE command On the USEVARIABLES list, variables from the NAMES list must come before all new variables created using the DEFINE command. The variables(s) violating this order are: ARE
However I put the use variables in the same order as in the variable list.
When I run the same model with BMI as continuous D.V, I got the following message.
*** ERROR in VARIABLE command TYPE = TWOLEVEL analysis requires option CLUSTER.