specify
also converting character variables chosen to be factor
sSpecify the response and explanatory variables with
specify
also converting character variables chosen to be factor
s
specify(x, formula, response = NULL, explanatory = NULL, success = NULL)
a data frame that can be coerced into a tibble
a formula with the response variable on the left and the explanatory on the right
the variable name in x
that will serve as the response. This is alternative to using the formula
argument
the variable name in x
that will serve as the explanatory variable
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
A tibble containing the response (and explanatory, if specified) variable data
# 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