Skip to contents

via() switches a lazy pipeline to an alternative method variant and merges user-supplied arguments with the variant's declared defaults.

Usage

via(.x, .method, ...)

# S3 method for class 'test_lazy'
via(.x, .method, ...)

Arguments

.x

A test_lazy object.

.method

A string naming the method variant. Must match a named variant() in the agendas() of the matched test_define(). E.g. "boot", "permute", "permute_rfast".

...

Named arguments forwarded to the variant.

Value

The modified test_lazy object with recalibrate_spec populated.

Examples

sleep |>
    define_model(x_by(extra, group)) |>
    prepare_test(TTEST) |>
    via("boot", n = 2000) |>
    conclude()
#> 
#> == Model ======================================================================= 
#> 
#> Model ID : x_by 
#> Args : extra | group 
#>     x_vars : 1 
#>     by_vars : 1 
#> 
#> == T-Test · boot =============================================================== 
#> 
#> ============================== Bootstrapped T-test =============================
#> 
#> 
#> -- Summary ---------------------------------------------------------------------
#> 
#> Warning: running command 'tput cols' had status 2
#> -------------------------------
#>   CI     :   [-3.11, -0.0798]
#>   n_reps :               2000
#> -------------------------------
#> 
#> 

sleep |>
    define_model(x_by(extra, group)) |>
    prepare_test(TTEST) |>
    via("permute", n = 999L) |>
    conclude()
#> 
#> == Model ======================================================================= 
#> 
#> Model ID : x_by 
#> Args : extra | group 
#>     x_vars : 1 
#>     by_vars : 1 
#> 
#> == T-Test · permute ============================================================ 
#> 
#> ============================== T-test Permutation ==============================
#> 
#> 
#> -- Summary ---------------------------------------------------------------------
#> 
#> ───────────────────────────────
#>   Statistic  p-value  n_perms  
#> ───────────────────────────────
#>    -1.580     0.074     999    
#> ───────────────────────────────
#> 
#>