pp | R Documentation |
Implement the Phillips-Perron (1988) PP unit root test, including both Za (Z-alpha) and Zt (Z-tau) statistics. This wrapper allows inputting additional deterministic part, for example season dummies, but the asymptotic critical values are not available.
pp(y,type=c("none","const","trend"),d=NULL,lags=c("short","long","nill"),use=c("nw","ba"))
y |
Vector to be tested for a unit root. |
type |
The deterministic parts in the test regression. |
d |
Additional deterministic parts in addition to "type"" in the test regression. |
lags |
Lags used for correction of error term. See section "details" below. |
use |
User specified lags for correction of error term. See section "details" below.The default is the lag determined by Newey-West bandwidth ("nw") with Bartlett kernel ("ba"). |
lags="short"
sets the number of lags to
\sqrt[4]{4 \times (n/100)}
, whereas
lags="long"
sets the number of lags to
\sqrt[4]{12 \times (n/100)}
. If lags="nil" is choosen, no error correction is made.
Furthermore, "lags" and "use" are mutually exclusive: As long as "use" is not set to be NULL, its argument will be chosen first. One can specify a different number of maximum lags by setting "use" accordingly. Users can input number of your souce. This version suports two bandwidth functions: "nw" for Newey-West and "and" for Andrews. The kernel functions are supported: "ba"=Bartlett, "pa"=Parzen, "qs"=Qudratic Spectral
Zt |
The Z-tau test statistic. |
cvZt |
Critical values of Zt. |
Za |
The Z-alpha test statistic. |
cvZa |
Critical values of Za. |
lag |
Number of lags used for kernel function. |
resid |
Regression residuals. |
This code modifies function ur.pp
of package urca
, which does not have relevant critical values for "Z-alpha" test statistic.
Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.
Phillips, P.C.B. and Perron, P. (1988) Testing for a unit root in time series regression. Biometrika, 75(2), 335-346.
MacKinnon, J.G. (1991) Critical Values for Cointegration Tests- Long-Run Economic Relationships, eds. R.F. Engle and C.W.J. Granger, London, Oxford, 267-276.
data(macro)
y=macro[,"INF"]
pp(y,
type=c("none","const","trend")[3],
lags = c("short", "long", "nil")[2],
use=c("nw","ba")) # If argument "use" is NOT NULL, argument lags will be ignored.
pp(y,lags = c("short", "long", "nil")[2],
type=c("none","const","trend")[3],
use=NULL)
pp(y,lags = c("short", "long", "nil")[2],
type=c("none","const","trend")[3],
use=18)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.