Learn R Programming

infer (version 0.3.1)

chisq_test: A tidier version of chisq.test for goodness of fit tests and tests of independence.

Description

A tidier version of chisq.test for goodness of fit tests and tests of independence.

Usage

chisq_test(data, formula, ...)

Arguments

data

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

...

additional arguments for chisq.test

Examples

Run this code
# 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