View source: R/tseries-stationarity.R
aug_dickey_fuller_test | R Documentation |
The hypotheses for this test are:
A wrapper around tseries::adf.test()
that standardizes the inputs and outputs.
aug_dickey_fuller_test(object, alternative = "stationary", ..., .alpha = 0.05)
## S3 method for class 'lm'
aug_dickey_fuller_test(object, alternative = "stationary", ..., .alpha = 0.05)
## S3 method for class ''_lm''
aug_dickey_fuller_test(object, alternative = "stationary", ..., .alpha = 0.05)
aug_dickey_fuller_test_vec(x, alternative = "stationary", ..., .alpha = 0.05)
object |
A model object (such as a fitted |
alternative |
(Optional) The alternative hypothesis, either "stationary" (default) or "explosive". |
... |
Further arguments passed to |
.alpha |
(Optional) Critical p-value used to determine test conclusion. The default is 0.05 (5%). |
x |
For |
Null: Series has a unit root
Alternative: Series is either stationary or has explosive root (user defined)
A tibble with columns test
, statistic
,
p_value
, result
, outcome
, and .notes
with extra information.
Other stationarity tests:
kpss_test()
,
phillips_perron_test()
library(tidytest)
#> `lm` Method
mod_lm_fit <- lm(mpg ~ disp + wt + hp, data = mtcars)
aug_dickey_fuller_test(mod_lm_fit)
aug_dickey_fuller_test(mod_lm_fit, alternative = "explosive")
#> `linear_reg` Method
library(parsnip)
mod_linreg_fit <- linear_reg() %>%
set_engine("lm") %>%
fit(mpg ~ disp + wt + hp, data = mtcars)
aug_dickey_fuller_test(mod_linreg_fit)
aug_dickey_fuller_test(mod_linreg_fit, alternative = "explosive")
#> Numeric Method
set.seed(1914)
resids <- rnorm(100)
aug_dickey_fuller_test_vec(resids)
aug_dickey_fuller_test_vec(resids, alternative = "explosive")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.