Hello everyone,
I am presenting an interesting problem here, at least interesting and at the same time weird to me. I am running an OLS regression using reg command. I have three continuous variables and one binary treatment variable. In addition, I want to include year fixed effects, district fixed effects, and unit fixed effects using the factor variable notation in Stata (i.varname). However, my coefficients are sensitive to the ordering of factor variables. For example when I run:
I am getting this
But when I change the order of just two factor variables as follows:
I am getting the following result:
Please take a look at the coefficient on t (the treatment indicator), why would changing the order of factor variables change the results. Is it not supposed to satisfy the additive property? Or am I missing something?
I am presenting an interesting problem here, at least interesting and at the same time weird to me. I am running an OLS regression using reg command. I have three continuous variables and one binary treatment variable. In addition, I want to include year fixed effects, district fixed effects, and unit fixed effects using the factor variable notation in Stata (i.varname). However, my coefficients are sensitive to the ordering of factor variables. For example when I run:
Code:
global xlist classsize teacher_perstudent higheduc_teacher_perstudent i.districteng i.schoolid i.progyear reg avgscore_male_nonretaker t $xlist, cluster(schoolid) allbaselevels
PHP Code:
Linear regression Number of obs = 43
F(5, 29) = .
Prob > F = .
R-squared = 0.9698
Root MSE = 12.95
(Std. Err. adjusted for 30 clusters in schoolid)
---------------------------------------------------------------------------------------------
| Robust
avgscore_male_nonretaker | Coef. Std. Err. t P>|t| [95% Conf. Interval]
----------------------------+----------------------------------------------------------------
t | 18.75526 42.49063 0.44 0.662 -68.14784 105.6583
classsize | -.1132929 1.046558 -0.11 0.915 -2.253744 2.027158
teacher_perstudent | 16.13461 19.98505 0.81 0.426 -24.73941 57.00864
higheduc_teacher_perstudent | -28.82376 58.8787 -0.49 0.628 -149.2442 91.59671
|
districteng |
Dai Mirdad | 0 (base)
Dara i Suf Bala | 122.3196 33.65303 3.63 0.001 53.49143 191.1478
Gizab | 49.01942 101.9663 0.48 0.634 -159.525 257.5639
Jalreez | 104.6114 438.0338 0.24 0.813 -791.2684 1000.491
Khas Uruzgan | 71.54592 58.80817 1.22 0.234 -48.7303 191.8221
Kiti | 48.78746 22.03812 2.21 0.035 3.714444 93.86049
Lal o Sar Jangal | -26.31099 107.3473 -0.25 0.808 -245.8608 193.2388
Malistan | 88.19973 46.43968 1.90 0.068 -6.780067 183.1795
Markaz Behsud | 1.466345 54.6986 0.03 0.979 -110.4049 113.3375
Miramoor | 50.78536 61.51352 0.83 0.416 -75.02392 176.5946
Nahor | 92.51837 29.796 3.11 0.004 31.57871 153.458
Panjab | 21.75951 26.68676 0.82 0.422 -32.82105 76.34007
Roy do Ab | 54.42585 42.86992 1.27 0.214 -33.25297 142.1047
Shahristan | 63.03825 19.94752 3.16 0.004 22.24099 103.8355
Shikh Ali | -22.67487 49.27363 -0.46 0.649 -123.4508 78.10102
Waras | 60.66022 30.47429 1.99 0.056 -1.66669 122.9871
Yakawlang | 42.0939 31.28532 1.35 0.189 -21.89176 106.0796
|
progyear |
2014 | 0 (base)
2015 | -37.10014 47.96113 -0.77 0.445 -135.1917 60.99138
2016 | -51.78048 97.60409 -0.53 0.600 -251.4033 147.8423
2017 | -83.51801 140.8801 -0.59 0.558 -371.6502 204.6142
|
schoolid |
150300010 | 0 (base)
150300019 | -58.26665 97.24575 -0.60 0.554 -257.1565 140.6232
150300026 | -78.04578 53.70461 -1.45 0.157 -187.884 31.79248
150500016 | 0 (omitted)
260300005 | 0 (omitted)
260400001 | -11.29118 39.35719 -0.29 0.776 -91.78568 69.20332
260400002 | 0 (omitted)
270700022 | 122.8894 103.3797 1.19 0.244 -88.54591 334.3247
270700048 | 0 (omitted)
280400012 | -55.59268 40.07616 -1.39 0.176 -137.5576 26.37227
280400018 | 0 (omitted)
280500003 | 18.90369 49.73354 0.38 0.707 -82.81283 120.6202
280500036 | 0 (omitted)
280600047 | 0 (omitted)
306000018 | 0 (omitted)
340600022 | 0 (omitted)
340700013 | -32.15847 66.5693 -0.48 0.633 -168.308 103.991
340700028 | 0 (omitted)
340900024 | 0 (omitted)
402000012 | -97.33107 421.7379 -0.23 0.819 -959.882 765.2199
402000019 | 0 (omitted)
404000010 | 53.02595 32.69272 1.62 0.116 -13.83818 119.8901
404000033 | -39.52184 47.86309 -0.83 0.416 -137.4128 58.36917
404000035 | -85.81084 72.24248 -1.19 0.245 -233.5633 61.94163
404000043 | 24.28322 102.5233 0.24 0.814 -185.4005 233.9669
404000073 | 0 (omitted)
405000008 | 0 (omitted)
604000098 | 0 (omitted)
604000103 | 0 (omitted)
606000070 | 0 (omitted)
|
_cons | 167.3151 45.65664 3.66 0.001 73.93678 260.6934
---------------------------------------------------------------------------------------------
Code:
global xlist classsize teacher_perstudent higheduc_teacher_perstudent i.districteng i.schoolid i.progyear reg avgscore_male_nonretaker t $xlist, cluster(schoolid) allbaselevels
PHP Code:
Linear regression Number of obs = 43
F(5, 29) = .
Prob > F = .
R-squared = 0.9698
Root MSE = 12.95
(Std. Err. adjusted for 30 clusters in schoolid)
---------------------------------------------------------------------------------------------
| Robust
avgscore_male_nonretaker | Coef. Std. Err. t P>|t| [95% Conf. Interval]
----------------------------+----------------------------------------------------------------
t | -9.08408 12.34954 -0.74 0.468 -34.34173 16.17356
classsize | -.1132929 1.046558 -0.11 0.915 -2.253744 2.027158
teacher_perstudent | 16.13461 19.98505 0.81 0.426 -24.73941 57.00864
higheduc_teacher_perstudent | -28.82376 58.8787 -0.49 0.628 -149.2442 91.59671
|
districteng |
Dai Mirdad | 0 (base)
Dara i Suf Bala | 94.48027 32.3545 2.92 0.007 28.30789 160.6527
Gizab | 104.6981 18.04242 5.80 0.000 67.79721 141.599
Jalreez | 48.93273 516.7161 0.09 0.925 -1007.87 1105.736
Khas Uruzgan | 99.38525 31.14976 3.19 0.003 35.67684 163.0937
Kiti | 48.78746 22.03812 2.21 0.035 3.714444 93.86049
Lal o Sar Jangal | 29.36768 21.85836 1.34 0.190 -15.3377 74.07305
Malistan | 88.19973 46.43968 1.90 0.068 -6.780067 183.1795
Markaz Behsud | 29.30568 13.08261 2.24 0.033 2.548731 56.06263
Miramoor | 78.6247 18.00107 4.37 0.000 41.80838 115.441
Nahor | 92.51837 29.796 3.11 0.004 31.57871 153.458
Panjab | 21.75951 26.68676 0.82 0.422 -32.82105 76.34007
Roy do Ab | 54.42585 42.86992 1.27 0.214 -33.25297 142.1047
Shahristan | 63.03825 19.94752 3.16 0.004 22.24099 103.8355
Shikh Ali | -22.67487 49.27363 -0.46 0.649 -123.4508 78.10102
Waras | 32.82089 74.72315 0.44 0.664 -120.0051 185.6469
Yakawlang | 42.0939 31.28532 1.35 0.189 -21.89176 106.0796
|
schoolid |
150300010 | 0 (base)
150300019 | -2.587977 9.719837 -0.27 0.792 -22.46727 17.29132
150300026 | -50.20644 16.52537 -3.04 0.005 -84.00462 -16.40826
150500016 | 0 (omitted)
260300005 | 0 (omitted)
260400001 | -39.13052 12.62379 -3.10 0.004 -64.94907 -13.31196
260400002 | 0 (omitted)
270700022 | 39.37137 49.03798 0.80 0.429 -60.92255 139.6653
270700048 | 0 (omitted)
280400012 | -27.75334 25.84329 -1.07 0.292 -80.6088 25.10212
280400018 | 0 (omitted)
280500003 | -8.935647 20.8451 -0.43 0.671 -51.56866 33.69736
280500036 | 0 (omitted)
280600047 | 0 (omitted)
306000018 | 0 (omitted)
340600022 | 0 (omitted)
340700013 | -59.99781 28.1416 -2.13 0.042 -117.5538 -2.441779
340700028 | 0 (omitted)
340900024 | 0 (omitted)
402000012 | -41.6524 500.2204 -0.08 0.934 -1064.718 981.4132
402000019 | 0 (omitted)
404000010 | 25.18661 32.97342 0.76 0.451 -42.2516 92.62483
404000033 | -11.6825 25.76335 -0.45 0.654 -64.37447 41.00947
404000035 | -57.97151 64.91141 -0.89 0.379 -190.7302 74.78724
404000043 | -59.23479 55.16953 -1.07 0.292 -172.0692 53.59958
404000073 | 0 (omitted)
405000008 | 0 (omitted)
604000098 | -27.83934 46.96004 -0.59 0.558 -123.8834 68.20473
604000103 | 0 (omitted)
606000070 | 0 (omitted)
|
progyear |
2014 | 0 (base)
2015 | -9.260804 14.20829 -0.65 0.520 -38.32003 19.79842
2016 | 3.898195 16.14454 0.24 0.811 -29.12109 36.91748
2017 | 0 (omitted)
|
_cons | 139.4757 43.84943 3.18 0.003 49.79359 229.1579
---------------------------------------------------------------------------------------------
Please take a look at the coefficient on t (the treatment indicator), why would changing the order of factor variables change the results. Is it not supposed to satisfy the additive property? Or am I missing something?
Comment