RATS 11
RATS 11

UNITROOT.RPF has examples of unit root testing, including Dickey-Fuller (@DFUNIT), Phillips-Perron (@PPUNIT), Schmidt-Phillips (@SPUNIT), KPSS (@KPSS) and ERS (@ERSTEST). In practice, one would pick at most two of these tests, but for illustration, we include all of them.

 

If you're looking for unit root tests allowing for breaks, see UNITROOTBREAK.RPF.

 

This is adapted from Hamilton(1994), examples from Chapter 17.

Full Program

 

cal(q) 1947
open data gnptbill.txt
data(format=prn,org=obs) 1947:1 1989:1
*
set lgnp = 100.0*log(gnp)
*
* Dickey-Fuller tests (T-bills)
*
@dfunit(det=constant) tbill
@dfunit(det=constant,maxlags=6,method=gtos) tbill
@dfunit(det=constant,maxlags=6,method=aic) tbill
*
* Dickey-Fuller tests (log GNP)
*
@dfunit(det=trend) lgnp
@dfunit(det=trend,maxlags=6,method=gtos) lgnp
@dfunit(det=trend,maxlags=6,method=aic) lgnp
*
* Phillips-Perron tests
*
@ppunit(det=constant,lags=12,table) tbill
@ppunit(det=trend,lags=12,table) lgnp
*
* Schmidt-Phillips tests
*
@spunit(p=1,lags=12) tbill
@spunit(p=1,lags=12) lgnp
*
* ERS tests
*
@erstest(det=trend,lags=12) lgnp
*
* KPSS tests
*
@kpss(det=constant,lmax=12) tbill
@kpss(det=trend,lmax=12) lgnp
 

Output

All of the tests point to acceptance of a unit root in both series tested. (KPSS has a null of stationarity, so it rejecting stationarity is compatible with the other results). The only test which has a somewhat ambiguous result is the Schmidt-Phillips on the T-Bill series, which is around the 5% level.

Dickey-Fuller Unit Root Test, Series TBILL

Regression Run From 1947:02 to 1989:01

Observations        169

With intercept

Using fixed lags 0

Null is unit root. Reject in left tail.

 

Sig Level    Crit Value

1%(**)         -3.47002

5%(*)          -2.87859

10%            -2.57577

 

T-Statistic    -1.72945

 

 

Dickey-Fuller Unit Root Test, Series TBILL

Regression Run From 1948:04 to 1989:01

Observations        163

With intercept

With 6 lags chosen from 6 by GTOS/t-tests(0.100)

Null is unit root. Reject in left tail.

 

Sig Level    Crit Value

1%(**)         -3.47140

5%(*)          -2.87921

10%            -2.57609

 

T-Statistic    -1.70800

 

 

Dickey-Fuller Unit Root Test, Series TBILL

Regression Run From 1948:04 to 1989:01

Observations        163

With intercept

With 6 lags chosen from 6 by AIC

Null is unit root. Reject in left tail.

 

Sig Level    Crit Value

1%(**)         -3.47140

5%(*)          -2.87921

10%            -2.57609

 

T-Statistic    -1.70800

 

 

Dickey-Fuller Unit Root Test, Series LGNP

Regression Run From 1947:02 to 1989:01

Observations        169

With intercept and trend

Using fixed lags 0

Null is unit root. Reject in left tail.

 

Sig Level    Crit Value

1%(**)         -4.01489

5%(*)          -3.43712

10%            -3.14247

 

T-Statistic    -1.94141

 

 

Dickey-Fuller Unit Root Test, Series LGNP

Regression Run From 1947:04 to 1989:01

Observations        167

With intercept and trend

With 2 lags chosen from 6 by GTOS/t-tests(0.100)

Null is unit root. Reject in left tail.

 

Sig Level    Crit Value

1%(**)         -4.01552

5%(*)          -3.43742

10%            -3.14265

 

T-Statistic    -3.13012

 

 

Dickey-Fuller Unit Root Test, Series LGNP

Regression Run From 1947:04 to 1989:01

Observations        167

With intercept and trend

With 2 lags chosen from 6 by AIC

Null is unit root. Reject in left tail.

 

Sig Level    Crit Value

1%(**)         -4.01552

5%(*)          -3.43742

10%            -3.14265

 

T-Statistic    -3.13012

 

 

Phillips-Perron Test for a Unit Root for TBILL

Regression Run From 1947:02 to 1989:01

Observations 168

With intercept

Null is unit root. Reject in left tail.

 

Sig Level Crit Value

1%(**)      -3.47002

5%(*)       -2.87859

10%         -2.57577

 

  Lags    Statistic

        0   -1.73984

        1   -1.86648

        2   -1.78961

        3   -1.78634

        4   -1.80563

        5   -1.83592

        6   -1.85085

        7   -1.80795

        8   -1.77327

        9   -1.76985

       10   -1.75947

       11   -1.73244

       12   -1.70691

 

 

Phillips-Perron Test for a Unit Root for LGNP

Regression Run From 1947:02 to 1989:01

Observations 168

With intercept and trend

Null is unit root. Reject in left tail.

 

Sig Level Crit Value

1%(**)      -4.01489

5%(*)       -3.43712

10%         -3.14247

 

  Lags    Statistic

        0   -1.95898

        1   -2.18369

        2   -2.34662

        3   -2.42578

        4   -2.45203

        5   -2.44927

        6   -2.43843

        7   -2.42781

        8   -2.40975

        9   -2.38650

       10   -2.36745

       11   -2.34807

       12   -2.32257

 

 

Schmidt-Phillips Test (TAU) for a Unit Root in TBILL

Regression Run From 1947:02 to 1989:01

Observations          168

Null of unit root. Reject in left tail.

 

Signif. Level             Critical Value

1%(**)                           -3.610

2.5%                             -3.300

5%(*)                            -3.040

10%                              -2.760

 

LM Test Auxiliary Regression

Variable      Coefficient         T-Stat

SBAR{1}          -0.09399        -2.861

Constant          0.09187         1.469

 

Semiparametric Corrections for TAU

Bartlett Window Estimates of sigma^2

Schwert value of L4 =4, L12=13

 

         Lags     Sigma^2            tau

            0    0.611220        -2.861

            1    0.736752        -3.141*

            2    0.688609        -3.037

            3    0.701993        -3.066*

            4    0.732948        -3.133*

            5    0.771827        -3.215*

            6    0.795973        -3.265*

            7    0.768943        -3.209*

            8    0.748042        -3.165*

            9    0.751997        -3.174*

           10    0.748943        -3.167*

           11    0.731061        -3.129*

           12    0.713412        -3.091*

 

 

Schmidt-Phillips Test (TAU) for a Unit Root in LGNP

Regression Run From 1947:02 to 1989:01

Observations          168

Null of unit root. Reject in left tail.

 

Signif. Level             Critical Value

1%(**)                            -3.610

2.5%                              -3.300

5%(*)                             -3.040

10%                               -2.760

 

LM Test Auxiliary Regression

Variable      Coefficient         T-Stat

SBAR{1}          -0.02927         -1.570

Constant          0.93251          8.112

 

Semiparametric Corrections for TAU

Bartlett Window Estimates of sigma^2

Schwert value of L4 =4, L12=13

 

         Lags     Sigma^2            tau

            0    1.152130         -1.570

            1    1.587814         -1.843

            2    1.931105         -2.033

            3    2.110782         -2.125

            4    2.178638         -2.159

            5    2.183142         -2.161

            6    2.170572         -2.155

            7    2.159320         -2.150

            8    2.133469         -2.137

            9    2.098492         -2.119

           10    2.074358         -2.107

           11    2.051445         -2.095

           12    2.016410         -2.077

 

 

DF-GLS Tests, Dependent Variable LGNP

From 1947:01 to 1989:01

Lag Length Chosen from 12 by User Input

Detrend = constant and linear time trend, z(t)=(1,t)

Tests for a unit root null. All tests reject null in lower tail

                       Critical values (asymptotic)

Elliott et al (1996 Econometrica)

          Stat    Lags  1%(**)    2.5%    5%(*)     10%

PT         12.800          3.96     4.78     5.62     6.89

DFGLS      -1.447   12    -3.48    -3.15    -2.89    -2.57

Elliott (IER 1999)

QT          4.157          2.05     2.44     3.15     3.44

DFGLSu     -2.135   12    -3.71    -3.41    -3.17    -2.91

 

 

KPSS Test for Stationarity, Series TBILL

From 1947:01 to 1989:01

Observations 169

Null is Stationary about Level. Reject for large values.

 

Sig Level Crit Value

1%(**)       0.739

2.5%         0.574

5%(*)        0.463

10%          0.347

 

  Lags    TestStat

        0   12.347**

        1    6.301**

        2    4.278**

        3    3.258**

        4    2.644**

        5    2.234**

        6    1.942**

        7    1.724**

        8    1.554**

        9    1.417**

       10    1.305**

       11    1.211**

       12    1.132**

 

 

KPSS Test for Stationarity, Series LGNP

From 1947:01 to 1989:01

Observations 169

Null is Stationary about Trend. Reject for large values.

 

Sig Level Crit Value

1%(**)       0.216

2.5%         0.176

5%(*)        0.146

10%          0.119

 

  Lags    TestStat

        0    2.002**

        1    1.021**

        2    0.695**

        3    0.534**

        4    0.438**

        5    0.375**

        6    0.331**

        7    0.297**

        8    0.272**

        9    0.251**

       10    0.235**

       11    0.222**

       12    0.211*

 


Copyright © 2025 Thomas A. Doan