Hi Statalist,
I am currently running mixed models to look at the differences in BMI trajectories between cases and controls. The model is as follows:
mixed c.BMI_ i.Case##c.visit##c.visit c.Age i.Gender i.Ethnicity i.Education || ID: c.visit##c.visit,covariance (unstructured) reml
Case (0, 1): denotes the disease status,
Visit (-11, -10, 9...0): time variable reflecting the number of years before the occurrence of the disease.
Age, Gender, Ethnicity, and Education are covariates.
My questions are:
1) should I put the quadratic term c.visit##c.visit or just the linear term c.visit for the part after ID.
2) I mean trying to compare the estimated differences in BMI at each timepoint between the cases and controls (visit=-11, -10....1, 0), using contrast as the postestimation approach after 'margin, at(visit=(-11(1)0)) over(Case)'. However, when I used 'contrast r.Case#c.visit', it shows only one estimate treating visit as a continuous variable. When I specified it as a categorical variable, there was an error message. It seems that the form of the time variable must be consistent across the main and post-analysis. I was wondering if there is a way to do this in STATA?
Thank in advance.
Regards,
TTK
I am currently running mixed models to look at the differences in BMI trajectories between cases and controls. The model is as follows:
mixed c.BMI_ i.Case##c.visit##c.visit c.Age i.Gender i.Ethnicity i.Education || ID: c.visit##c.visit,covariance (unstructured) reml
Case (0, 1): denotes the disease status,
Visit (-11, -10, 9...0): time variable reflecting the number of years before the occurrence of the disease.
Age, Gender, Ethnicity, and Education are covariates.
My questions are:
1) should I put the quadratic term c.visit##c.visit or just the linear term c.visit for the part after ID.
2) I mean trying to compare the estimated differences in BMI at each timepoint between the cases and controls (visit=-11, -10....1, 0), using contrast as the postestimation approach after 'margin, at(visit=(-11(1)0)) over(Case)'. However, when I used 'contrast r.Case#c.visit', it shows only one estimate treating visit as a continuous variable. When I specified it as a categorical variable, there was an error message. It seems that the form of the time variable must be consistent across the main and post-analysis. I was wondering if there is a way to do this in STATA?
Thank in advance.
Regards,
TTK