infer (version 0.4.0.1)

generate: Generate resamples, permutations, or simulations

Description

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

Usage

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.

Value

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

Format

An object of class character of length 3.

Examples

Run this code
# NOT RUN {
# 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")

# }

Run the code above in your browser using DataCamp Workspace