Hello, Stata users. This is my first time posting on this board. I will do my best to stick with the etiquette/format, but forgive me if I trip anything up this first time! Here we go...
I am running regressions on panel data consisting of data on 50 states over 26 years. We have three dependent variables of interest, and we are running the data over two separate time periods (1990 - 2007, 2008 - 2015).
Originally, I ran separate regressions for each of the above time periods, using year fixed-effects and state random effects within each of those models. See, for one of our dependent variables (budget cut):
We ran the same regressions, with the same predictors for taxnxt and taxch (our two additional dependent variables).
[Please note, we focused on random, instead of state fixed, effects because we have very little variation in our predictors of primary interest over time; our analysis mostly focuses on state budget institutions, like Balanced Budget Requirements, which may change only once or twice in our time period in a state, or not at all].
However, the above analysis does not permit me to evaluate whether differences in the coefficients for the same predictor are statistically significant across time periods. Moreover, it also does not allow me to understand whether coefficients are equal across regressions for different dependent variables (within the same time period).
The solution I have been experimenting with is two-pronged: 1) interact a time period dummy for the later period with my predictors, rather than running separate regressions (in order to see if differences are significant across time periods); and 2) Use the xtsur command (which I had to install separately) in order to test coefficient equality across regressions with the same predictors but different dependent variables.
See my code below (*tab3 refers to Table 3 that we are producing in our report, yrs08_15 is coded 1 for where years are >= 2008 and <=2015, so the earlier period is my base):
Now that I have given background (and pasted a data sample for reference, below), my questions are:
And the coefficients using the xtsur command with the yrs_08_15 time period dummy and interaction terms:
I am running regressions on panel data consisting of data on 50 states over 26 years. We have three dependent variables of interest, and we are running the data over two separate time periods (1990 - 2007, 2008 - 2015).
Originally, I ran separate regressions for each of the above time periods, using year fixed-effects and state random effects within each of those models. See, for one of our dependent variables (budget cut):
Code:
xtreg budcut surplus deficit i.year if yrs90_07 == 1, re
Code:
xtreg budcut surplus deficit i.year if yrs08_15 == 1, re
[Please note, we focused on random, instead of state fixed, effects because we have very little variation in our predictors of primary interest over time; our analysis mostly focuses on state budget institutions, like Balanced Budget Requirements, which may change only once or twice in our time period in a state, or not at all].
However, the above analysis does not permit me to evaluate whether differences in the coefficients for the same predictor are statistically significant across time periods. Moreover, it also does not allow me to understand whether coefficients are equal across regressions for different dependent variables (within the same time period).
The solution I have been experimenting with is two-pronged: 1) interact a time period dummy for the later period with my predictors, rather than running separate regressions (in order to see if differences are significant across time periods); and 2) Use the xtsur command (which I had to install separately) in order to test coefficient equality across regressions with the same predictors but different dependent variables.
See my code below (*tab3 refers to Table 3 that we are producing in our report, yrs08_15 is coded 1 for where years are >= 2008 and <=2015, so the earlier period is my base):
Code:
tsset statenum year local tab3 surplus deficit yrs08_15 yrs08_15_s yrs08_15_d xtsur (budcut `tab3') (taxch `tab3') (taxnxt `tab3') test [budcut]deficit=[taxch]deficit test [budcut]deficit=[taxnxt]deficit test [taxch]deficit=[taxnxt]deficit test [budcut]yrs08_15_d=[taxch]yrs08_15_d test [budcut]yrs08_15_d=[taxnxt]yrs08_15_d test [taxch]yrs08_15_d=[taxnxt]yrs08_15_d
- Coefficients with period dummies/interaction terms are different from those in the separate regressions with "if" option. Why? Is this a problem? Does it mean I did something wrong? Which set of coefficients should I be using?
Code:
. **buduct (1990 - 2007, 2008 - 2015) . xtreg budcut surplus deficit i.year if yrs90_07 == 1, re Random-effects GLS regression Number of obs = 882 Group variable: statenum Number of groups = 49 R-sq: Obs per group: within = 0.4886 min = 18 between = 0.1932 avg = 18.0 overall = 0.4705 max = 18 Wald chi2(19) = . corr(u_i, X) = 0 (assumed) Prob > chi2 = . ------------------------------------------------------------------------------ budcut | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- surplus | -.0040978 .0141333 -0.29 0.772 -.0317986 .0236031 deficit | -.2900718 .014915 -19.45 0.000 -.3193045 -.260839 | year | 1991 | 13.30751 5.815876 2.29 0.022 1.908598 24.70641 1992 | 8.742808 5.766725 1.52 0.129 -2.559765 20.04538 1993 | 3.654699 5.771098 0.63 0.527 -7.656445 14.96584 1994 | -5.663491 5.774264 -0.98 0.327 -16.98084 5.65386 1995 | -8.383182 5.771047 -1.45 0.146 -19.69423 2.927862 1996 | 2.802369 5.774908 0.49 0.627 -8.516242 14.12098 1997 | -7.144714 5.794108 -1.23 0.218 -18.50096 4.211529 1998 | -10.82781 5.831358 -1.86 0.063 -22.25706 .601446 1999 | -11.73361 5.782554 -2.03 0.042 -23.06721 -.4000122 2000 | -9.771238 5.818878 -1.68 0.093 -21.17603 1.633554 2001 | -7.159106 5.765843 -1.24 0.214 -18.45995 4.141738 2002 | 5.491668 6.012652 0.91 0.361 -6.292914 17.27625 2003 | 23.85425 5.771127 4.13 0.000 12.54305 35.16546 2004 | -1.867533 5.780371 -0.32 0.747 -13.19685 9.461786 2005 | -7.386509 5.825723 -1.27 0.205 -18.80472 4.031699 2006 | -8.363212 5.897161 -1.42 0.156 -19.92143 3.195011 2007 | -12.48453 5.810038 -2.15 0.032 -23.87199 -1.097061 2008 | 0 (empty) 2009 | 0 (empty) 2010 | 0 (empty) 2011 | 0 (empty) 2012 | 0 (empty) 2013 | 0 (empty) 2014 | 0 (empty) 2015 | 0 (empty) | _cons | 8.887196 4.224359 2.10 0.035 .6076039 17.16679 -------------+---------------------------------------------------------------- sigma_u | 4.7118651 sigma_e | 28.448286 rho | .02670053 (fraction of variance due to u_i) ------------------------------------------------------------------------------
Code:
tsset statenum year panel variable: statenum (strongly balanced) time variable: year, 1990 to 2015 delta: 1 year . xtsur (budcut surplus deficit yrs08_15 yrs08_15_s yrs08_15_d) (taxch sur > plus deficit yrs08_15 yrs08_15_s yrs08_15_d) (taxnxt surplus deficit yrs08_15 yr > s08_15_s yrs08_15_d) (running multi-step estimates...) Calculating multi-step estimates... Iteration 1 : relative difference = .63317634 Iteration 2 : relative difference = 8.828e-08 Seemingly unrelated regression (SUR) in panel data set One-way random effect estimation: ------------------------------------------------------------------------------ Number of Group variable: 1 Number of obs = 1274 Panel variable: statenum Number of eqn = 3 Time variable : year Number of panels = 1 Random effects u_i ~ Gaussian corr(u_i, e_it) = 0 (assumed) Panel type : strongly balanced ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- budcut | surplus | -.0219691 .014601 -1.50 0.132 -.0505866 .0066484 deficit | -.3325268 .0152926 -21.74 0.000 -.3624997 -.302554 yrs08_15 | 8.543416 2.578459 3.31 0.001 3.489729 13.5971 yrs08_15_s | -.023256 .0254981 -0.91 0.362 -.0732314 .0267193 yrs08_15_d | .0044566 .0229495 0.19 0.846 -.0405237 .0494368 -------------+---------------------------------------------------------------- taxch | surplus | -.0293486 .0071248 -4.12 0.000 -.043313 -.0153841 deficit | -.0944483 .0081384 -11.61 0.000 -.1103993 -.0784972 yrs08_15 | 2.690477 1.336243 2.01 0.044 .0714877 5.309466 yrs08_15_s | -.0398228 .0137497 -2.90 0.004 -.0667716 -.0128739 yrs08_15_d | .0554447 .0126783 4.37 0.000 .0305957 .0802938 -------------+---------------------------------------------------------------- taxnxt | surplus | -.156536 .0274122 -5.71 0.000 -.2102629 -.1028091 deficit | -.3364238 .0285285 -11.79 0.000 -.3923386 -.280509 yrs08_15 | 3.866633 4.818974 0.80 0.422 -5.578382 13.31165 yrs08_15_s | .0752939 .0474971 1.59 0.113 -.0177987 .1683865 yrs08_15_d | .1376033 .0426799 3.22 0.001 .0539523 .2212543 -------------+---------------------------------------------------------------- sigma_u | see e(sigma_u) sigma_e | see e(sigma_e) ------------------------------------------------------------------------------ Dependent variables: budcut taxch taxnxt Independent variables: surplus deficit yrs08_15 yrs08_15_s yrs08_15_d ------------------------------------------------------------------------------
- Include i.year or not? When I am including the yrs08_15 dummy and its interaction terms (above), should I continue to include i.year? I felt like this would produce some collinearity issues, but I wasn't able to get clarity on this.
- Is there a better way to do any of this? I am a fairly new Stata user who is in a bit over my head, so if I'm barking up the wrong tree for any of this, I'd love to hear any other thoughts.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str20 state float(surplus deficit yrs08_15 yrs08_15_s yrs08_15_d) "Alabama" 13.157997 0 0 0 0 "Alabama" 0 -40.19884 0 0 0 "Alabama" 0 -61.91863 0 0 0 "Alabama" 31.58817 0 0 0 0 "Alabama" 25.48999 0 0 0 0 "Alabama" 0 -27.230835 0 0 0 "Alabama" 10.891846 0 0 0 0 "Alabama" 1.0253906 0 0 0 0 "Alabama" 19.7511 0 0 0 0 "Alabama" 8.807983 0 0 0 0 "Alabama" 31.693726 0 0 0 0 "Alabama" 0 -77.03255 0 0 0 "Alabama" 0 -34.120426 0 0 0 "Alabama" .8310919 0 0 0 0 "Alabama" 70.21131 0 0 0 0 "Alabama" 137.1062 0 0 0 0 "Alabama" 142.87372 0 0 0 0 "Alabama" 0 -55.65601 0 0 0 "Alabama" 0 -52.31865 1 0 -52.31865 "Alabama" 0 -274.9464 1 0 -274.9464 "Alabama" 0 -348.9378 1 0 -348.9378 "Alabama" 0 -184.40778 1 0 -184.40778 "Alabama" 0 -85.58302 1 0 -85.58302 "Alabama" 28.27649 0 1 28.27649 0 "Alabama" 2.06958 0 1 2.06958 0 "Alabama" 0 -26.89168 1 0 -26.89168 "Arizona" 0 -19.32152 0 0 0 "Arizona" 0 -45.40803 0 0 0 "Arizona" 0 -33.57552 0 0 0 "Arizona" 36.428417 0 0 0 0 "Arizona" 54.77623 0 0 0 0 "Arizona" 111.43684 0 0 0 0 "Arizona" 121.54735 0 0 0 0 "Arizona" 138.7948 0 0 0 0 "Arizona" 12.6167 0 0 0 0 "Arizona" 39.49866 0 0 0 0 "Arizona" 19.673584 0 0 0 0 "Arizona" 0 -36.958984 0 0 0 "Arizona" 0 -313.314 0 0 0 "Arizona" 0 -97.19553 0 0 0 "Arizona" 80.49805 0 0 0 0 "Arizona" 179.80518 0 0 0 0 "Arizona" 162.70276 0 0 0 0 "Arizona" 0 -34.11145 0 0 0 "Arizona" 0 -152.5368 1 0 -152.5368 "Arizona" 0 -309.8741 1 0 -309.8741 "Arizona" 0 -43.05322 1 0 -43.05322 "Arizona" 75.935715 0 1 75.935715 0 "Arizona" 0 -87.68625 1 0 -87.68625 "Arizona" 71.50064 0 1 71.50064 0 "Arizona" 7.663818 0 1 7.663818 0 "Arizona" 24.932076 0 1 24.932076 0 "Arkansas" 0 0 0 0 0 "Arkansas" 0 -35.756756 0 0 0 "Arkansas" 0 -14.60597 0 0 0 "Arkansas" 0 -10.319755 0 0 0 "Arkansas" 0 0 0 0 0 "Arkansas" 0 -31.54308 0 0 0 "Arkansas" 0 -58.16742 0 0 0 "Arkansas" 60.38013 0 0 0 0 "Arkansas" 38.48828 0 0 0 0 "Arkansas" 36.84811 0 0 0 0 "Arkansas" 0 0 0 0 0 "Arkansas" 0 -3.8232265 0 0 0 "Arkansas" 0 -83.51202 0 0 0 "Arkansas" 0 -58.49155 0 0 0 "Arkansas" 0 -50.11287 0 0 0 "Arkansas" 1.229193 0 0 0 0 "Arkansas" 0 0 0 0 0 "Arkansas" 39.87108 0 0 0 0 "Arkansas" 0 -2.308497 1 0 -2.308497 "Arkansas" 0 -33.550426 1 0 -33.550426 "Arkansas" 0 -92.24941 1 0 -92.24941 "Arkansas" 2.0862823 0 1 2.0862823 0 "Arkansas" 0 0 1 0 0 "Arkansas" 0 0 1 0 0 "Arkansas" 0 0 1 0 0 "Arkansas" 0 0 1 0 0 "California" 0 -22.08824 0 0 0 "California" 0 -221.99594 0 0 0 "California" 0 -228.2866 0 0 0 "California" 0 -2.5009766 0 0 0 "California" 0 -64.57263 0 0 0 "California" 0 -1.4265137 0 0 0 "California" 12.701416 0 0 0 0 "California" 0 -10.180084 0 0 0 "California" 125.4822 0 0 0 0 "California" 47.2448 0 0 0 0 "California" 263.18307 0 0 0 0 "California" 0 -65.35864 0 0 0 "California" 0 -103.27151 0 0 0 "California" 0 -53.89476 0 0 0 "California" 0 -158.6883 0 0 0 "California" 130.44116 0 0 0 0 "California" 239.21268 0 0 0 0 "California" 40.99327 0 0 0 0 "California" 0 -25.69075 1 0 -25.69075 "California" 0 -598.88934 1 0 -598.88934 "California" 0 -168.44196 1 0 -168.44196 "California" 0 -197.9165 1 0 -197.9165 end
Comment