Hi all,
I am using Stata/SE 14.2 to analyse a randomized controlled trial. Respondents filled the Beck Depression Inventory (bdi) at times 0, 1 and 2. To control for baselines values of the outcome (i.e. control for regression to the mean), I am building the model without the treatment variable and using id: as the second level (following Twisk 2018). The data is in long format
mixed bdi i.time i.intervention#i.time || id:, var
The interaction intervention*time gives me the mean difference in bdi at time 1 and 2. But now I would like to obtain the predicted means of bdi at times 0, 1 and 2 to make a graph for the publication. For this, I am using predict with the option fitted to obtain means that incorporate both fixed and random effects.
predict predri, fitted
mean predri if time==0 & intervention==1
mean predri if time==0 & intervention==0
mean predri if time==1 & intervention==1
mean predri if time==1 & intervention==0
mean predri if time==2 & intervention==1
mean predri if time==2 & intervention==0
However, I obtain exactly the same means as the unadjusted ones using tabstat. In the data, original and predicted values are different, but when I extract the means, these are the same.
Using margins has the same problem (as only fixed effects are incorporated)
margins i.time#i.intervention
I am wondering what is wrong and how I could calculate predictive means that incorporate both fixed and random effects in order to produce a graph.
Thanks in advance for your time
Reference:
Twisk J, Bosman L, Hoekstra T, Rijnhart J, Welten M, Heymans M. Different ways to estimate treatment effects in randomised controlled trials. Contemporary clinical trials communications 2018; 10: 80-5.
Related Posts with Predicting values which incorporate fixed and random effects in linear mixed model
Exporting output of ManWitney U TestHi,
I am unable to find a way to export output of ManWitney U (ranksum) Test for independent samples…
Rigobon and Sack 2003 "Measuring the reaction of monetary policy to the stock market" - ReplicatePaper link: <https://www.federalreserve.gov/pubs/.../200114pap.pdf>
I have some questions on …
Match cross-linked observationsDear Statalist,
I have a large dataset that consolidates identical observations from 3 sources that…
How to export the results of Wald-test/F-test to excel using outreg2 or any other alternative?Hi every one,
I am using the following code
Code:
reg CAR01 NU_SUE NUE_D1 NUE_D2 logmcap lag_p…
Shaded graphDear all,
I was wondering if anyone could point me in the right direction on how to produce a shade…
Subscribe to:
Post Comments (Atom)
0 Response to Predicting values which incorporate fixed and random effects in linear mixed model
Post a Comment