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
Graph with Y axis as stringHi everyone, I have data like below: 25 different methods that generate 25 different estiamtion on …
svy:logit has more observations than simple logit commandI am working with survey data and use the svy command before running my logit regression as follows:…
addplot error after marginsplotI ran a model (dependent variable = gender) and 3 independent variables – year, position_department_…
svy: mean and sorting estimated meansGreetings, Statalisters. I'm hoping this is something someone is willing and able to explain to me,…
Changing the value of many observationsHello So, i'm working on a pretty big dataset for a Norwegian insurance company, and I wanted to ch…
Subscribe to:
Post Comments (Atom)
0 Response to MULTILEVEL – Mixed Effects Model Specification with Random Intercept and Slopes
Post a Comment