Hello everyone,
I am trying to run latent growth curve models in Stata with the sem command. And I have two questioins that I am hoping to get help with.
Below is my code for an unconditional linear LCM:
sem (Int@1 Lin@0 -> health1) ///
(Int@1 Lin@1 -> health2) ///
(Int@1 Lin@2 -> health3) ///
(Int@1 Lin@3 -> health4), ///
noconstant mean(Int Lin) method(mlmv)
My first question is about adding categorical predictors and covariates in the model. As far as I know, sem does not work with factor coding. Does that mean I have to dummy out all the categorical variables and list them in the model? How about for a time-varying covariate that has three categories? Do I need to dummy out the variable at each wave and put in all the 12 (3*4) binary variables? I wonder if there is a easier way to include categorical vars. Please let me know!
My second question is about the TIME indicator. My sample involves four waves of data. At the first wave, respondents' age is between 20 to 30. I am wondering whether I can use AGE rather than survey WAVE as my time indicator, and how does that lead to a difference in my code?? I am used to using mixed command for growth analysis where there is a time variable in the code. But for the sem commend, how do we let Stata know which time indicator we want to use?
Thanks for any help!!
I am trying to run latent growth curve models in Stata with the sem command. And I have two questioins that I am hoping to get help with.
Below is my code for an unconditional linear LCM:
sem (Int@1 Lin@0 -> health1) ///
(Int@1 Lin@1 -> health2) ///
(Int@1 Lin@2 -> health3) ///
(Int@1 Lin@3 -> health4), ///
noconstant mean(Int Lin) method(mlmv)
My first question is about adding categorical predictors and covariates in the model. As far as I know, sem does not work with factor coding. Does that mean I have to dummy out all the categorical variables and list them in the model? How about for a time-varying covariate that has three categories? Do I need to dummy out the variable at each wave and put in all the 12 (3*4) binary variables? I wonder if there is a easier way to include categorical vars. Please let me know!
My second question is about the TIME indicator. My sample involves four waves of data. At the first wave, respondents' age is between 20 to 30. I am wondering whether I can use AGE rather than survey WAVE as my time indicator, and how does that lead to a difference in my code?? I am used to using mixed command for growth analysis where there is a time variable in the code. But for the sem commend, how do we let Stata know which time indicator we want to use?
Thanks for any help!!
Comment