| desc_tests {desctable} | R Documentation |
Add tests to a desc_table
Description
Add test statistics to a grouped desc_table, with the tests specified as variable = test.
Usage
desc_tests(desctable, .auto = tests_auto, .default = NULL, ...)
Arguments
desctable |
A desc_table |
.auto |
A function to automatically determine the appropriate tests |
.default |
A default fallback test |
... |
A list of statistical tests associated to variable names |
Value
A desc_table with tests
Tests
The statistical test functions to use in the table are passed as additional named arguments. Tests must be preceded
by a formula tilde (~).
name = ~test will apply test test to variable name.
Any R test function can be used, as long as it returns an object containing a p.value element, which is the
case for most tests returning an object of class htest.
Users can also use purrr::map-like formulas as quick anonymous functions (eg. ~ t.test(., var.equal = T) to
compute a t test without the Welch correction.
See Also
Other desc_table core functions:
desc_output(),
desc_table()
Examples
iris %>%
group_by(Species) %>%
desc_table() %>%
desc_tests(Sepal.Length = ~kruskal.test,
Sepal.Width = ~oneway.test,
Petal.Length = ~oneway.test(., var.equal = T),
Petal.Length = ~oneway.test(., var.equal = F))