Skip to content
exuber

Recursive Augmented Dickey-Fuller

Tidy a radf_obj object

tidy.radf_obj
tidy(x, format = c("wide", "long"), panel = FALSE, ...)

Summarizes the information in a radf_obj object.

Arguments

x An object of class radf_obj.
format Long or wide format (default = "wide").
panel If TRUE then returns the panel statistics
... Further arguments passed to methods. Not used.

Value

A tibble::tibble()

Examples

These examples are copied from the package's own documentation and are run by R CMD check on every release. The printed output (after #>) and the plots were produced by running them against the current package source.

dta <- data.frame(psy1 = sim_psy1(n = 100), psy2 = sim_psy2(n = 100))

rfd <- radf(dta)

# Get the test statistic
tidy(rfd)
#> # A tibble: 2 × 4
#>   id      adf  sadf gsadf
#>   <fct> <dbl> <dbl> <dbl>
#> 1 psy1  -1.11  3.16  3.27
#> 2 psy2  -2.59  4.56  5.30

# Get the test statisticsequences
augment(rfd)
#> # A tibble: 162 × 6
#>      key index id     data  badf bsadf
#>    <int> <dbl> <chr> <dbl> <dbl> <dbl>
#>  1    20    20 psy1   76.5 -2.01 -2.01
#>  2    20    20 psy2   83.1 -1.48 -1.48
#>  3    21    21 psy1   58.6 -1.24 -1.08
#>  4    21    21 psy2   84.1 -1.54 -1.16
#>  5    22    22 psy1   57.9 -1.25 -1.08
#>  6    22    22 psy2   84.5 -1.59 -1.19
#>  7    23    23 psy1   60.9 -1.51 -1.34
#>  8    23    23 psy2   88.9 -1.63 -1.22
#>  9    24    24 psy1   64.5 -1.76 -1.58
#> 10    24    24 psy2   96.6 -1.50 -1.08
#> # ℹ 152 more rows

# Get the panel test statistic
tidy(rfd, panel = TRUE)
#> # A tibble: 1 × 1
#>   gsadf_panel
#>         <dbl>
#> 1        2.25