pairwise_t_tests: Pairwise t-tests() returned in tidy dataframe

pairwise_t_testsR Documentation

Pairwise t-tests() returned in tidy dataframe

Description

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.

Usage

pairwise_t_tests(
  data,
  outcome,
  groups = NULL,
  p.adjust.method = p.adjust.methods,
  conf_level = 0.95,
  var_equal = FALSE,
  na.rm = NULL
)

Arguments

data

A dataframe containing the outcome and grouping variable

outcome

The outcome variable in dataframe, or a formula of the form outcome ~ group. If a formula is provided, the group needs to be empty.

groups

The grouping variable (each distinct value will be treated as a level)

p.adjust.method

The method to adjust p-values for multiple comparison (see stats::p.adjust())

conf_level

confidence level of the interval.

var_equal

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.

na.rm

Logical. Should missing values be removed. If NULL, they are removed with a warning.

Value

A tibble containing the results of the t-tests with one test per row, including a column (apa) formatted for reporting

Examples

## Not run: 
pairwise_t_tests(mtcars, wt, cyl)
pairwise_t_tests(mtcars, wt ~ cyl)

## End(Not run)

LukasWallrich/timesaveR documentation built on Nov. 29, 2024, 4:47 a.m.