Performs a t.test on 2 populations for numeric variables.

auto_t_test(data, col, ..., var_equal = FALSE, abbrv = TRUE)

Arguments

data

dataframe

col

a column with 2 categories representing the 2 populations

...

numeric variables to perform t.test on. Default is to select all numeric variables

var_equal

default FALSE; t.test parameter

abbrv

default TRUE; remove some extra columns from output

Value

dataframe

Examples



iris %>%
 dplyr::filter(Species != "setosa") %>%
 auto_t_test(col = Species)
#> # A tibble: 4 × 7
#>   name  versicolor_mean virginica_mean versicolor_nsize virginica_nsize  p.value
#>   <chr>           <dbl>          <dbl>            <dbl>           <dbl>    <dbl>
#> 1 Peta…            1.33           2.03               50              50 2.11e-25
#> 2 Peta…            4.26           5.55               50              50 4.90e-22
#> 3 Sepa…            5.94           6.59               50              50 1.87e- 7
#> 4 Sepa…            2.77           2.97               50              50 1.82e- 3
#> # ℹ 1 more variable: significance <chr>