RATS 11.1
RATS 11.1

Procedures /

PERRONNGMTESTS Procedure

Home Page

← Previous Next →

@PerronNgMTests computes one or more of the Perron-Ng(1996) "M" unit root tests. Note that this just does the calculations—use the options (like MZA and MZB) to capture the test statistics that you want.

 

@PerronNgMTests( options )  series  start  end

 

Parameters

series

series to analyze

start, end

range of series to use. By default, the defined range of series.

Options

LAGS=number of additional lags [0]

 

GLS/[NOGLS]

DET=NONE/[CONSTANT]/TREND

CBAR=(positive) value for GLS rho=1-cbar/T

Default depends upon the model. The DET and CBAR options are used in detrending the data using local-to-unity detrending.

 

MZA=(output) modified Z-alpha statistic

MSB=(output) modified SB statistic

MZT=(output) modified Z-t statistic

ADF=(output) standard DF t-statistic

PT=(output)  point optimal Pt test

Example

This is from the Martin, Hurn and Harris examples. This uses @PerronNgMTests both on an input series that is first detrended using @GLSDetrend, and then the same letting @PerronNgMTests do the detrending itself.

 

*

* Martin, Hurn, Harris, "Econometric Modelling with Time Series"

* Example 17.2 from pp 635-636

* Unit Root Test of GDP

*

open data usgdp.dat

calendar(q) 1947:1

data(format=prn,nolabels,org=columns) 1947:01 2007:01 usgdp

*

set lgdp = log(usgdp)

graph

# lgdp

*

set trend = t

linreg lgdp / dfdetrend

# constant trend

*

* Dickey-Fuller test on OLS detrended residuals

*

set ddfdetrend = dfdetrend-dfdetrend{1}

linreg ddfdetrend

# dfdetrend{1}

*

* M-tests

*

@perronngmtests(nogls,mza=mza,msb=msb,mzt=mzt) dfdetrend

*

* There are very slight differences due to different estimates of the

* sigma-hat.

*

disp "MZA-OLS" mza

disp "MSB-OLS" msb

disp "MZT-OLS" mzt

*

* Using GLS detrended residuals

*

@glsdetrend(det=trend,cbar=13.5) lgdp / ersdetrend

set dersdetrend = ersdetrend-ersdetrend{1}

linreg dersdetrend

# ersdetrend{1}

*

@perronngmtests(nogls,mza=mza,msb=msb,mzt=mzt) ersdetrend

disp "MZA-OLS" mza

disp "MSB-OLS" msb

disp "MZT-OLS" mzt

*

* @PERRONNGMTESTS can also do the detrending directly, taking the

* original (log) GDP series as input.

*

@perronngmtests(gls,det=trend,cbar=13.5,mza=mza,msb=msb,mzt=mzt) lgdp

disp "MZA-OLS" mza

disp "MSB-OLS" msb

disp "MZT-OLS" mzt


 


Copyright © 2026 Thomas A. Doan