Skip to contents

Summarizes the information in a radf_obj object.

Usage

# S3 method for class 'radf_obj'
tidy(x, format = c("wide", "long"), panel = FALSE, ...)

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.

Examples

# \donttest{
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  -2.44  4.04  4.25
#> 2 psy2  -2.44  5.86  6.01

# 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   133. -1.39  -1.39 
#>  2    20    20 psy2   123. -3.04  -3.04 
#>  3    21    21 psy1   134. -1.42  -0.930
#>  4    21    21 psy2   126. -2.30  -1.90 
#>  5    22    22 psy1   134. -1.53  -1.03 
#>  6    22    22 psy2   123. -2.34  -1.96 
#>  7    23    23 psy1   133. -1.63  -1.12 
#>  8    23    23 psy2   124. -2.21  -1.82 
#>  9    24    24 psy1   121. -2.11  -1.65 
#> 10    24    24 psy2   144. -0.783 -0.476
#> # ℹ 152 more rows

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