aTSA (version 3.1.2)

stationary.test: Stationary Test for Univariate Time Series

Description

Performs stationary test for a univariate time series.

Usage

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.

Value

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

Details

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

Examples

Run this code
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)

Run the code above in your browser using DataCamp Workspace