Performs pairwise permutation tests for all combinations of groups in a factor.

pairwise_permutation_tests(
  df,
  group,
  vals,
  n = 1000,
  type = "two-tailed",
  seed = 123,
  ci = 0.95
)

Arguments

df

A data.frame or tibble containing the data.

group

The grouping variable.

vals

Numeric response variable.

n

Number of permutations. Default 1000.

type

Type of test: `"two-tailed"` or `"one-tailed"`.

seed

Random seed for reproducibility.

ci

Confidence level for null distribution (default 0.95).

Value

A tibble with columns:

group1

First group in the comparison.

group2

Second group in the comparison.

p_value

Permutation p-value.

observed_statistic

Observed difference in means.

ci_low

Lower bound of confidence interval.

ci_high

Upper bound of confidence interval.