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
Instrumental Variables: nonlinear endogenous variable Hello Statalist! I'm doing an exercise from Microeconometrics Using Stata, by Cameron and Trivedi, …
Using a Difference-in-Difference approach with a logit modelI am trying to run a simple DID model with a binary dependent variable, i.e. a logit model. Is this …
How to test heteroskedasticity with xtpmg command. ThanksDear all, I used xtpmg command to estimate three of following: PMG (Pooled Mean Group) MG (Mean Gro…
Estimating policy effect with Logit modelSo I am testing a policy which was introduced in a country trying to incentivise people to stay empl…
Add trend line to a grouped bar graph?I'm wanting to add 1 or more trend lines (lfit?) to bar graph with 3 variables over month. Here's cu…
Subscribe to:
Post Comments (Atom)
0 Response to Predicting values which incorporate fixed and random effects in linear mixed model
Post a Comment