Hi Listers,
I have data collected at 5 time points: baseline, 3 weeks, 6 weeks, 9 weeks, and 12 weeks. At each point, well-being scores (continuous measure) are being recorded as well as hospitalization status (hospitalized or not). I am interested in assessing whether well-being scores predict hospitalization at the next time point (e.g. well-being reported at baseline predicts hospitalization at 3 weeks).
I could run separate logistics regressions for hospitalization at weeks 3 to 12 but I would like to be able to run one model. I am wondering if I could use a mixed model to determine whether there is an association between well-being and hospitalization rates overall. I am not sure how to best set it up using xtlogit.
I reshaped the data (extract below) so that baseline well-being scores are coded as 3 weeks, scores at week 6 as week 3 so that they correspond to the hospitalization timepoint of interest.
I then set up the xlogit command as I included time as a covariate - is this model only applying random intercept or slope as well?
xtlogit hospital wellbeing i.time ,i(id)
I would appreciate any feedback on this approach and/or whether I should be looking at something different.
Thanks in advance!
I have data collected at 5 time points: baseline, 3 weeks, 6 weeks, 9 weeks, and 12 weeks. At each point, well-being scores (continuous measure) are being recorded as well as hospitalization status (hospitalized or not). I am interested in assessing whether well-being scores predict hospitalization at the next time point (e.g. well-being reported at baseline predicts hospitalization at 3 weeks).
I could run separate logistics regressions for hospitalization at weeks 3 to 12 but I would like to be able to run one model. I am wondering if I could use a mixed model to determine whether there is an association between well-being and hospitalization rates overall. I am not sure how to best set it up using xtlogit.
I reshaped the data (extract below) so that baseline well-being scores are coded as 3 weeks, scores at week 6 as week 3 so that they correspond to the hospitalization timepoint of interest.
I then set up the xlogit command as I included time as a covariate - is this model only applying random intercept or slope as well?
xtlogit hospital wellbeing i.time ,i(id)
I would appreciate any feedback on this approach and/or whether I should be looking at something different.
Thanks in advance!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int id byte time double(wellbeing hospital) 1 0 2 1 1 3 2 1 1 6 6 1 1 9 3 1 2 0 7 1 2 3 3 1 2 6 3 . 2 9 . 1 3 0 7 1 3 3 7 1 3 6 5 0 3 9 . 0 4 0 5 . 4 3 . . 4 6 . . 4 9 . . 5 0 7 1 5 3 5 1 5 6 2 0 5 9 . . 6 0 4 1 6 3 7 0 6 6 . 1 6 9 5 1 7 0 3 1 7 3 4 0 7 6 . 0 7 9 . 0 end label values hospital FU_12mo_still_smoking_coded label def FU_12mo_still_smoking_coded 1 "yes", modify
Comment