* * Example 11.3 * J. Wooldridge, Econometrics of Cross Section and Panel Data * * Note: The sample data files include all required data transformations. * However, in many cases we show how these data transformations would * be created in RATS from the basic data, as this is something you will * need to know how to do in practice. * * cal(panelobs=7) 1981 open data cornwell.raw data(org=columns,format=free) 1//1981:1 90//1987:1 $ county year crmrte prbarr prbconv prbpris avgsen polpc $ density taxpc west central urban pctmin80 wcon wtuc $ wtrd wfir wser wmfg wfed wsta wloc mix $ pctymle d82 d83 d84 d85 d86 d87 lcrmrte $ lprbarr lprbconv lprbpris lavgsen lpolpc ldensity ltaxpc lwcon $ lwtuc lwtrd lwfir lwser lwmfg lwfed lwsta lwloc $ lmix lpctymle lpctmin clcrmrte clprbarr clprbcon clprbpri clavgsen $ clpolpc cltaxpc clmix * * Example 11.3 * This uses FD-IV for a single time period * instruments constant lcrmrte{2 3} set smpl = %period(t)==1987:1 linreg(instruments,smpl=smpl) clcrmrte # constant clcrmrte{1} * * This uses all available data points, and all lags, with fixed weights for each * lag across t. (Not included in text). * compute n=7 dec vect[series] flags(n-2) do i=n-1,2,-1 set flags(i-1) = %if(%period(t)<=i,0.0,lcrmrte{i}) end do i instruments constant flags linreg(instruments,optimalweights,lwindow=panel) clcrmrte # constant clcrmrte{1} * * All available data points, all lags, with varying weights across t * (Arellano-Bond). * dec vect[series] ablags((n-2)*(n-1)/2) compute fill=1 do period=n,3,-1 do lag=period-1,2,-1 set ablags(fill) = %if(%period(t)==period,lcrmrte{lag},0.0) compute fill=fill+1 end do lag end do period * * The overidentification test is included in the regression output. * instrument constant ablags linreg(title="Arellano-Bond",instruments,optimalweights,lwindow=panel) clcrmrte # constant clcrmrte{1}