infer (version 0.5.0)

specify: Specify the response and explanatory variables

Description

specify() also converts character variables chosen to be factors.

Usage

specify(x, formula, response = NULL, explanatory = NULL,
  success = NULL)

Arguments

x

A data frame that can be coerced into a tibble.

formula

A formula with the response variable on the left and the explanatory on the right.

response

The variable name in x that will serve as the response. This is alternative to using the formula argument.

explanatory

The variable name in x that will serve as the explanatory variable.

success

The level of response that will be considered a success, as a string. Needed for inference on one proportion, a difference in proportions, and corresponding z stats.

Value

A tibble containing the response (and explanatory, if specified) variable data.

Examples

Run this code
# NOT RUN {
# Permutation test similar to ANOVA
mtcars %>%
  dplyr::mutate(cyl = factor(cyl)) %>%
  specify(mpg ~ cyl) %>%
  hypothesize(null = "independence") %>%
  generate(reps = 100, type = "permute") %>%
  calculate(stat = "F")

# }

Run the code above in your browser using DataLab