uroot.test: The Unit root tests function.

View source: R/test.R

uroot.testR Documentation

The Unit root tests function.

Description

Perform a unit root test to check stationary in a linear stochastic process.

Usage

uroot.test(y, unit_root = c("adf","kpss","pp","box"), alpha = 0.05)

Arguments

y

a numeric vector or an object of the ts class containing a stationary time series.

unit_root

A character string naming the desired unit root test for checking stationary. Valid values are "adf" for the Augmented Dickey-Fuller, "pp" for the Phillips-Perron, "kpss" for Kwiatkowski, Phillips, Schmidt, and Shin, and "box" for the Ljung-Box. The default value is "adf" for the Augmented Dickey-Fuller test.

alpha

Level of the test, possible values range from 0.01 to 0.1. By default alpha = 0.05 is used.

Details

Several different tests are available: In the kpss test, the null hypothesis that y has a stationary root against a unit-root alternative. In the two remaining tests, the null hypothesis is that y has a unit root against a stationary root alternative. By default, alpha = 0.05 is used to select the more likely hypothesis.

Value

A list with class "h.test" containing the following components:

statistic:

the test statistic.

parameter:

the test degrees freedoms.

p.value:

the p-value for the test.

alternative:

a character string describing the alternative hypothesis.

method:

a character string with the test name.

data.name:

a character string giving the name of the data.

Author(s)

Asael Alonzo Matamoros and A. Trapletti.

References

Dickey, D. & Fuller, W. (1979). Distribution of the Estimators for Autoregressive Time Series with a Unit Root. Journal of the American Statistical Association. 74, 427-431.

Kwiatkowski, D., Phillips, P., Schmidt, P. & Shin, Y. (1992). Testing the Null Hypothesis of Stationarity against the Alternative of a Unit Root, Journal of Econometrics. 54, 159-178.

Phillips, P. & Perron, P. (1988). Testing for a unit root in time series regression, Biometrika. 72(2), 335-346.

Ljung, G. M. & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika. 65, 297-303.

See Also

normal.test, seasonal.test

Examples

#  stationary  ar process
y = arima.sim(100,model = list(ar = 0.3))
uroot.test(y)

# a random walk process
y = cumsum(y)
uroot.test(y, unit_root = "pp")


nortsTest documentation built on May 29, 2024, 10:05 a.m.