ARIMA Procedure

Example 7.8 Test for Stationarity

(View the complete code for this example.)

As mentioned in the section The Three Stages of ARIMA Modeling, identification is the first stage of time series modeling. Stationarity tests can help you decide whether to difference; this decision is an important part of identification. If a series is nonstationary, it requires differencing. Dickey (2005) demonstrates how to conduct stationarity tests and how to difference series by using PROC ARIMA. This example follows a similar fashion with two different data generation models.

The following DATA step generates a sample of 100 periods from the ARIMA(1,1,0) process: nabla u Subscript t Baseline equals 0.6 nabla u Subscript t minus 1 Baseline plus a Subscript t, nabla u Subscript t Baseline equals u Subscript t Baseline minus u Subscript t minus 1, and a Subscript t Baseline normal i normal i normal d normal upper N left-parenthesis 0 comma 1 right-parenthesis.

   title1 'Simulated ARIMA(1,1,0)';
   data a;
     u1 = 0;
     u2=0;
     do i = -50 to 100;
        a = rannor( 1234 );
        du1 = u1 - u2;
        du = 0.6 * du1 + a;
        u = du + u1;
        if i > 0 then output;
        u2 = u1;
        u1 = u;
     end;
   run;

First, you should check the observation and correlation analysis graphs. This not only helps you better understand the data, but it is also needed in order to conduct the augmented Dickey-Fuller (ADF) tests. When conducting the ADF tests, you need to specify how many lagged differences to include in the test regression and which model (zero mean, single mean, or trend) to use. An inappropriate choice can lead to incorrect results. The following statements identify the model and generate observation and correlation graphs:

proc arima data=a;
  identify var=u;
run;

The results of the graphical series correlation analysis are shown in Output 7.8.1.

Output 7.8.1: Correlation Analysis for the Nonstationary Series

Correlation Analysis for the Nonstationary Series


As shown in Output 7.8.1, there is no obvious time trend in the data, and the mean is not close to zero. An AR(1) model would suffice for the test, because the partial autocorrelation functions (PACFs) decline quickly after the first lag, as shown in the PACF plot. The ADF= option in ADF tests should be set to 0 here, because zero lagged differences are used in the test regression for the AR(1) model. However, to better illustrate how the ADF= and PP= options work, they are set to 1 in this example. The following PROC ARIMA statements conduct stationarity tests:

proc arima data=a;
  identify var=u stationarity=(adf=1);
  run;
  identify var=u stationarity=(pp=1);
  run;
quit;

The first IDENTIFY statement performs the ADF unit root tests for the original series, u. The descriptive statistics and stationarity test results are shown in Output 7.8.2.

Output 7.8.2: Descriptive Statistics and ADF Tests for the Nonstationary Series

Simulated ARIMA(1,1,0)

The ARIMA Procedure

Name of Variable = u
Mean of Working Series7.033652
Standard Deviation7.81187
Number of Observations100

Augmented Dickey-Fuller Unit Root Tests
TypeLagsRhoPr < RhoTauPr < TauFPr > F
Zero Mean02.06170.98921.660.9758  
 1-1.09890.4543-0.390.5405  
Single Mean00.99080.98790.590.98891.830.6090
 1-4.04380.5273-1.080.72090.800.8684
Trend00.13270.99640.080.99671.320.9121
 1-5.35820.7871-1.430.84711.500.8767


The three types of models are listed in the Type column in the "Augmented Dickey-Fuller Unit Root Tests" table in Output 7.8.2. The single-mean model fits best in this case, because the mean is not zero, as shown in Output 7.8.2, and there is no obvious time trend, as demonstrated in the observation plot in Output 7.8.1.

For each type of model, two rows of test statistics are reported: 0 lags and 1 lag. This is set by the ADF=1 option in the STATIONARITY= option. The row of 0 lags shows test statistics for an AR(1) model, where zero lagged differences are used in the test regression. The row of 1 lag shows test statistics for the AR(2) model, where one lagged differenced term is used in the test regression. As mentioned earlier, an AR(1) model would suffice in this case.

All three kinds of test statistics are reported under the ADF tests, as presented in Output 7.8.2. Tau test statistics are mostly used to decide whether to reject the null hypothesis. The p-values of the tau test statistics in both the AR(1) and AR(2) models are greater than 0.1, and the null hypothesis (the series is nonstationary; that is, there is a unit root) cannot be rejected at the 10% level.

The second IDENTIFY statement performs the Phillips-Perron (PP) tests for the original series, u. The stationarity test results are shown in Output 7.8.3.

Output 7.8.3: PP Tests for the Nonstationary Series

Phillips-Perron Unit Root Tests
TypeLagsRhoPr < RhoTauPr < Tau
Zero Mean02.06170.98921.660.9758
 11.59570.97151.010.9169
Single Mean00.99080.98790.590.9889
 10.15420.96320.070.9618
Trend00.13270.99640.080.9967
 1-0.76390.9901-0.350.9881


The output structure of the PP tests is similar to that of the ADF tests, except that there is no F test. The PP tests also report the rho test statistic (shown in the Rho column) and the tau test statistic (shown in the Tau column), but they are calculated differently from the ADF tests. As shown in Output 7.8.3, the p-values of the tau test statistics are greater than 0.1, and therefore the PP tests also fail to reject the null hypothesis that the series is nonstationary.

The preceding results of the stationarity tests are consistent with the correlation analysis output. As shown in Output 7.8.1, the ACFs are significant and decay very slowly with increasing lag. This also suggests nonstationarity. Note that the estimated partial autocorrelation for the first lag is close to 1 and the PACFs decline quickly after the first lag. This suggests that you should consider differencing the series. The following statements identify the differenced series, nabla u:

proc arima data=a;
  identify var=u(1);
run;

The results of the graphical series correlation analysis are shown in Output 7.8.4.

Output 7.8.4: Correlation Analysis for the Differenced Series

Correlation Analysis for the Differenced Series


The series also presents no trend and moves around 0, as shown in Output 7.8.4. As in the original series, the PACFs decline quickly after the first lag, suggesting an AR(1) model. Therefore, the stationarity tests are conducted with zero lagged differences, as in the following statements:

proc arima data=a;
  identify var=u(1) stationarity=(adf=0);
  run;
  identify var=u(1) stationarity=(pp=0);
  run;
quit;

The descriptive statistics and ADF test results are shown in Output 7.8.5. The PP test results are shown in Output 7.8.6.

Output 7.8.5: Descriptive Statistics and ADF Tests for the Differenced Series

Simulated ARIMA(1,1,0)

The ARIMA Procedure

Name of Variable = u
Period(s) of Differencing1
Mean of Working Series0.235092
Standard Deviation1.275033
Number of Observations99
Observation(s) eliminated by differencing1

Dickey-Fuller Unit Root Tests
TypeLagsRhoPr < RhoTauPr < TauFPr > F
Zero Mean0-36.1794<.0001-4.75<.0001  
Single Mean0-37.13170.0009-4.770.000211.420.0010
Trend0-38.52030.0005-4.870.000711.870.0010


Output 7.8.6: PP Tests for the Differenced Series

Phillips-Perron Unit Root Tests
TypeLagsRhoPr < RhoTauPr < Tau
Zero Mean0-36.1794<.0001-4.75<.0001
Single Mean0-37.13170.0009-4.770.0002
Trend0-38.52030.0005-4.870.0007


As indicated in Output 7.8.5, the mean of the differenced series is very close to 0, as is also suggested by Output 7.8.4. Therefore, you should look at the test statistics for the zero-mean model. You can also look at the single-mean model if you are not sure about the mean. The first IDENTIFY statement performs the ADF tests, and the second IDENTIFY statement performs the PP tests for the differenced series. Based on the p-values of both tests, the null hypothesis is rejected at the 1% level, indicating that the differenced series is stationary.

The preceding example demonstrates a nonstationary process that is stationary after first differencing. The next example demonstrates the unit root tests of a trend series that is composed of a time trend and a stationary part. The following DATA step generates a sample of 100 periods from the process: u Subscript t Baseline equals 2 t plus 0.5 u Subscript t Baseline plus a Subscript t, a Subscript t Baseline normal i normal i normal d normal upper N left-parenthesis 0 comma 1 right-parenthesis.

   title 'Simulated Trend Series with a Stationary AR(1) Process';
   data b;
     u1 = -20;
     do i = -50 to 100;
        a = rannor( 1234 );
        u = 2*i + 0.5*u1 + a;
        if i > 0 then output;
        u1 = u;
     end;
   run;

As in the previous example, you first identify the model and check the observation and correlation graphs by using the following statements:

proc arima data=b;
  identify var=u;
run;

The results of the graphical series correlation analysis are shown in Output 7.8.7.

Output 7.8.7: Correlation Analysis for a Trend Series with a Stationary Part

Correlation Analysis for a Trend Series with a Stationary Part


As shown in the observation plot in Output 7.8.7, the series has an obvious time trend. From the ACF and PACF plots in Output 7.8.7, you could conclude that it should be an AR(1) process, because the ACF does not decline as much as the lag increases and the PACF shows only one significant lag. The ADF=0 and PP=0 options should be specified in the stationarity tests, as in the following statements:

proc arima data=b;
  identify var=u stationarity=(adf=0);
  run;
  identify var=u stationarity=(pp=0);
  run;
quit;

The first IDENTIFY statement performs the ADF unit root tests for u. The stationarity test results are shown in Output 7.8.8.

Output 7.8.8: ADF Tests for a Trend Series with a Stationary Part

Simulated Trend Series with a Stationary AR(1) Process

The ARIMA Procedure

Dickey-Fuller Unit Root Tests
TypeLagsRhoPr < RhoTauPr < TauFPr > F
Zero Mean01.49880.965314.740.9999  
Single Mean0-0.00360.9557-0.040.9523597.850.0010
Trend0-47.59850.0003-5.52<.000115.220.0010


As mentioned earlier, there is a trend in the data, and the "Trend" type in Output 7.8.8 should be the focus here. As shown in Output 7.8.8, the p-value of the tau test statistic for AR(1) (that is, the LAG=0 case) is less than 0.0001, indicating that the null hypothesis (nonstationarity) is rejected and the series is trend stationary. The p-value of the F test statistic is 0.001. This means that the joint test of time trend and nonstationarity is rejected at the 1% level. Note that a random walk process with a positive drift would have plots very similar to those in this case, but both the tau test and the F test would fail to reject the null hypothesis (nonstationarity) for a random-walk-with-drift process. The number of lagged differences in the test regression is important. In this particular case, when the model includes more than 12 lags of differenced terms, the p-values of the tau test statistics are greater than 0.15 and the null hypothesis cannot be rejected at the 10% level. To conduct valid ADF tests, you need to select the autocorrelations first. The PP tests correct the statistics for autocorrelations and do not require you to select the autocorrelations. The second IDENTIFY statement in the preceding code performs the PP tests for u. The stationarity test results are shown in Output 7.8.9.

Output 7.8.9: PP Tests for a Trend Series with a Stationary Part

Phillips-Perron Unit Root Tests
TypeLagsRhoPr < RhoTauPr < Tau
Zero Mean01.49880.965314.740.9999
Single Mean0-0.00360.9557-0.040.9523
Trend0-47.59850.0003-5.52<.0001


As shown in Output 7.8.9, the p-value of the tau test statistic under the trend type is less than 0.001. If you include many lagged differences here, you will find that the p-values of the tau test statistic under the trend type are still less than 0.001. The PP tests reject the null hypothesis of nonstationarity with all the different levels of autocorrelation. As a trade-off, the PP tests work well only in large samples.

Last updated: June 19, 2025