urdfTest Augmented Dickey--Fuller test for unit roots,
urersTest Elliott--Rothenberg--Stock test for unit roots,
urkpssTest KPSS unit root test for stationarity,
urppTest Phillips--Perron test for unit roots,
urspTest Schmidt--Phillips test for unit roots,
urzaTest Zivot--Andrews test for unit roots. }
Note, that the contributed R package urca is required!urdfTest(x, lags = 1, type = c("nc", "c", "ct"), doplot = TRUE)
urersTest(x, type = c("DF-GLS", "P-test"), model = c("constant", "trend"),
lag.max = 4, doplot = TRUE)
urkpssTest(x, type = c("mu", "tau"), lags = c("short", "long", "nil"),
use.lag = NULL, doplot = TRUE)
urppTest(x, type = c("Z-alpha", "Z-tau"), model = c("constant", "trend"),
lags = c("short", "long"), use.lag = NULL, doplot = TRUE)
urspTest(x, type = c("tau", "rho"), pol.deg = c(1, 2, 3, 4),
signif = c(0.01, 0.05, 0.1), doplot = TRUE)
urzaTest(x, model = c("intercept", "trend", "both"), lag, doplot = TRUE)TRUE. Should a diagnostical
plot be displayed?"P-test", BIC used, or the maximum
number of lagged differences to be included in the test
regression for "DF-GLS""constant", the default, or
"trend".
[urppTest] -
a character string which determines the deterministic part in
"mu", the default, or "tau".
[urppTest] -
a character string which specifies the test type, either
"Z-alpha"lags=c("short", "long", "nil"), for more
information see the details section.
[urppTest] -
Use of a different lag number, specified by t"fHTEST" with the
following slots:@test slot include the following components:"P-test", which
takes serial correlation of the error term into account. The second
test type is the "DF-GLS" test, which is an ADF-type test
applied to the detrended data without intercept. Critical values
for this test are taken from MacKinnon in case of model="constant"
and else from Table 1 of Elliot, Rothenberg and Stock.
[urca:ur.ers]
KPSS Test for Unit Roots:
Performs the KPSS unit root test, where the Null hypothesis is
stationarity. The test types specify as deterministic component
either a constant "mu" or a constant with linear trend
"tau". lags="short" sets the number of lags to
root 4 of [4 times (n/100), whereas lags="long"
sets the number of lags to root 4 of [12 times (n/100)].
If lags="nil" is choosen, then no error correction is made.
Furthermore, one can specify a different number of maximum lags
by setting use.lag accordingly.
[urca:ur.kpss]
Phillips--Perron Test for Unit Roots:
Performs the Phillips and Perron unit root test. Beside the
Z statistics Z-alpha and Z-tau, the Z statistics for the
deterministic part of the test regression are computed, too.
For correction of the error term a Bartlett window is used.
[urca:ur.pp]
Schmidt--Phillips Test for Unit Roots:
Performs the Schmidt and Phillips unit root test, where under
the Null and Alternative Hypothesis the coefficients of the
deterministic variables are included. Two test types are available:
the "rho-test" and the "tau-test". Both tests are
extracted from the LM principle.
[urca:ur.sp]
Zivot--Andrews Test for Unit Roots:
Performs the Zivot and Andrews unit root test, which allows a
break at an unknown point in either the intercept, the linear
trend or in both. This test is based upon the recursive estimation
of a test regression. The test statistic is defined as the
minimum t-statistic of the coeffcient of the lagged endogenous
variable.
[urca:ur.za]## Time Series
# A time series which contains no unit-root:
x = rnorm(1000)
# A time series which contains a unit-root:
y = cumsum(c(0, x))
## ERS Test:
if (require(urca)) {
urersTest(x)
urersTest(y)
}Run the code above in your browser using DataLab