Quartz | Level 8

## Optimal Lag length

Dear all,

I would like to calculate the optimal lag length for a variable. I notice that it is possible by using Microfit as shown in this link (https://nomanarshed.wordpress.com/2014/11/16/a-manual-for-ardl-approach-to-cointegration/).

I would like to know whether this calculation be done using SAS codes?

Thank you.

MSPAK

2 REPLIES 2
Super User

## Re: Optimal Lag length

```I searched it in sas documentation.
And find this at PROC AUTOREG .

STATIONARITY=(ERS)
STATIONARITY=(ERS=(value)
STATIONARITY=(NP)
STATIONARITY=(NP=(value)
provides a class of efficient unit root tests, because they reduce the size distortion and improve
the power compared with traditional unit root tests such as the augmented Dickey-Fuller and
Phillips-Perron tests. Two test statistics are reported with the ERS= suboption: the point optimal
test and the DF-GLS test, which are originally proposed in Elliott, Rothenberg, and Stock (1996).
Elliott, Rothenberg, and Stock suggest using the Schwarz Bayesian information criterion to select
the

optimal lag length

in the augmented Dickey-Fuller regression. The maximum lag length can
be specified by ERS=value. The minimum lag length is 3 and the default maximum lag length is
8
Six tests, namely MZ , MSB, MZt, the modified point optimal test, the point optimal test,
and the DF-GLS test, which are discussed in Ng and Perron (2001), are reported with the NP=
suboption. Ng and Perron suggest using the modified AIC to select the

optimal lag length

in the
augmented Dickey-Fuller regression by using GLS detrended data. The maximum lag length can
be specified by NP=value. The default maximum lag length is 8. The maximum lag length in the
ERS tests and Ng-Perron tests cannot exceed T =2
.
2, where T is the sample size.

```
Quartz | Level 8

## Re: Optimal Lag length

Can anyone here to suggest/provide sample SAS program code for this purpose?

Thank you.

MSPAK

Discussion stats
• 2 replies
• 1786 views
• 0 likes
• 2 in conversation