adf: Augmented Dickey-Fuller (ADF) test

Description Usage Arguments Value Examples

View source: R/ts.R

Description

Performs the Augmented Dickey-Fuller (ADF) test to check if a time series is stationary. The result comes in a pretty format.

Usage

1
2
adf(d, vars = colnames(d), type = c("none", "drift", "trend"), lags = 1,
  filename = NULL, digits = 3, verbose = TRUE, ...)

Arguments

d

Data frame containing the time series in column-wise format.

vars

Column names to check for stationarity. If not specified, then all columns are tested.

type

Test type, either "none", "drift" or "trend". See ur.df for details.

lags

Number of lags for endogenous variable to be included. Default is 1. See ur.df for details.

filename

Optional filename to export the table as LaTeX. Default is NULL, i.e. no export.

digits

Number of digits to be printed (default: 3).

verbose

Flag if the result of each ADF test is printed. Default is yes (TRUE).

...

Further parameters passed on to ur.df.

Value

P-values from ADF test in a simple table. If P-values are < 0.05, this is an indication of stationarity.

Examples

1
2
3
4
5
data(USArrests)
adf(USArrests)
adf(USArrests, vars = c("Murder", "Rape"), type = "drift",
    filename = "adf.tex", verbose = FALSE)
unlink("adf.tex")

sfeuerriegel/ResearchGroupTools documentation built on May 29, 2019, 8:01 p.m.