# NOT RUN {
set.seed(505)
data_to_plot <- mtcars %>%
dplyr::mutate(am = factor(am)) %>%
specify(mpg ~ am) %>% # alt: response = mpg, explanatory = am
hypothesize(null = "independence") %>%
generate(reps = 100, type = "permute") %>%
calculate(stat = "t", order = c("1", "0"))
visualize(data_to_plot, method = "simulation") +
shade_p_value(1.5, direction = "right")
visualize(data_to_plot, method = "theoretical") +
shade_p_value(1.5, direction = "left")
visualize(data_to_plot, method = "both") +
shade_p_value(1.5, direction = "both")
visualize(data_to_plot) + shade_p_value(1.5, direction = NULL)
# }
Run the code above in your browser using DataLab