powered by
A tidier version of chisq.test() for goodness of fit tests and tests of independence.
chisq_test(x, formula, response = NULL, explanatory = 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.
x
formula
The variable name in x that will serve as the explanatory variable.
Additional arguments for chisq.test().
# NOT RUN { # chisq test for comparing number of cylinders against automatic/manual mtcars %>% dplyr::mutate(cyl = factor(cyl), am = factor(am)) %>% chisq_test(cyl ~ am) # }
Run the code above in your browser using DataLab