I'm struggling for several weeks now to find a solution to my problem below, but with no luck!
I've running a linear spline mixed-effects model to examine development of BMI over time (multilevel models or growth curve analysis). The models includes 4 splines which produce estimates for the rate of change in BMI for each spline period:
Code:
mi estimate: mixed bmi age10_16 age16_23 age23_33 age33_42 || id: agec if cohort==1, cov(unstr) mle stddev
I would now like to produce individual level intercepts and slopes for each study participant for further analysis. This is straightforward when using non-imputed data. However, I'm not sure about what the right way is for linear spline models run using imputed data.
The following code (using the mi: xeq package) would work on a regular mixed-effects models (on imputed data), and you get the individual-level intercepts & slopes. Also, it is recommended the produce the slopes & intercepts (and residuals) fore each imputed model separately, which is what the mi:xeq does:
Without splines:
Code:
mi xeq: mixed bmi age || id: agec, cov(unstr) mle stddev; predict u1 u0, reffects gen intbmi = _b[_cons] + u0 gen slopebmi = _b[age] + u1
Code:
mi xeq: mixed bmi age10_16 age16_23 age23_33 age33_42 || id: agec, cov(unstr) mle stddev; predict u1 u0, reffects *intercept: gen intbmi = _b[_cons] + u0 *spline specific slopes: gen slopebmi1 = _b[age10_16] + u1 gen slopebmi2 = _b[age16_23] + u1 gen slopebmi3 = _b[age23_33] + u1 gen slopebmi4 = _b[age33_42] + u1
Many Thanks
/Amal
0 Response to Predicting individual-level slopes and intercepts after running linear spline mixed-effects models on imputed data
Post a Comment