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
system of equations with endogenous variable and random effects (panel data)Dear all, we need to estimate a system of three linear equations with an endogenous variable on pan…
loop regressionDear, I have a set of different dependent variables and a common set of controls. Furthermore, I ne…
loop to change variable's valueHi! My first post here. So, I want to reshape from long to wide. The variables are called cc_know_* …
Factor variables in qregDear all, I am writing a code on some flexible estimation method and I wanted to use "qreg" as preli…
Create a date variable from a variable of the "int" type.Hello! I am currently trying to create a "date" variable from my current variable named "Date". I …
Subscribe to:
Post Comments (Atom)
0 Response to Predicting values which incorporate fixed and random effects in linear mixed model
Post a Comment