Skip to contents

prepare_test() attaches a test specification to a def_model object, producing a test_lazy ready for optional recalibration with via() before being executed with conclude().

Usage

prepare_test(.x, .test, ...)

# S3 method for class 'def_model'
prepare_test(.x, .test, ...)

Arguments

.x

A def_model object from define_model().

.test

A test function such as TTEST, or a test_spec object returned by calling such a function with no arguments.

...

Additional arguments passed to methods.

Value

A test_lazy S3 object.

Examples

sleep |>
    define_model(x_by(extra, group)) |>
    prepare_test(TTEST) |>
    conclude()
#> 
#> == Model ======================================================================= 
#> 
#> Model ID : x_by 
#> Args : extra | group 
#>     x_vars : 1 
#>     by_vars : 1 
#> 
#> == T-Test ====================================================================== 
#> 
#> -- Summary ---------------------------------------------------------------------
#> 
#> ─────────────────────────────────
#>   groups   diff   t-stat  pval   
#> ─────────────────────────────────
#>   group   -1.580  -1.861  0.079  
#> ─────────────────────────────────
#> 
#> 
#> -- Confidence Interval ---------------------------------------------------------
#> 
#> ──────────────────────────────
#>   groups  lower_95  upper_95  
#> ──────────────────────────────
#>   group    -3.365    0.205    
#> ──────────────────────────────
#> 
#>