stationary.test: Stationary Test for Univariate Time Series

Description Usage Arguments Details Value Note Author(s) Examples

Description

Performs stationary test for a univariate time series.

Usage

1
2
stationary.test(x, method = c("adf", "pp", "kpss"), nlag = NULL,
  type = c("Z_rho", "Z_tau"), lag.short = TRUE, output = TRUE)

Arguments

x

a numeric vector or univariate time series.

method

a character indicating which test to use. The default is "adf" by Augmented Dickey-Fuller test.

nlag

the lag order to calculate the test statistic, only valid for method = "adf". See adf.test for more details.

type

the test type, only valid for method = "pp". See pp.test for more details.

lag.short

a logical value, only valid for method = "pp" or "kpss". See pp.test and kpss.test for more details.

output

a logical value indicating to print the results in R console. The default is TRUE.

Details

This function combines the existing functions adf.test, pp.test and kpss.test for testing the stationarity of a univariate time series x.

Value

The results are the same as one of the adf.test, pp.test, kpss.test, depending on which test are used.

Note

Missing values are removed.

Author(s)

Debin Qiu

Examples

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)

Example output

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 

aTSA documentation built on May 1, 2019, 8:47 p.m.