generate: Generate resamples, permutations, or simulations

Description Usage Arguments Format Value Examples

View source: R/generate.R

Description

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

Usage

1
2
3

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 as defined in the GENERATION_TYPES vector.

...

Currently ignored.

Format

An object of class character of length 3.

Value

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

Examples

1
2
3
4
5
6
7
8
9
# Different `type` options
GENERATION_TYPES   
 
# 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")

andrewpbray/infer documentation built on Aug. 29, 2019, 5:57 a.m.