I would like to run a mixed-effects linear regression model with cesd as my outcome variable and SPPB_score and assignment_r as my independent variables with an interaction term for SPPB_score & assignment_r for time points 1 and 3 (there are 4 total time points). However, I would like to only run this model for participants with a baseline cesd >= 11, which would be the cesd score at time point 1.
I have used the code below to run the model for the whole sample with any baseline cesd score, but I do not know how to edit this code to run only for participants with a baseline cesd >=11.
Code:
xtmixed cesd SPPB_score weight assignment_r c.SPPB_score#assignment_r || pid: if time==1|time==3, mle nolog
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long pid byte cesd float SPPB_score long assignment_r 10002 4 1 1 10002 2 6 1 10002 5 8 1 10002 8 5 1 10005 17 4 0 10005 10 1 0 10005 6 7 0 10005 17 6 0 10008 5 11 1 10008 2 11 1 10008 1 1 1 10008 1 10 1 10011 7 7 1 10011 5 1 1 10011 8 6 1 10011 14 9 1 10012 11 11 1 10012 19 10 1 10012 15 11 1 10012 10 1 1 10013 9 1 0 10013 0 5 0 10013 9 5 0 10013 10 7 0 10015 16 10 1 10015 17 1 1 10015 . 8 1 10015 16 10 1 10017 14 1 1 10017 9 6 1 end label values assignment_r assignment_r label def assignment_r 0 "Newsletter", modify label def assignment_r 1 "Phone", modify
0 Response to Mixed-Effects Linear Model Set-up
Post a Comment