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
Absent confidence intervals when using twoway lfitciHello, I'm generating some graphs for data illustration purposes. As a brief background, the projec…
How to remove last 3 digits from a numerical variable in STATAHello Everyone! I have a variable HHPBASE, from which I need to chop off last 3 digits, How do I do …
Asdoc mixed regression || inclusion not workingHi everyone. I'm trying to export the results of my mixed methods ordered regression using the asdoc…
Replacing string values with numerical valuesHi everyone, I'm working on a project using multiple tennis data sets (initially csv files, using a…
How to Use Stata Code to Count How Many Students ever took More Than 1 Time Exam?I have a small dataset and it just has 2 variables. ID---student ID, exam_times----how many times a …
Subscribe to:
Post Comments (Atom)
0 Response to Analyzing two time points with regression
Post a Comment