comparison_testers: Comparisons testers

comparison_testersR Documentation

Comparisons testers

Description

These testers are used internally by test but may be of interest outside.

Usage

wilcox_p(df)

kruskal_p(df)

aov_p(df)

Arguments

df

tibble() with two columns named g and y, and with only two levels in group.

Details

These testers are thin wrappers around stats::wilcox.test, stats::kruskal.test and stats::aov. Type wilcox_p (no bracket) for how to build your own.

Value

numeric p.value (or NA_real if not enough data or groups)

Functions

  • wilcox_p: wilcoxon's rank test for pairwise differences

  • kruskal_p: kruskal's test for global differences

  • aov_p: analysis of variance test for both global and pairwise differences

Examples

# dummy tibble
x <- tibble::tibble(g=rep(letters[1:2], each=10),
                   y=stats::runif(20, -1, 1))

wilcox_p(x)
aov_p(x)

# on >2 groups
x$g[15:20] <- "c"
kruskal_p(x)
aov_p(x)

vbonhomme/pataqu documentation built on April 24, 2022, 10:03 p.m.