Learn R Programming

infer (version 0.2.0)

t_test: A tidier version of t.test for two sample tests

Description

A tidier version of t.test for two sample tests

Usage

t_test(data, formula, alternative = "two_sided", ...)

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

alternative

character string specifying the direction of the alternative hypothesis. Options are "two_sided" (default), "greater", or "less".

...

currently ignored

Examples

Run this code
# NOT RUN {
# t test for comparing mpg against automatic/manual
  mtcars %>%
    dplyr::mutate(am = factor(am)) %>%
    t_test(mpg ~ am, alternative = "less")
# }

Run the code above in your browser using DataLab