R/stat_tests.R
get_pairwise_letters.Rd
This takes the results of multiple comparisons and returns a set of letters that can be used to indicate which differences are significant. The difference between levels that are assigned the same letter are not statistically different.
get_pairwise_letters(tests, alpha_level = 0.05)
Algorithm based on finding maximal cliques of non-significant comparisons.
A tibble with the group level, a combined letters string, and individual columns for each letter assigned. The tibble is sorted by level.
# Works with pairwise.htest objects
library(tibble)
library(dplyr)
pwtt <- pairwise.t.test(airquality$Ozone, airquality$Month)
get_pairwise_letters(pwtt)
#> # A tibble: 5 × 5
#> level letters a b c
#> <chr> <chr> <chr> <chr> <chr>
#> 1 5 a a NA NA
#> 2 6 ab a b NA
#> 3 7 bc NA b c
#> 4 8 c NA NA c
#> 5 9 a a NA NA