adf_test_summary: Run ADF test for unit roots on all columns of a data frame.

Description Usage Arguments Value Examples

View source: R/adf_test_summary.r

Description

Run ADF test for unit roots on all columns of a data frame.

Usage

1
adf_test_summary(df, p_select = "BIC")

Arguments

p_select

Method for selecting number of lags to include in the test regression. Possible values: "AIC", "BIC"

Value

A data frame with 3 rows and ncol(df) columns.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Example 1: We test it on iid white noises and a random walk.
# As expected, white_noise's p-value is smaller than 0.01, so it is stationary. But random walk is not.
set.seed(10)
df <- data.frame(white_noise = rnorm(100), random_walk = cumsum(rnorm(100)))
adf_test_summary(df)

# Example 2: We test it on a "trend stationary" time series.
set.seed(10)
df <- data.frame(trend_s = 0.8 * seq(1:20) + rnorm(20))
adf_test_summary(df)

chaoguo14/crowbar documentation built on Aug. 16, 2021, 9:51 p.m.