pairwise_fisher_test: Pairwise Fisher's exact tests

Description Usage Arguments Value Examples

View source: R/tests.R

Description

pairwise_fisher-test calculates pairwise comparisons between group levels with corrections for multiple testing.

Usage

1
2
3
4
5
6
7
8
pairwise_fisher_test(
  dep_var,
  indep_var,
  adjmethod = "fdr",
  plevel = 0.05,
  symbols = letters[-1],
  ref = FALSE
)

Arguments

dep_var

dependent variable, containing the data.

indep_var

independent variable, should be factor or coercible.

adjmethod

method for adjusting p values (see p.adjust).

plevel

threshold for significance.

symbols

predefined as b,c, d...; provides footnotes to mark group differences, e.g. b means different from group 2

ref

is the 1st subgroup the reference (like in Dunnett test)?

Value

A list with elements "methods" (character), "p.value" (matrix), "plevel" (numeric), and "sign_colwise" (vector of length number of levels - 1)

Examples

1
2
3
4
# All pairwise comparisons
pairwise_fisher_test(dep_var = mtcars$cyl, indep_var = mtcars$gear)
# Only comparison against reference gear=3
pairwise_fisher_test(dep_var = mtcars$cyl, indep_var = mtcars$gear, ref = TRUE)

wrappedtools documentation built on Sept. 6, 2021, 5:08 p.m.