Recursive Augmented Dickey-Fuller
Tidy into a joint model
tidy_join.radf_obj tidy_join(x, y = NULL, ...) Tidy or augment and then join objects of class radf_obj and radf_cv. The radf_cv is the object of reference. For example, if you provide panel critical values, the function returns the panel test statistic.
Arguments
| x | An object of class radf_obj. |
| y | An object of class radf_cv. The output will depend on the type of
critical value. |
| ... | Further arguments passed to methods. Not used. |
Details
tidy_join also calls augment_join when cv is of class sb_cv.
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.
rsim_data <- radf(sim_data, minw = 20)
cv <- radf_wb_cv(sim_data, minw = 20)
# One row per series/statistic, statistic and critical value side by side
tidy_join(rsim_data, cv)
#> # A tibble: 45 × 5
#> id stat tstat sig crit
#> <fct> <fct> <dbl> <fct> <dbl>
#> 1 psy1 adf -2.46 90 -0.596
#> 2 psy1 adf -2.46 95 -0.362
#> 3 psy1 adf -2.46 99 0.0523
#> 4 psy1 sadf 1.95 90 1.51
#> 5 psy1 sadf 1.95 95 1.97
#> 6 psy1 sadf 1.95 99 2.87
#> 7 psy1 gsadf 5.19 90 2.78
#> 8 psy1 gsadf 5.19 95 3.33
#> 9 psy1 gsadf 5.19 99 4.09
#> 10 psy2 adf -2.86 90 -0.629
#> # ℹ 35 more rows
# summary() and diagnostics() are themselves built on top of tidy_join()
summary(rsim_data, cv = cv)
#>
#> ── Summary (minw = 20, lag = 0) ──────────────── Wild Bootstrap (nboot = 500) ──
#>
#> psy1 :
#> # A tibble: 3 × 5
#> stat tstat `90` `95` `99`
#> <fct> <dbl> <dbl> <dbl> <dbl>
#> 1 adf -2.46 -0.596 -0.362 0.0523
#> 2 sadf 1.95 1.51 1.97 2.87
#> 3 gsadf 5.19 2.78 3.33 4.09
#>
#> psy2 :
#> # A tibble: 3 × 5
#> stat tstat `90` `95` `99`
#> <fct> <dbl> <dbl> <dbl> <dbl>
#> 1 adf -2.86 -0.629 -0.530 -0.251
#> 2 sadf 7.88 3.07 3.88 5.59
#> 3 gsadf 7.88 3.99 4.68 5.98
#>
#> evans :
#> # A tibble: 3 × 5
#> stat tstat `90` `95` `99`
#> <fct> <dbl> <dbl> <dbl> <dbl>
#> 1 adf -5.83 -0.668 -0.451 -0.0787
#> 2 sadf -2.73 5.00 6.38 12.6
#> 3 gsadf 5.47 7.25 9.22 13.2
#>
#> div :
#> # A tibble: 3 × 5
#> stat tstat `90` `95` `99`
#> <fct> <dbl> <dbl> <dbl> <dbl>
#> 1 adf -1.95 -0.548 -0.121 0.615
#> 2 sadf 1.11 0.972 1.15 1.69
#> 3 gsadf 1.11 1.65 2.07 2.77
#>
#> blan :
#> # A tibble: 3 × 5
#> stat tstat `90` `95` `99`
#> <fct> <dbl> <dbl> <dbl> <dbl>
#> 1 adf -5.15 -0.223 0.0861 0.479
#> 2 sadf 3.93 3.07 4.23 6.02
#> 3 gsadf 11.0 6.66 7.67 12.2
exuber