Greetings!
I'll take a random-effect model as an example to elaborate my questions.
Regarding the first question:
combining with the outcomes of margins, the mean of 0.con#0.peorid=intercept=94.24.
for example, 1.con#0.peorid=94.24-2.17=91.53, 1.con#1.peorid=94.24-2.17-8.98+6.61=89.16
following this way, the difference between 1.con#0.peorid and 1.con#1.peorid should be -8.98+6.61. However, when interpreting the results of the random effect, our assessment of whether there is a significant difference between 1.con#0.peorid and 1.con#1.peorid depends solely on:
Why is it? or did I misinterpret the outcomes?
For the second question, a between-subject var was added into the model:
How to calculate 0.con#0.period in margins table (93.96) with the intercept from the RE model when other variables are controlled for?
Thank you!
I'll take a random-effect model as an example to elaborate my questions.
Regarding the first question:
Code:
xtreg srs i.condition##i.period, i(indi_num) re vce(robust) margins i.condition#i.period,atmeans
Random-effects GLS regression Number of obs = 366
Group variable: indi_num Number of groups = 122
R-squared: Obs per group:
Within = 0.1207 min = 3
Between = 0.0129 avg = 3.0
Overall = 0.0273 max = 3
Wald chi2(8) = 22.56
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0040
(Std. err. adjusted for 122 clusters in indi_num)
----------------------------------------------------------------------------------
| Robust
srs | Coefficient std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
condition |
1 | -2.707317 4.5169 -0.60 0.549 -11.56028 6.145645
2 | .1810976 4.571382 0.04 0.968 -8.778647 9.140842
|
period |
1 | -8.97561 2.776295 -3.23 0.001 -14.41705 -3.534171
2 | -8.268293 2.256088 -3.66 0.000 -12.69014 -3.846442
|
condition#period |
1 1 | 6.609756 3.346904 1.97 0.048 .0499453 13.16957
1 2 | 3.439024 3.061285 1.12 0.261 -2.560983 9.439032
2 1 | 7.92561 3.131587 2.53 0.011 1.787812 14.06341
2 2 | 6.593293 2.895518 2.28 0.023 .9181814 12.2684
|
_cons | 94.2439 3.354506 28.09 0.000 87.66919 100.8186
-----------------+----------------------------------------------------------------
sigma_u | 18.959945
sigma_e | 8.8829199
rho | .82000724 (fraction of variance due to u_i)
----------------------------------------------------------------------------------
Adjusted predictions Number of obs = 366
Model VCE: Robust
Expression: Linear prediction, predict()
At: 0.condition = .3360656 (mean)
1.condition = .3360656 (mean)
2.condition = .3278689 (mean)
0.period = .3333333 (mean)
1.period = .3333333 (mean)
2.period = .3333333 (mean)
----------------------------------------------------------------------------------
| Delta-method
| Margin std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
condition#period |
0 0 | 94.2439 3.354506 28.09 0.000 87.66919 100.8186
0 1 | 85.26829 3.258103 26.17 0.000 78.88253 91.65406
0 2 | 85.97561 3.112846 27.62 0.000 79.87454 92.07668
1 0 | 91.53659 3.024844 30.26 0.000 85.608 97.46517
1 1 | 89.17073 3.506125 25.43 0.000 82.29885 96.04261
1 2 | 86.70732 3.46236 25.04 0.000 79.92122 93.49342
2 0 | 94.425 3.105612 30.40 0.000 88.33811 100.5119
2 1 | 93.375 3.435914 27.18 0.000 86.64073 100.1093
2 2 | 92.75 3.332357 27.83 0.000 86.2187 99.2813
----------------------------------------------------------------------------------
Group variable: indi_num Number of groups = 122
R-squared: Obs per group:
Within = 0.1207 min = 3
Between = 0.0129 avg = 3.0
Overall = 0.0273 max = 3
Wald chi2(8) = 22.56
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0040
(Std. err. adjusted for 122 clusters in indi_num)
----------------------------------------------------------------------------------
| Robust
srs | Coefficient std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
condition |
1 | -2.707317 4.5169 -0.60 0.549 -11.56028 6.145645
2 | .1810976 4.571382 0.04 0.968 -8.778647 9.140842
|
period |
1 | -8.97561 2.776295 -3.23 0.001 -14.41705 -3.534171
2 | -8.268293 2.256088 -3.66 0.000 -12.69014 -3.846442
|
condition#period |
1 1 | 6.609756 3.346904 1.97 0.048 .0499453 13.16957
1 2 | 3.439024 3.061285 1.12 0.261 -2.560983 9.439032
2 1 | 7.92561 3.131587 2.53 0.011 1.787812 14.06341
2 2 | 6.593293 2.895518 2.28 0.023 .9181814 12.2684
|
_cons | 94.2439 3.354506 28.09 0.000 87.66919 100.8186
-----------------+----------------------------------------------------------------
sigma_u | 18.959945
sigma_e | 8.8829199
rho | .82000724 (fraction of variance due to u_i)
----------------------------------------------------------------------------------
Adjusted predictions Number of obs = 366
Model VCE: Robust
Expression: Linear prediction, predict()
At: 0.condition = .3360656 (mean)
1.condition = .3360656 (mean)
2.condition = .3278689 (mean)
0.period = .3333333 (mean)
1.period = .3333333 (mean)
2.period = .3333333 (mean)
----------------------------------------------------------------------------------
| Delta-method
| Margin std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
condition#period |
0 0 | 94.2439 3.354506 28.09 0.000 87.66919 100.8186
0 1 | 85.26829 3.258103 26.17 0.000 78.88253 91.65406
0 2 | 85.97561 3.112846 27.62 0.000 79.87454 92.07668
1 0 | 91.53659 3.024844 30.26 0.000 85.608 97.46517
1 1 | 89.17073 3.506125 25.43 0.000 82.29885 96.04261
1 2 | 86.70732 3.46236 25.04 0.000 79.92122 93.49342
2 0 | 94.425 3.105612 30.40 0.000 88.33811 100.5119
2 1 | 93.375 3.435914 27.18 0.000 86.64073 100.1093
2 2 | 92.75 3.332357 27.83 0.000 86.2187 99.2813
----------------------------------------------------------------------------------
for example, 1.con#0.peorid=94.24-2.17=91.53, 1.con#1.peorid=94.24-2.17-8.98+6.61=89.16
following this way, the difference between 1.con#0.peorid and 1.con#1.peorid should be -8.98+6.61. However, when interpreting the results of the random effect, our assessment of whether there is a significant difference between 1.con#0.peorid and 1.con#1.peorid depends solely on:
Code:
condition#period | 1 1 | 6.609756 3.346904 1.97 0.048 .0499453 13.16957
For the second question, a between-subject var was added into the model:
Code:
xtreg srs age i.condition##i.period, i(indi_num) re vce(robust) margins i.condition#i.period,atmeans
Random-effects GLS regression Number of obs = 366
Group variable: indi_num Number of groups = 122
R-squared: Obs per group:
Within = 0.1207 min = 3
Between = 0.0501 avg = 3.0
Overall = 0.0595 max = 3
Wald chi2(9) = 28.71
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0007
(Std. err. adjusted for 122 clusters in indi_num)
----------------------------------------------------------------------------------
| Robust
srs | Coefficient std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
age | 3.102243 1.449154 2.14 0.032 .2619534 5.942532
|
condition |
1 | -2.404659 4.427024 -0.54 0.587 -11.08147 6.272149
2 | .7410146 4.599746 0.16 0.872 -8.274322 9.756351
|
period |
1 | -8.97561 2.780192 -3.23 0.001 -14.42469 -3.526534
2 | -8.268293 2.259254 -3.66 0.000 -12.69635 -3.840236
|
condition#period |
1 1 | 6.609756 3.351601 1.97 0.049 .0407385 13.17877
1 2 | 3.439024 3.065581 1.12 0.262 -2.569404 9.447453
2 1 | 7.92561 3.135982 2.53 0.011 1.779198 14.07202
2 2 | 6.593293 2.899582 2.27 0.023 .9102163 12.27637
|
_cons | 73.20918 10.43768 7.01 0.000 52.75171 93.66665
-----------------+----------------------------------------------------------------
sigma_u | 18.657676
sigma_e | 8.8829199
rho | .81521436 (fraction of variance due to u_i)
----------------------------------------------------------------------------------
Adjusted predictions Number of obs = 366
Model VCE: Robust
Expression: Linear prediction, predict()
At: age = 6.688525 (mean)
0.condition = .3360656 (mean)
1.condition = .3360656 (mean)
2.condition = .3278689 (mean)
0.period = .3333333 (mean)
1.period = .3333333 (mean)
2.period = .3333333 (mean)
----------------------------------------------------------------------------------
| Delta-method
| Margin std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
condition#period |
0 0 | 93.95861 3.403995 27.60 0.000 87.2869 100.6303
0 1 | 84.983 3.302808 25.73 0.000 78.50962 91.45639
0 2 | 85.69032 3.077888 27.84 0.000 79.65777 91.72287
1 0 | 91.55395 2.8207 32.46 0.000 86.02548 97.08242
1 1 | 89.1881 3.377072 26.41 0.000 82.56916 95.80704
1 2 | 86.72468 3.299201 26.29 0.000 80.25837 93.191
2 0 | 94.69963 3.085564 30.69 0.000 88.65203 100.7472
2 1 | 93.64963 3.452676 27.12 0.000 86.8825 100.4167
2 2 | 93.02463 3.333012 27.91 0.000 86.49204 99.55721
----------------------------------------------------------------------------------
Group variable: indi_num Number of groups = 122
R-squared: Obs per group:
Within = 0.1207 min = 3
Between = 0.0501 avg = 3.0
Overall = 0.0595 max = 3
Wald chi2(9) = 28.71
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0007
(Std. err. adjusted for 122 clusters in indi_num)
----------------------------------------------------------------------------------
| Robust
srs | Coefficient std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
age | 3.102243 1.449154 2.14 0.032 .2619534 5.942532
|
condition |
1 | -2.404659 4.427024 -0.54 0.587 -11.08147 6.272149
2 | .7410146 4.599746 0.16 0.872 -8.274322 9.756351
|
period |
1 | -8.97561 2.780192 -3.23 0.001 -14.42469 -3.526534
2 | -8.268293 2.259254 -3.66 0.000 -12.69635 -3.840236
|
condition#period |
1 1 | 6.609756 3.351601 1.97 0.049 .0407385 13.17877
1 2 | 3.439024 3.065581 1.12 0.262 -2.569404 9.447453
2 1 | 7.92561 3.135982 2.53 0.011 1.779198 14.07202
2 2 | 6.593293 2.899582 2.27 0.023 .9102163 12.27637
|
_cons | 73.20918 10.43768 7.01 0.000 52.75171 93.66665
-----------------+----------------------------------------------------------------
sigma_u | 18.657676
sigma_e | 8.8829199
rho | .81521436 (fraction of variance due to u_i)
----------------------------------------------------------------------------------
Adjusted predictions Number of obs = 366
Model VCE: Robust
Expression: Linear prediction, predict()
At: age = 6.688525 (mean)
0.condition = .3360656 (mean)
1.condition = .3360656 (mean)
2.condition = .3278689 (mean)
0.period = .3333333 (mean)
1.period = .3333333 (mean)
2.period = .3333333 (mean)
----------------------------------------------------------------------------------
| Delta-method
| Margin std. err. z P>|z| [95% conf. interval]
-----------------+----------------------------------------------------------------
condition#period |
0 0 | 93.95861 3.403995 27.60 0.000 87.2869 100.6303
0 1 | 84.983 3.302808 25.73 0.000 78.50962 91.45639
0 2 | 85.69032 3.077888 27.84 0.000 79.65777 91.72287
1 0 | 91.55395 2.8207 32.46 0.000 86.02548 97.08242
1 1 | 89.1881 3.377072 26.41 0.000 82.56916 95.80704
1 2 | 86.72468 3.299201 26.29 0.000 80.25837 93.191
2 0 | 94.69963 3.085564 30.69 0.000 88.65203 100.7472
2 1 | 93.64963 3.452676 27.12 0.000 86.8825 100.4167
2 2 | 93.02463 3.333012 27.91 0.000 86.49204 99.55721
----------------------------------------------------------------------------------
Thank you!
Comment