Chapter Contents 
Previous 
Next 
The AUTOREG Procedure 
In the preceding section, it is assumed that the order of the autoregressive process is known. In practice, you need to test for the presence of autocorrelation.
The DurbinWatson test is a widely used method of testing for autocorrelation. The firstorder DurbinWatson statistic is printed by default. This statistic can be used to test for firstorder autocorrelation. Use the DWPROB option to print the significance level (pvalues) for the DurbinWatson tests. (Since the DurbinWatson pvalues are computationally expensive, they are not reported by default.)
You can use the DW= option to request higherorder DurbinWatson statistics. Since the ordinary DurbinWatson statistic only tests for firstorder autocorrelation, the DurbinWatson statistics for higherorder autocorrelation are called generalized DurbinWatson statistics. The following statements perform the DurbinWatson test for autocorrelation in the OLS residuals for orders 1 through 4. The DWPROB option prints the marginal significance levels (pvalues) for the DurbinWatson statistics.
proc autoreg data=a; model y = time / dw=4 dwprob; run;
The AUTOREG procedure output is shown in Figure 8.7. In this case, the firstorder DurbinWatson test is highly significant, with p < .0001 for the hypothesis of no firstorder autocorrelation. Thus, autocorrelation correction is needed.
Using the DurbinWatson test, you can decide if autocorrelation correction is needed. However, generalized DurbinWatson tests should not be used to decide on the autoregressive order. The higherorder tests assume the absence of lowerorder autocorrelation. If the ordinary DurbinWatson test indicates no firstorder autocorrelation, you can use the secondorder test to check for secondorder autocorrelation. Once autocorrelation is detected, further tests at higher orders are not appropriate. In Figure 8.7, since the firstorder DurbinWatson test is significant, the order 2, 3, and 4 tests can be ignored.
When using DurbinWatson tests to check for autocorrelation, you should specify an order at least as large as the order of any potential seasonality, since seasonality produces autocorrelation at the seasonal lag. For example, for quarterly data use DW=4, and for monthly data use DW=12.
For the Durbin htest, specify the name of the lagged dependent variable in the LAGDEP= option. For the Durbin ttest, specify the LAGDEP option without giving the name of the lagged dependent variable. For example, the following statements add the variable YLAG to the data set A and regress Y on YLAG instead of TIME.
data b; set a; ylag = lag1( y ); run; proc autoreg data=b; model y = ylag / lagdep=ylag; run;
The results are shown in Figure 8.8. The Durbin h statistic 2.78 is significant with a pvalue of .0027, indicating autocorrelation.

Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.