I am analyzing data with the mental health component score (measured 0-100) for 4500 individuals. This score was measured at baseline and then 30 days following an intervention.
I would like to use regression to see the average change in score over time.
I used the following codes to reshape my data:
rename preop_mcs test1
rename x30d_mcs test2
reshape long test, i(sampleid) j(time)
xtset sampleid
xtreg test
I then conducted a mixed effects regression with the following code:
meglm test time || sampleid:
Then I added covariates:
meglm test time age sex smoking race bmi || sampleid:
I've noticed no matter how many or which covariates I've added the coefficient for time does not change. Because I know age is significantly associated with the score from my previous analysis, I'd expect to see at least a little change. This makes me think something is wrong with my coding and/or approach.
I appreciate any guidance with the above coding and how to proceed with a regression.
Related Posts with Analyzing two time points with regression
creating matrix of coefficient covariance valueshi-- I would like to create matrices of the coefficient covariance matrices generated by the code: …
removing duplicates based on a criteriaHello, I have a dataset with village names and their respective populations. Villages belong to diff…
stpm2cr - Problems plotting CIF difference, cause-specific hazard function and sub distribution hazard functionsHi all, I continue to work with stpm2cr to model cumulative incidence for my study (Mozumder et al,…
2023 Stata Conference Stanford - Call for presentationsOn behalf of the organizing committee (Colin Cameron, Jeremy Freese, Lakshika Tennakoon and myself),…
Bootstrapping using multiple samplesI have two samples from different sources. The primary sample is a panel, but does not contain the i…
Subscribe to:
Post Comments (Atom)
0 Response to Analyzing two time points with regression
Post a Comment