Generation is done based on specify() and (if needed) hypothesize() inputs.

generate(x, reps = 1, type = NULL, ...)

GENERATION_TYPES

Arguments

x

A data frame that can be coerced into a tibble.

reps

The number of resamples to generate.

type

Currently either bootstrap, permute, or simulate.

...

Currently ignored.

Format

An object of class character of length 3.

Value

A tibble containing rep generated datasets, indicated by the replicate column.

Examples

# Permutation test for two binary variables mtcars %>% dplyr::mutate(am = factor(am), vs = factor(vs)) %>% specify(am ~ vs, success = "1") %>% hypothesize(null = "independence") %>% generate(reps = 100, type = "permute")
#> Response: am (factor) #> Explanatory: vs (factor) #> Null Hypothesis: independence #> # A tibble: 3,200 x 3 #> # Groups: replicate [100] #> am vs replicate #> <fct> <fct> <int> #> 1 0 0 1 #> 2 0 0 1 #> 3 1 1 1 #> 4 0 1 1 #> 5 0 0 1 #> 6 1 1 1 #> 7 0 0 1 #> 8 0 1 1 #> 9 0 1 1 #> 10 1 1 1 #> # ... with 3,190 more rows