David Eschweiler
asreg does not support weights at the moment.
asreg does not support weights at the moment.
quietly { gen double indmun=. gen double inddyn=. * don't use -sum()- (undocumented since Stata 9) bysort sic fyear : egen double indsales = total(sale) by sic fyear : gen int indcount=_n tempname indmean forvalues industry=01/12 { local i : di %02.0f `industry' forvalues curyear=1980/2010 { summarize sale if sic=="`i'" & inrange(fyear, `curyear' - 4, `curyear'), meanonly scalar `indmean' = r(mean) regress indsales fyear if sic=="`i'" & inrange(fyear, `curyear' - 4, `curyear') & indcount==1, vce(r) replace indmun = _b[fyear] / `indmean' if sic=="`i'" & fyear==`curyear' replace inddyn = _se[fyear] / `indmean' if sic=="`i'" & fyear==`curyear' } } }
summarize sale if sic=="`i'" & inrange(fyear, `curyear' - 4, `curyear'), meanonly if r(N) > 1 { scalar `indmean' = r(mean) regress indsales fyear if sic=="`i'" & inrange(fyear, `curyear' - 4, `curyear') & indcount==1, vce(r) replace indmun = _b[fyear] / `indmean' if sic=="`i'" & fyear==`curyear' replace inddyn = _se[fyear] / `indmean' if sic=="`i'" & fyear==`curyear' }
quietly { gen double indmun=. gen double inddyn=. * don't use -sum()- (undocumented since Stata 9) bysort sic_d fyear : egen double indsales = total(sale) by sic_d fyear : gen int indcount=_n tempname indmean forvalues i=1/12 { forvalues curyear=1980/2010 { summarize sale if sic_d==`i' & inrange(fyear, `curyear' - 4, `curyear'), meanonly if r(N) > 1 { scalar `indmean' = r(mean) regress indsales fyear if sic_d==`i' & inrange(fyear, `curyear' - 4, `curyear') & indcount==1, vce(r) replace indmun = _b[fyear] / `indmean' if sic_d==`i' & fyear==`curyear' replace inddyn = _se[fyear] / `indmean' if sic_d==`i' & fyear==`curyear' } } } }
_Nobs | _R2 | _adjR2 | _b_gfc | _b_cpiinflation | _b_ex_ln | _b_outputgap | _b_cons |
. | . | . | . | . | . | . | . |
. | . | . | . | . | . | . | . |
. | . | . | . | . | . | . | . |
. | . | . | . | . | . | . | . |
. | . | . | . | . | . | . | . |
6 | -1.14E-13 | 0 | -1.16E-10 | 9.10E-13 | 9.5 | ||
7 | 0 | 0 | 2.91E-11 | 0 | 9.5 | ||
8 | 0 | 0 | 0 | 0 | 9.5 | ||
9 | 0 | 0 | 0 | 5.68E-14 | 9.5 | ||
10 | 0 | 0 | 9.10E-13 | 0 | 9.5 | ||
11 | -3.55E-15 | 0 | 0 | 3.55E-15 | 9.5 | ||
12 | -8.88E-16 | 0 | -9.10E-13 | 3.55E-15 | 9.5 | ||
13 | 4.44E-16 | 0 | -4.55E-13 | 0 | 9.5 | ||
14 | 1.39E-17 | 0 | 0 | 0 | 9.5 | ||
15 | 3.55E-15 | 0 | 0 | 3.55E-15 | 9.5 | ||
15 | 3.55E-15 | 0 | -2.27E-13 | 3.55E-15 | 9.5 | ||
15 | 0.57158481 | 0.4547443 | -0.5949871 | 0 | 17.013916 | -0.8415596 | -15.058147 |
15 | 0.67449925 | 0.58572632 | 0.07154758 | 0 | 19.157318 | -0.8017373 | -18.6109 |
15 | 0.75565307 | 0.68901299 | -0.038887 | 0 | 21.698423 | -0.8302239 | -22.609611 |
15 | 0.81294023 | 0.76192392 | -0.1736552 | 0 | 24.240944 | -0.8290036 | -27.00011 |
15 | 0.84876895 | 0.80752412 | -0.1587135 | 0 | 25.290433 | -0.9173466 | -29.078082 |
15 | 0.87536891 | 0.84137862 | -0.0433958 | 0 | 26.486147 | -0.9977948 | -31.588413 |
15 | 0.9058569 | 0.88018151 | 0.01865548 | 0 | 27.644144 | -1.2697714 | -34.196145 |
15 | 0.92468799 | 0.90414836 | 0.06770972 | 0 | 27.385615 | -1.4162443 | -34.279654 |
15 | 0.93796095 | 0.92104121 | 0.06605368 | 0 | 26.001546 | -1.6653594 | -31.422473 |
15 | 0.86956058 | 0.83398619 | 0.14156781 | 0 | 23.343965 | -1.2346861 | -26.792364 |
15 | 0.76071796 | 0.69545922 | 0.17696004 | 0 | 20.424027 | -1.0653102 | -21.314451 |
15 | 0.61998184 | 0.51634052 | 0.16265453 | 0 | 16.405722 | -1.2292738 | -12.935763 |
15 | 0.47588814 | 0.33294854 | 0.05461825 | 0 | 12.551712 | -1.3845503 | -4.1147822 |
15 | 0.2774562 | 0.0803988 | -0.0420422 | 0 | 8.4163467 | -1.0194785 | 6.2416644 |
15 | 0.09098482 | -0.1569284 | -0.1745475 | 0 | 1.1061531 | -0.3376111 | 25.246986 |
15 | 0.09001539 | -0.1581622 | -0.1568791 | 0 | 1.7089324 | -0.2492659 | 23.751656 |
15 | 0.10733139 | -0.1361237 | -0.3230389 | 0 | 1.1345878 | -0.1792229 | 25.099124 |
15 | 0.33269165 | 0.15069846 | -0.2819006 | 0 | 5.5779585 | -0.6825067 | 14.222327 |
15 | 0.60416234 | 0.49620662 | 0.52108639 | 0 | 19.738484 | -1.5661441 | -22.344993 |
15 | 0.70282334 | 0.62177516 | -0.0934901 | 0 | 20.879848 | -1.4431357 | -25.717625 |
15 | 0.80732218 | 0.75477368 | -0.264455 | 0 | 26.188266 | -1.587023 | -41.526525 |
15 | 0.87953144 | 0.84667637 | 0.12671152 | 0 | 31.331196 | -1.8803631 | -57.017177 |
15 | 0.93054224 | 0.91159922 | 0.16418257 | 0 | 35.649422 | -1.7035194 | -70.749674 |
15 | 0.89404824 | 0.86515231 | -0.1491169 | 0 | 33.063561 | -1.0927707 | -65.205697 |
Comment