Learn R Programming

kim (version 0.5.3)

t_test_pairwise: t test, pairwise

Description

Conducts a t-test for every possible pairwise comparison with Bonferroni correction

Usage

t_test_pairwise(
  data = NULL,
  iv_name = NULL,
  dv_name = NULL,
  sigfigs = 3,
  cohen_d = TRUE,
  cohen_d_w_ci = TRUE,
  bonferroni = TRUE,
  mann_whitney = TRUE,
  t_test_stats = FALSE,
  t_test_df_decimals = 1,
  sd = FALSE
)

Value

the output will be a data.table showing results of all pairwise comparisons between levels of the independent variable.

Arguments

data

a data object (a data frame or a data.table)

iv_name

name of the independent variable

dv_name

name of the dependent variable

sigfigs

number of significant digits to round to

cohen_d

if cohen_d = TRUE, Cohen's d statistics will be included in the output data.table.

cohen_d_w_ci

if cohen_d_w_ci = TRUE, Cohen's d with 95% CI will be included in the output data.table.

bonferroni

if bonferroni = TRUE, Bonferroni tests will be conducted for t-tests or Mann-Whitney tests.

mann_whitney

if TRUE, Mann-Whitney test results will be included in the output data.table. If FALSE, Mann-Whitney tests will not be performed.

t_test_stats

if t_test_stats = TRUE, t-test statistic and degrees of freedom will be included in the output data.table.

t_test_df_decimals

number of decimals for the degrees of freedom in t-tests (default = 1)

sd

if sd = TRUE, standard deviations will be included in the output data.table.

Examples

Run this code
if (FALSE) {
t_test_pairwise(data = iris, iv_name = "Species", dv_name = "Sepal.Length")
t_test_pairwise(data = iris, iv_name = "Species",
dv_name = "Sepal.Length", t_test_stats = TRUE, sd = TRUE)
t_test_pairwise(data = iris, iv_name = "Species", dv_name = "Sepal.Length",
mann_whitney = FALSE)
}

Run the code above in your browser using DataLab