Dear STATA colleagues,
I am working with data containing approximately 300 000 individuals, grouped into 100 groups and I would like to ask your help to check two specifications of a mixed-effects model with two levels and to code the appropriate model with random slopes with different decompositions of X’s Betas.
Considering that:
Xij=Explanatory variables (unit: individual)
Wij=Control variables (unit: individual)
Zj=Group Variables (unit: group - GroupID)
We first formulated the following specification with a random-intercept:
Specification 1: Y=B0+B1.X1+B2.X2+B3.X3+B4.W1+B5.W2+B6.W3+B7.W4+B8. Z1+B9.Z2+B10.Z3+error1
Here, we want to decompose the intercept considering different levels explained by group variables, as follows:
B0=a00 + a01.Z1 + a02.Z2 + a03.Z3 + error2
To do that on STATA (knowing that Y; X1; W2; W3; W4; Z2; Z3 are continuous variables and that X2; X3; W1; Z1 are binary Variables) we built the following code:
mixed Y X1 X2 X3 W1 W2 W3 W4 Z1 Z2 Z3|| GroupID: , covariance(unstructured)
Then, as we found that B1, B2 and/or B3 in Specification 1 are statistically significant, we moved to the Specification 2 with random-intercept and random-slopes, as follows:
Specification 2:
Y=B0+B1.X1+B2.X2+B3.X3+B4.W1+B5.W2+B6.W3+B7.W4+B8. Z1+B9.Z2+B10.Z3+error1
Where we want to decompose the intercept but also (by assumption) the slope of X1; X2 and X3 with different specifications as follows:
B0=a00+ a01.Z1+a02.Z2+a03.Z3+error2
B1=a10+ a11.Z1+error3
B2=a20+ a21.Z1+a22.Z2+error4
B3=a30+ a31.Z1+a32.Z2+a33.Z3+error5
With specification 2, we intend not only to control the effect of Group on betas’ slope but also to verify how Group variables (i.e., Z1; Z2 and Z3) influence that slope: mitigating or exacerbating the effect of explanatory variables on the dependent.
In other words, analogous with other models, we want to capture the interactive effect between explanatory and group variables.
I will appreciate it very much if you could help me with the design of the code on STATA addressing our specification 2.
Thank you in advance for all insights we can provide me about.
Related Posts with MULTILEVEL – Mixed Effects Model Specification with Random Intercept and Slopes
Question about xtdpdgmm and xtabond2Hello all I m trying to run a difference gmm model with both these commands but I have different res…
Versioning problemHi. I'm submitting this for one of our programmers and wondering if there's a simple fix or if we ne…
tableHey, I need to compute the table that i presented below, but i am not sure how to write the command …
I want to create a new variable that can double count some observationsHello I am using Stata/SE 13.1 on windows10. Apologies I am a Stata novice but will try my best here…
Delete single observationsHello everyone, I have a dataset where I have to create couples of people in a way that every house…
Subscribe to:
Post Comments (Atom)
0 Response to MULTILEVEL – Mixed Effects Model Specification with Random Intercept and Slopes
Post a Comment