Description Usage Arguments Details Value Note Author(s) Examples
Performs stationary test for a univariate time series.
1 2 |
x |
a numeric vector or univariate time series. |
method |
a character indicating which test to use. The default is
|
nlag |
the lag order to calculate the test statistic, only valid for
|
type |
the test type, only valid for |
lag.short |
a logical value, only valid for |
output |
a logical value indicating to print the results in R console.
The default is |
This function combines the existing functions adf.test
,
pp.test
and
kpss.test
for testing the stationarity of a univariate time series x
.
The results are the same as one of the adf.test
, pp.test
,
kpss.test
, depending on which test are used.
Missing values are removed.
Debin Qiu
1 2 3 4 | x <- arima.sim(list(order = c(1,0,0),ar = 0.2),n = 100)
stationary.test(x) # same as adf.test(x)
stationary.test(x, method = "pp") # same as pp.test(x)
stationary.test(x, method = "kpss") # same as kpss.test(x)
|
Attaching package: 'aTSA'
The following object is masked from 'package:graphics':
identify
Augmented Dickey-Fuller Test
alternative: stationary
Type 1: no drift no trend
lag ADF p.value
[1,] 0 -8.24 0.01
[2,] 1 -5.85 0.01
[3,] 2 -5.10 0.01
[4,] 3 -4.90 0.01
[5,] 4 -4.86 0.01
Type 2: with drift no trend
lag ADF p.value
[1,] 0 -8.20 0.01
[2,] 1 -5.82 0.01
[3,] 2 -5.06 0.01
[4,] 3 -4.88 0.01
[5,] 4 -4.84 0.01
Type 3: with drift and trend
lag ADF p.value
[1,] 0 -8.32 0.01
[2,] 1 -5.97 0.01
[3,] 2 -5.38 0.01
[4,] 3 -5.14 0.01
[5,] 4 -5.13 0.01
----
Note: in fact, p.value = 0.01 means p.value <= 0.01
Phillips-Perron Unit Root Test
alternative: stationary
Type 1: no drift no trend
lag Z_rho p.value
3 -82.4 0.01
-----
Type 2: with drift no trend
lag Z_rho p.value
3 -82.6 0.01
-----
Type 3: with drift and trend
lag Z_rho p.value
3 -82.6 0.01
---------------
Note: p-value = 0.01 means p.value <= 0.01
KPSS Unit Root Test
alternative: nonstationary
Type 1: no drift no trend
lag stat p.value
2 0.186 0.1
-----
Type 2: with drift no trend
lag stat p.value
2 0.244 0.1
-----
Type 1: with drift and trend
lag stat p.value
2 0.0601 0.1
-----------
Note: p.value = 0.01 means p.value <= 0.01
: p.value = 0.10 means p.value >= 0.10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.