Examples / ARELLANO.RPF |
ARELLANO.RPF uses the Arellano-Bond estimator for dynamic panel models, in particular, uses the @ABLAGS procedure to generate instruments.
This is based upon Example 11.3 from Wooldridge (2010). It estimates an autoregression on panel data (seven years of data for 90 counties) for the log of the crime rate. Because of the lagged dependent variable, a fixed effects estimator will have substantial bias with \(T\) being this small, as will the first difference estimator. The model is estimated using the GMM estimator of Arellano and Bond (1991). This is an IV estimator on the first differenced data using all available instruments for all potential lags.
cal(panelobs=7) 1981
all 90//1987:1
open data cornwell.prn
data(org=columns,format=prn) / county year crmrte
Transform to log first differences
set lcrmrte = log(crmrte)
diff lcrmrte / clcrmrte
The regression equation is the first difference of the log crime rate on its lag. First differencing eliminates the individual county effect, but almost certainly produces serially correlated residuals, and thus, OLS would give inconsistent estimates because of the lagged dependent variable. The first set of estimates does instrumental variables using the second and third lags of the log crime rate as instruments. (The first lag still has a correlation with the residual). This is just run over one observation per individual (the final one) to avoid having to correct the covariance matrix for serial correlation.
instruments constant lcrmrte{2 3}
set smpl = %period(t)==1987:1
linreg(instruments,smpl=smpl) clcrmrte
# constant clcrmrte{1}
This checks the first stage regression (to see whether there is sufficient correlation between the instrument and the explanatory variable):
set cllag = clcrmrte{1}
linreg(smpl=smpl) cllag
# constant lcrmrte{2 3}
The lags tend to be rather weak instruments, and using a standard instrument setup will severely restrict the number of data points or instruments which could be used. A different approach is to create a separate instrument for each lag and for each time period and use GMM to weight them. This is the Arellano-Bond estimator. The instruments need to be constructed. This shows how do to this, however, you could more simply use the procedure @ABLags: the code below is the equivalent of @ABLags lcrmrte abivs
compute m=7
dec vect[series] abivs((m-2)*(m-1)/2)
compute fill=1
do period=m,3,-1
do lag=period-1,2,-1
set abivs(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 abivs
linreg(title="Arellano-Bond",$
instruments,optimalweights,lwindow=panel) clcrmrte
# constant clcrmrte{1}
Full Program
cal(panelobs=7,a) 1981
all 90//1987:1
open data cornwell.prn
data(org=columns,format=prn) 1//1981:1 90//1987:1 county year crmrte
*
* Transform to log first differences
*
set lcrmrte = log(crmrte)
diff lcrmrte / clcrmrte
*
* The regression equation is 1st difference of the log crime rate on its
* lag. First differencing eliminates the individual county effect, but
* almost certainly produces serially correlated residuals, and thus, OLS
* would give inconsistent estimates because of the lagged dependent
* variable. The first set of estimates does instrumental variables using
* the second and third lags of the log crime rate as instruments. (The
* first lag still has a correlation with the residual). This is just run
* over one observation per individual (the final one) to avoid having to
* correct the covariance matrix for serial correlation.
*
instruments constant lcrmrte{2 3}
set smpl = %period(t)==1987:1
linreg(instruments,smpl=smpl) clcrmrte
# constant clcrmrte{1}
*
* Check 1st stage regression
*
set cllag = clcrmrte{1}
linreg(smpl=smpl) cllag
# constant lcrmrte{2 3}
*
* The lags tend to be rather weak instruments, and using a standard
* instrument setup will severely restrict the number of data points or
* instruments which could be used.
*
* A different approach is to create a separate instrument for each lag
* and for each time period and use GMM to weight them. This is the
* Arellano-Bond estimator. The instruments need to be constructed. This
* shows do to this, however, you could more simply use the procedure
* ABLags
*
* @ABLags lcrmrte abivs
*
compute m=7
dec vect[series] abivs((m-2)*(m-1)/2)
compute fill=1
do period=m,3,-1
do lag=period-1,2,-1
set abivs(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 abivs
linreg(title="Arellano-Bond",$
instruments,optimalweights,lwindow=panel) clcrmrte
# constant clcrmrte{1}
Output
Linear Regression - Estimation by Instrumental Variables
Dependent Variable CLCRMRTE
Panel(7) of Annual Data From 1//1984:01 To 90//1987:01
Usable Observations 90
Degrees of Freedom 88
Skipped/Missing (from 627) 537
Mean of Dependent Variable 0.0771255592
Std Error of Dependent Variable 0.2392311262
Standard Error of Estimate 0.2650173161
Sum of Squared Residuals 6.1806076509
J-Specification(1) 6.0166
Significance Level of J 0.0141716
Durbin-Watson Statistic 1.8228
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 0.0646353084 0.0404451671 1.59810 0.11360603
2. CLCRMRTE{1} 0.2124021377 0.4973709506 0.42705 0.67038614
Linear Regression - Estimation by Least Squares
Dependent Variable CLLAG
Panel(7) of Annual Data From 1//1984:01 To 90//1987:01
Usable Observations 90
Degrees of Freedom 87
Skipped/Missing (from 627) 537
Centered R^2 0.0832825
R-Bar^2 0.0622085
Uncentered R^2 0.1599705
Mean of Dependent Variable 0.0588047321
Std Error of Dependent Variable 0.1957140369
Standard Error of Estimate 0.1895287572
Sum of Squared Residuals 3.1251400346
Regression F(2,87) 3.9519
Significance Level of F 0.0227638
Log Likelihood 23.5104
Durbin-Watson Statistic 2.3948
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 0.053248531 0.128751326 0.41358 0.68020194
2. LCRMRTE{2} -0.261602690 0.093973226 -2.78380 0.00659027
3. LCRMRTE{3} 0.259826904 0.094871817 2.73872 0.00748073
Linear Regression - Estimation by Arellano-Bond
Dependent Variable CLCRMRTE
Panel(7) of Annual Data From 1//1982:01 To 90//1987:01
Usable Observations 450
Degrees of Freedom 448
Skipped/Missing (from 629) 179
Mean of Dependent Variable 0.0033551300
Std Error of Dependent Variable 0.2115307164
Standard Error of Estimate 0.2365135653
Sum of Squared Residuals 25.060522629
J-Specification(14) 36.0662
Significance Level of J 0.0010199
Durbin-Watson Statistic 2.7988
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 0.0076650715 0.0034051150 2.25105 0.02438261
2. CLCRMRTE{1} 0.3912561312 0.0982760086 3.98120 0.00006857
Copyright © 2024 Thomas A. Doan