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
Extracting unique strings from multiple variables for each observationI have school level data with the name of different counties they have belonged to across a number o…
ppml (gravity equation) with quadratic term of the distance variableHello, Here is my question: I am testing the curvilinear (inverted U-shape) effect of distance (cu…
Syntax for FMM Regression for Multiple Observations Within CasesI need to estimate a 3-latent-class FMM regression (with a continous dependent variable) analyzing a…
margins not estimableHello, I am trying to have the partial effect of being an immigrant evaluated at the mean level of y…
How to reshape data for analysis (Discrete choice experiment)Hi there, hello to the community. I'd need some help with how to prepare/shape data for analysis fro…
Subscribe to:
Post Comments (Atom)
0 Response to Predicting values which incorporate fixed and random effects in linear mixed model
Post a Comment