Performs a t.test on 2 populations for numeric variables.
auto_t_test(data, col, ..., var_equal = FALSE, abbrv = TRUE)
dataframe
a column with 2 categories representing the 2 populations
numeric variables to perform t.test on. Default is to select all numeric variables
default FALSE; t.test parameter
default TRUE; remove some extra columns from output
dataframe
iris %>%
dplyr::filter(Species != "setosa") %>%
auto_t_test(col = Species)
#> # A tibble: 4 × 7
#> name versicolor_mean virginica_mean versico…¹ virgi…² p.value signi…³
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 Petal.Width 1.33 2.03 50 50 2.11e-25 ***
#> 2 Petal.Length 4.26 5.55 50 50 4.90e-22 ***
#> 3 Sepal.Length 5.94 6.59 50 50 1.87e- 7 ***
#> 4 Sepal.Width 2.77 2.97 50 50 1.82e- 3 **
#> # … with abbreviated variable names ¹versicolor_nsize, ²virginica_nsize,
#> # ³significance