The %DFTEST macro performs the Dickey-Fuller unit root test. You can use the %DFTEST macro to decide whether a time series is stationary and to determine the order of differencing required for the time series analysis of a nonstationary series.
Most time series analysis methods require that the series to be analyzed is stationary. However, many economic time series are nonstationary processes. The usual approach to this problem is to difference the series. A time series that can be made stationary by differencing is said to have a unit root. For more information, see the discussion of this issue in the section Getting Started: ARIMA Procedure of ChapterĀ 8: The ARIMA Procedure.
The Dickey-Fuller test is a method for testing whether a time series has a unit root. The %DFTEST macro tests the hypothesis H: "The time series has a unit root" versus H: "The time series is stationary" based on tables provided in Dickey (1976); Dickey, Hasza, and Fuller (1984). The test can be applied for a simple unit root with lag 1, or for seasonal unit roots at lag 2, 4, or 12.
Note that the %DFTEST macro has been superseded by the PROC ARIMA stationarity tests. See ChapterĀ 8: The ARIMA Procedure, for details.
The %DFTEST macro has the following form:
%DFTEST ( SAS-data-set, variable < , options > );
The first argument, SAS-data-set, specifies the name of the SAS data set that contains the time series variable to be analyzed.
The second argument, variable, specifies the time series variable name to be analyzed.
The first two arguments are required. The following options can be used with the %DFTEST macro. Options must follow the required arguments and are separated by commas.
The computed p-value is returned in the macro variable &DFTEST
. If the p-value is less than 0.01 or larger than 0.99, the macro variable &DFTEST
is set to 0.01 or 0.99, respectively. (The same value is given in the macro variable &DFPVALUE
returned by the %DFPVALUE macro, which is used by the %DFTEST macro to compute the p-value.)
Results can be stored in SAS data sets with the OUT= and OUTSTAT= options.
The minimum number of observations required by the %DFTEST macro depends on the value of the DLAG= option. Let s be the sum of the differencing orders specified by the DIF= option, let t be the value of the TREND= option, and let p be the value of the AR= option. The minimum number of observations required is as follows:
DLAG= |
Minimum Observations |
1 |
|
2 |
|
4 |
|
12 |
|
Observations are not used if they have missing values for the series or for any lag or difference used in the autoregressive model.