Newey-West correction of standard errors for heteroscedasticity and autocorrelation


SAS/ETS procedures PROC MODEL and PROC AUTOREG both provide the functionality to specify Newey-West heteroscedasticity and autocorrelation standard error correction.

PROC MODEL provides the KERNEL= option with the GMM estimator in the FIT statement to correct standard errors for heteroscedasticity and autocorrelation. The procedure supports three different kernels — Bartlett, Parzen, and Quadratic.

The general form of the KERNEL= option is

KERNEL=( PARZEN | QS | BART, ce )

where c and e are nonnegative values used to compute the bandwidth parameter

l(n) = cne

The Newey-West standard error correction is a commonly used heteroscedasticity and autocorrelation correction. The formula for the Newey-West covariance matrix estimator can be found in Greene (2000). The Newey-West estimator corresponds to the Bartlett kernel with bandwidth parameter L+1, where L is the maximum lag length. To specify the Newey-West kernel with lag length L using PROC MODEL, specify KERNEL=(BART, L+1, 0), which produces bandwidth parameter

l(n) = (L+1)n0 = L+1

For more details on the three kernels supported in PROC MODEL, see "Estimation Methods" in the Details section of the PROC MODEL documentation.

PROC AUTOREG provides the COVEST=HAC and COVEST=NEWEYWEST options in the MODEL statement to specify heteroscedasticity and autocorrelation correction. The COVEST=HAC option supports the following kernels with the KERNEL= option: BARTLETT, PARZEN, QUADRATICSPECTRAL, TRUNCATED, and TUKEYHANNING. To obtain the Newey-West covariance matrix estimator with maximum lag length L, specify the BARTLETT kernel with fixed value L+1 for the bandwidth parameter using COVEST=HAC(KERNEL=BARTLETT, BANDWIDTH=L+1). Alternatively, specify COVEST=NEWEYWEST(GAMMA=0, RATE=0, CONSTANT=L+1), where the bandwidth parameter is calculated as

        b =  [GAMMA*TRATE+CONSTANT], where [x] denotes the largest integer less than or equal to x, and T is the sample size.

For more details on the COVEST=HAC and COVEST=NEWEYWEST options, see "MODEL Statement" in the Syntax section in the PROC AUTOREG documentation.

Example 1. Newey-West standard error correction for OLS estimates

These data are presented in Example 13.1 in Greene (2004). These statements create data set ONE with variables containing data on GNP, investment, price index, and nominal interest rate.

data one;
   input gnp invest price interest;
   year=_n_+1962;
datalines;
596.7  90.9 0.7167  3.23
637.7  97.4 0.7277  3.55
691.1 113.5 0.7436  4.04
756.0 125.7 0.7676  4.5
799.6 122.8 0.7906  4.19
873.4 133.3 0.8254  5.16
944.0 149.3 0.8679  5.87
992.7 144.2 0.9145  5.95
1077.6 166.4 0.9601  4.88
1185.9 195   1       4.5
1326.4 229.8 1.0575  6.44
1434.2 228.7 1.1508  7.83
1549.2 206.1 1.2579  6.25
1718   257.9 1.3234  5.5
1918.3 324.1 1.4005  5.46
2163.9 386.6 1.5042  7.46
2417.8 423   1.6342 10.28
2631.7 401.9 1.7842 11.77
2954.1 474.9 1.9514 13.42
3073.0 414.5 2.0688 11.02
;

These steps create and display the real variables used in the regression analysis. Real GNP and real investment are obtained by dividing the nominal figures by the price index. An approximation to the real interest rate is obtained by subtracting the rate of change in the price index from the interest rate.

data two;
   set one;
   r_gnp=gnp/price;                          /*  Real GNP                 */
   r_invest=invest/price;                    /*  Real Investment          */
   rate=((price-lag(price))/lag(price))*100; /*  Price index change rate  */
   r_int=interest-rate;                      /*  Real Interest Rate       */
   if r_int=. then delete;
   label r_gnp="Real GNP"
         r_invest="Real Investment"
         r_int="Real Interest Rate";
run;
proc print data=two noobs label;
   var r_invest r_gnp r_int;
run;
 
 
Real InvestmentReal GNPReal Interest Rate
152.64929.41.85503
163.76984.891.27246
155.331011.41.19365
161.51058.20.75828
172.021087.70.72098
157.681085.50.58072
173.321122.4-0.10633
1951185.90.34418
217.311254.30.69
198.731246.3-0.9927
163.851231.6-3.05657
194.881298.20.29291
231.421369.7-0.3659
257.011438.60.0555
258.841479.51.63753
225.2614752.5912
243.361513.84.04885
200.361485.45.00381
 
 
These statements regress real investment on real interest rate and real GNP using ordinary least squares (OLS) using PROC MODEL.
 
 proc model data=two;
     parms b0 b1 b2;
     r_invest=b0 + b1*r_int + b2*r_gnp;
     fit r_invest;
 run;
 quit;
 

The parameter estimates and the uncorrected standard errors from the model are shown below.

Nonlinear OLS Parameter Estimates
ParameterEstimateApprox Std Errt ValueApprox Pr > |t|
b0-12.533624.915-0.50.6218
b1-1.001442.3687-0.420.6781
b20.169140.02068.22<.0001

 

To perform Newey-West standard error correction, PROC MODEL is run again specifying the GMM estimation method in the FIT statement. KERNEL=(BART, 5, 0) is also specified which requests the Bartlett kernel with a lag length of 4. The VARDEF=n option is specified to be consistent with the original Newey-West formula.

proc model data=two;
   endo r_invest;
   exog r_int r_gnp;
   instruments _exog_;
   parms b0 b1 b2;
   r_invest=b0 + b1*r_int + b2*r_gnp;
   fit r_invest / gmm kernel=(bart,5,0) vardef=n;
run;
quit; 
 

The parameter estimates and the Newey-West corrected standard errors from the above analysis appear below. Note that with GMM estimation, when the instruments used are all the exogenous variables in the OLS regression model, then the parameter estimates are identical to the OLS estimates. The results are consistent with table 13.2 in Greene (2000).

 

Nonlinear GMM Parameter Estimates
ParameterEstimateApprox Std Errt ValueApprox
Pr > |t|
b0-12.533618.958-0.660.5179
b1-1.001443.3424-0.30.7683
b20.169140.016810.1<.0001

 

In the above example, the lag length of 4 is chosen to be the same as in Greene (2000). Neither PROC MODEL nor PROC AUTOREG provides an option to determine the maximum lag length in Newey West correction. Greene (2000) contains this discussion about choosing the maximum lag length:

"The maximum lag L must be determined in advance to be large enough that autocorrelations at lags longer than L are small enough to ignore. For a moving-average process, this can be expected to be a relatively small number. For autoregressive process or mixtures, however, the autocorrelations are never zero, and the researcher must make a judgment as to how far back it is necessary to go."

To specify the Newey-West standard error correction using PROC AUTOREG, either one of the following steps can be used. The same results are obtained as those produced in PROC MODEL:

proc autoreg data=two;
   model r_invest = r_int r_gnp / covest=hac(kernel=bartlett, bandwidth=5);
run;      

or

proc autoreg data=two; 
   model r_invest = r_int r_gnp / covest=neweywest(gamma=0,rate=0,constant=5);
run;

Example 2. Newey-West standard error correction for the sample mean of a series

To obtain the Newey-West standard error correction for the sample mean of a series, fit an intercept-only model to the series. The estimated intercept is the sample mean, and the Newey-West standard error correction can be obtained as in Example 1.

The following PROC MEANS step computes the sample mean of the variable R_INVEST.

proc means data=two mean;
   var r_invest;
run;
 

 

Analysis Variable : r_invest Real Investment
Mean
192.4258285
 
 
These statements fit an intercept-only model to the real investment series and perform the Newey-West standard error correction on the sample mean. The intercept-only model is specified by fitting the equation R_INVEST=B0. The INTONLY option in the INSTRUMENTS statement indicates that the only instrument used in the estimation is the intercept.
 
proc model data=two;
   endo r_invest;
   instruments / intonly;
   parms b0;
   r_invest=b0;
   fit r_invest / gmm kernel=(bart,5,0) vardef=n;
run;
quit;

 

The parameter estimates and the standard errors appear below. The B0 parameter estimate is the sample mean of the R_INVEST series. The reported standard errors are Newey-West corrected standard errors for the B0 estimate.

 

Nonlinear GMM Parameter Estimates
ParameterEstimateApprox Std Errt ValueApprox
Pr > |t|
b0192.42614.85412.95<.0001

 

The same results can be obtained using the AUTOREG procedure with either the COVEST=HAC option or the COVEST=NEWEYWEST option:

proc autoreg data=two;
   model r_invest = / covest=hac(kernel=bartlett, bandwidth=5);
run;         

or

proc autoreg data=two ;
   model r_invest = /covest=neweywest(gamma=0, rate=0, constant=5);
run;

____

Greene, William H. (2000), Econometric Analysis, Fourth Edition, Upper Saddle River, NJ: Prentice-Hall.