This runs pairwise independent-samples t-tests (assuming unequal variance by default, but can be changed) and returns the results and effect sizes in a tidy dataframe. Beware: It will automatically omit missing values.
pairwise_t_tests(
data,
outcome,
groups = NULL,
p.adjust.method = p.adjust.methods,
conf_level = 0.95,
var_equal = FALSE,
na.rm = NULL
)
A dataframe containing the outcome and grouping variable
The outcome variable in dataframe, or a formula of the form outcome ~ group
. If a formula is provided, the group needs to be empty.
The grouping variable (each distinct value will be treated as a level)
The method to adjust p-values for multiple comparison (see stats::p.adjust()
)
confidence level of the interval.
a logical variable indicating whether to treat the two variances as being equal. If TRUE then the pooled variance is used to estimate the variance otherwise the Welch (or Satterthwaite) approximation to the degrees of freedom is used.
Logical. Should missing values be removed. If NULL, they are removed with a warning.
A tibble containing the results of the t-tests with one test per row, including a column (apa
) formatted for reporting
if (FALSE) { # \dontrun{
pairwise_t_tests(mtcars, wt, cyl)
pairwise_t_tests(mtcars, wt ~ cyl)
} # }