Dear Stata community,
I'm currently analyzing whether capital controls affect economic development of countries in different ways for different levels of income. To differentiate countries I use the World Bank categorization (low, lower middle, upper middle, high income). I want to capture year specific effects and country effects so I use fixed effects.
The data includes 100 countries and 22 years and looks like this:
I thought of running the regression in two ways: first, by including interaction effects like this:
Second, by splitting the sample like this:
However, when I run these regressions I get very different results, which I don't understand. Here are the results of the first regression:
Here are the results of the regression for the low income sample, which is the base group of the previous regression.
I thought the constant and the coefficient should be the same for the second regression and the base level of the first regression. However, as you can see they are completely different. This is the same for the other income groups, which I won't post here due to space. I'm not sure now which results I should trust. I would be very grateful if someone could tell me what I'm missing.
I'm currently analyzing whether capital controls affect economic development of countries in different ways for different levels of income. To differentiate countries I use the World Bank categorization (low, lower middle, upper middle, high income). I want to capture year specific effects and country effects so I use fixed effects.
The data includes 100 countries and 22 years and looks like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long country2 int year double ka float loggdppc long incgroup_th 1 1995 1 9.137277 2 1 1996 .75 9.160067 2 1 1997 1 9.154971 2 1 1998 .75 9.189805 2 1 1999 .75 9.207232 2 end label values country2 country2 label def country2 1 "Algeria", modify label values incgroup_th incomegroup5 label def incomegroup5 2 "Lower Middle Income", modify
Code:
xtreg loggdppc c.L.ka##I.incgroup_th I.year, fe
Code:
xtreg loggdppc L.ka I.year if incgroup_th==1, fe xtreg loggdppc L.ka I.year if incgroup_th==2, fe xtreg loggdppc L.ka I.year if incgroup_th==3, fe xtreg loggdppc L.ka I.year if incgroup_th==4, fe
Code:
. xtreg loggdppc c.L.ka##I.incgroup_th I.year, fe
Fixed-effects (within) regression Number of obs = 2,094
Group variable: country2 Number of groups = 100
R-sq: Obs per group:
within = 0.6439 min = 17
between = 0.9173 avg = 20.9
overall = 0.5815 max = 21
F(27,1967) = 131.72
corr(u_i, Xb) = 0.6650 Prob > F = 0.0000
--------------------------------------------------------------------------------------
loggdppc | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---------------------+----------------------------------------------------------------
ka |
L1. | -.0403811 .0397236 -1.02 0.309 -.118286 .0375237
|
incgroup_th |
Lower Middle Income | .1457912 .0257779 5.66 0.000 .0952363 .196346
Upper Middle Income | .3751304 .0319848 11.73 0.000 .3124027 .4378582
High Income | .4449389 .0383314 11.61 0.000 .3697644 .5201134
|
incgroup_th#cL.ka |
Lower Middle Income | .0749596 .0360304 2.08 0.038 .0042979 .1456214
Upper Middle Income | -.0360145 .0431999 -0.83 0.405 -.1207369 .0487079
High Income | -.0693851 .0488317 -1.42 0.156 -.1651525 .0263823
|
year |
1997 | .018742 .0167662 1.12 0.264 -.0141394 .0516234
1998 | .029583 .0167891 1.76 0.078 -.0033433 .0625093
1999 | .0418188 .016792 2.49 0.013 .0088868 .0747507
2000 | .0743435 .0167547 4.44 0.000 .0414846 .1072024
2001 | .0902911 .016751 5.39 0.000 .0574395 .1231427
2002 | .1016007 .0167662 6.06 0.000 .0687192 .1344821
2003 | .1296795 .0167714 7.73 0.000 .096788 .162571
2004 | .1620865 .0168044 9.65 0.000 .1291302 .1950429
2005 | .1879397 .0168483 11.15 0.000 .1548972 .2209821
2006 | .2263145 .0168752 13.41 0.000 .1932195 .2594096
2007 | .2638747 .0169032 15.61 0.000 .2307246 .2970249
2008 | .264955 .0170949 15.50 0.000 .2314291 .298481
2009 | .2463653 .0170868 14.42 0.000 .212855 .2798755
2010 | .2712964 .0171339 15.83 0.000 .2376938 .3048989
2011 | .2974869 .0171138 17.38 0.000 .2639237 .3310501
2012 | .3036946 .0172869 17.57 0.000 .269792 .3375973
2013 | .3215378 .0173358 18.55 0.000 .2875393 .3555364
2014 | .3400188 .0173641 19.58 0.000 .3059649 .3740727
2015 | .3602189 .0173665 20.74 0.000 .3261602 .3942775
2016 | .3808082 .017317 21.99 0.000 .3468465 .4147699
|
_cons | 8.994969 .030888 291.21 0.000 8.934392 9.055545
---------------------+----------------------------------------------------------------
sigma_u | .96225507
sigma_e | .11780779
rho | .98523252 (fraction of variance due to u_i)
--------------------------------------------------------------------------------------
F test that all u_i=0: F(99, 1967) = 209.90 Prob > F = 0.0000
Code:
. xtreg loggdppc L.ka I.year if incgroup_th==1, fe
Fixed-effects (within) regression Number of obs = 301
Group variable: country2 Number of groups = 25
R-sq: Obs per group:
within = 0.7095 min = 1
between = 0.4164 avg = 12.0
overall = 0.0050 max = 21
F(21,255) = 29.66
corr(u_i, Xb) = -0.4428 Prob > F = 0.0000
------------------------------------------------------------------------------
loggdppc | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ka |
L1. | .2355757 .0572047 4.12 0.000 .1229219 .3482295
|
year |
1997 | .0419334 .0341734 1.23 0.221 -.0253646 .1092314
1998 | .0661726 .0350231 1.89 0.060 -.0027988 .135144
1999 | .0856925 .035103 2.44 0.015 .0165638 .1548213
2000 | .099322 .0341923 2.90 0.004 .0319868 .1666573
2001 | .1287047 .0341876 3.76 0.000 .0613788 .1960306
2002 | .150422 .0351686 4.28 0.000 .081164 .2196799
2003 | .1780879 .0350638 5.08 0.000 .1090364 .2471394
2004 | .217291 .0360973 6.02 0.000 .1462043 .2883778
2005 | .2722467 .037468 7.27 0.000 .1984605 .3460329
2006 | .3210197 .0375514 8.55 0.000 .2470694 .39497
2007 | .3702423 .0375416 9.86 0.000 .2963114 .4441733
2008 | .4095371 .0453309 9.03 0.000 .3202665 .4988078
2009 | .4345497 .0451828 9.62 0.000 .3455708 .5235286
2010 | .4641847 .0450854 10.30 0.000 .3753976 .5529718
2011 | .5113764 .0450854 11.34 0.000 .4225894 .6001635
2012 | .5211868 .0526365 9.90 0.000 .4175292 .6248443
2013 | .5580252 .0526365 10.60 0.000 .4543677 .6616828
2014 | .5769499 .0566277 10.19 0.000 .4654323 .6884675
2015 | .6101766 .0566277 10.78 0.000 .498659 .7216942
2016 | .6404074 .0566277 11.31 0.000 .5288898 .751925
|
_cons | 7.264662 .0459164 158.22 0.000 7.174238 7.355086
-------------+----------------------------------------------------------------
sigma_u | .53813001
sigma_e | .11135118
rho | .95894112 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(24, 255) = 209.43 Prob > F = 0.0000

Comment