Selecting Lag Length

The second consideration is the specification of lags for the ADF regressions. There are several ways to select lags and gretl automates one of these. The basic concept is to include enough lags in the ADF regressions to make the residuals white noise. These will be discussed presently.

The first strategy is to include just enough lags so that the last one is statistically significant. Gretl automates this using the —test-down option for the augmented Dickey-Fuller regressions. Start the ADF regressions with a generous number of lags and gretl automatically reduces that number until the t-ratio on the longest remaining lag is significant at the 10 percent level. For the levels series we choose the maximum number using Schwert’s method as discussed in chapter 12. The model includes a constant, trend, and trend squared (—ctt option), and use the —test-down option.

1 scalar mlag = int(12*(($nobs+1)/100)"(0.25))

2 adf mlag usa —ctt —test-down

3 adf mlag aus —ctt —test-down

The USA series contains a very long significant lag twelve periods into the past. The Australian series shows much less persistence, choosing only 3 in testing down from 12. The result is shown in Figure 13.2. Both ADF statistics are insignificant at the 5% or 10% level, indicating they are nonstationary. This is repeated for the differenced series using the commands:

adf mlag diff(usa) —ct —test-down adf mlag diff(aus) —ct —test-down

The selected lags for the U. S. and Australia are eleven and seven, respectively. Both ADF statistics are significant at the 5% level and we conclude that the differences are stationary.

Testing Up

The other strategy is to test the residuals from the augmented Dickey-Fuller regressions for autocorrelation. In this strategy you can start with a small model, and test the residuals of the Dickey-Fuller regression for autocorrelation using an LM test. If the residuals are autocorrelated, add another lagged difference of the series to the ADF regression and test the residuals again. Once the LM statistic is insignificant, you quit you are done. This is referred to as testing-up. You will still need to start with a reasonable number of lags in the model or the tests will not have desirable properties.

To employ this strategy in gretl, you’ll have to estimate the ADF equations manually using the ols command. Since the data series has a constant and quadratic trend, you have to define a time trend (genr time) and possibly trend squared (square time) to include in the regressions.[77]

Note this is another one of those cases where you cannot use series in place of genr. The genr time is a special function for genr. The other cases include genr dummy and genr unitdum. You will also need to generate the differences to use in a new function called lags. The script to do this follows:

1 genr time

2 square time

3 diff usa aus

Now, estimate a series of augmented Dickey-Fuller regressions using ols. Follow each regression with the LM test for autocorrelation of the residuals discussed in chapter 9.

In this code example we chose to suppress the results from the first regression so that the output from the tests would fit on one page (Figure 13.3). In practice, you could skip this option and read the Dickey-Fuller t-ratio directly from the output. The only disadvantage of this is that the proper p-value for it is not computed using the manual approach.

If you repeat this exercise for aus (as we have done in the script at the end of the chapter[78]) you will find that testing up determines zero lags of d_aus are required in the Dickey-Fuller regression; testing down revealed three lags were needed. The incongruence occurs because we did a poor job of testing up, failing to include enough autocorrelation terms in the LM test. This illustrates a danger of testing up. When we conducted the LM test using only a single autocorrelation term, we had not searched far enough in the past to detect significant autocorrelations that lie further back in time. Adding terms to the autocorrelation test using modtest 3 —autocorr would have helped to detect this.