* * CHAPTER 10 * Page 352 * open data ch10_fatality.xls calendar(panelobs=7) 1982 data(format=xls,org=columns) 1//1982:1 48//1988:1 state year spircons unrate perinc emppop beertax $ sobapt mormon mlda dry yngdrv vmiles breath jaild comserd allmort mrall allnite mralln allsvn $ a1517 mra1517 a1517n mra1517n a1820 a1820n mra1820 mra1820n * * Generate transformations required now and later * set vfrall = 10000*mrall set incperc = perinc/1000 set lincperc = log(incperc) set vmilespd = vmiles/1000 set frmall = mrall/(vmiles/100000) set jailcom = jaild.or.comserd * * The drinking age dummies have these "bracket" definitions, because some states * had transition periods from lower drinking ages to 21 where the drinking age * was, for instance, 19 and a half. * set da18 = mlda<19 set da19 = mlda>=19.and.mlda<20 set da20 = mlda>=20.and.mlda<21 set da21 = mlda>=21 * * Figure 10.1 * spgraph(vfields=2,footer="Figure 10.1 The Traffic Fatality Rate and the Tax on Beer") * * Equation 10.2 * smpl(series=(year==1982)) linreg(robust) vfrall # constant beertax scatter(vmin=0.0,style=dots,lines=%beta,hlabel="(a) 1982 Data") # beertax vfrall smpl * * Equation 10.3 * smpl(series=(year==1988)) linreg(robust) vfrall # constant beertax scatter(vmin=0.0,style=dots,lines=%beta,hlabel="(a) 1988 Data") # beertax vfrall smpl * spgraph(done) * * Equation 10.8 * smpl(series=(year==1988)) set dvfrall = vfrall-vfrall{6} set dbeertax = beertax-beertax{6} * linreg(robust) dvfrall # constant dbeertax scatter(style=dots,lines=%beta,footer="Figure 10.2 Changes in Fatality Rates and Beer Taxes, 1982-1988") # dbeertax dvfrall smpl * * Equation 10.15 * The instruction PREG (Panel REGression) is used for specialized panel data * regressions. It's default behavior is to estimate regressions with fixed * individual effects. * preg vfrall # beertax * * Equation 10.21 * With EFFECTS=BOTH, PREG allows for both time and individual effects * preg(effects=both) vfrall # beertax * * Table 10.1 (pg 368) * * Column 1 * linreg(robust) vfrall # constant beertax * * Column 2 * preg(effects=indiv) vfrall # beertax * * Column 3 * Though we can get the point estimates as above using EFFECTS=BOTH on the PREG, * we'll add in the actual dummies instead, so we can get block exclusion tests on * them. We only need dummies for the first six years. This is the most flexible * way to generate a full set of dummies. You could also do "set d1982 = * year==1982", then copy and paste it five times and do a quick edit to fix the * lines for the different years. That might be the quickest way to get the job * done with just six years, though you wouldn't want to do it with thirty. * dec vect[series] ydum(6) do i=1,6 set ydum(i) = year==1981+i end do i * preg vfrall # beertax ydum exclude # ydum * * Column 4 * preg vfrall # beertax da18 da19 da20 jaild comserd vmilespd unrate lincperc ydum exclude ; # ydum exclude ; # da18 da19 da20 exclude ; # jaild comserd exclude ; # unrate lincperc * * Column 5 * preg vfrall # beertax da18 da19 da20 jaild comserd vmilespd ydum exclude ; # ydum exclude ; # da18 da19 da20 exclude ; # jaild comserd * * Column 6 * preg vfrall # beertax mlda jailcom vmilespd unrate lincperc ydum exclude ; # ydum exclude ; # unrate lincperc * * Column 7 * * RATS currently does not support clustered standard error on PREG *