I have a learning assessment dataset of over 60 countries and 2-5 years/waves. While countries are the same in all years, individuals (students) are different in each year. In other words, the data is cross-sectional at the student level. I use a two-step procedure to conduct country-level mixed-effects panel regression. At first, I regress student economic background on their math achievement for each country in each year using a simple OLS regression: achievement = a + economic_background + e.
Or in STATA:
Code:
reg achievement economic_background
The data structure is somewhat like the following-- different students are surveyed in different years from the same country:
Code:
student country year achievement economic_background
101 1 2000 500 78
201 1 2000 488 98
106 1 2003 589 66
407 1 2003 400 76
Then, I use the coefficient of economic_background (named inequality_gradient) as the dependent variable at the second stage regressed by some country-level variables. I use a mixed-effects model using STATA's mixed command to do so. The model looks like the following:
Code:
mixed inequality_gradient var2 var3 || country:
However, to get an unbiased standard error of the mixed-effects model at the second stage, I would like to weight the model by the inverse square of the standard error of economic_background coefficient found in the first OLS regression. To employ this weight named as gradient_se, I am trying to use STATA's analytical weight aweight option. But it seems like mixed command does not accept aweight option. Does anybody have any suggestion about how to incorporate these analytical weights in mixed command in any other ways?
I have tried the following code but get an error:
Code:
mixed inequality_gradient var2 var3 [aw=gradient_se] || country:
aweights not allowed
r(101);
I have also tried with pweight but since I only have weights at level 1 I get a warning saying that the results may be biased. But I do not have weights for countries at level 2. Can I incorporate the weights only at level 1 in a mixed model any other ways?
The data structure at the second stage looks like the following:
Code:
country inequality_gradient gradient_se year var2 var3
1 300 44 2000 1 3
1 200 34 2000 1 3
2 498 55 2003 2 2
2 388 67 2003 4 1
Please let me know if I need to make my problem clearer. I would be happy to do so.
0 Response to Using analytical weight in STATA's mixed effects model
Post a Comment