Description Usage Arguments Details Value Examples
Compares the means/proportions across grouping by group
. Produces a p- value for each comparsion.
1 | comparison(df, group, ...)
|
df |
a dataframe |
group |
the grouping variable; must be a |
... |
columns to compare means/proportions |
This function produces either a t.test
or a chisq.test
on each of the columns in ...
. If the variable is.numeric
, conducts t.test
. If the variable is.logical
or is.factor
, conducts chisq.test
. Note that if you are piping into this function with a variable created by dplyr::group_by()
as as your grouping function, you must first dplyr::ungroup()
prior to piping into compare()
(see example).
a data frame
1 | mtcars %>% dplyr::group_by(hp > 150) %>% dplyr::ungroup() %>% comparison(`hp > 150`, hp, am)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.