Games-Howell, Tukey HSD and other post-hoc tests for ANOVA and Welch ANOVA. Either Games-Howell test or Tukey honestly significant difference (HSD) post-hoc tests for one-way analysis of variance (ANOVA).
posthoc_anova( y, group = NULL, method = c("Games-Howell", "Tukey"), conf_level = 0.95, digits = 3, digits_p = 3, p_adjust = "none", format_pvalue = TRUE, data = NULL, ... ) # S3 method for formula posthoc_anova( y, group = NULL, method = c("Games-Howell", "Tukey"), conf_level = 0.95, digits = 3, digits_p = 3, p_adjust = "none", format_pvalue = TRUE, data = NULL, ..., sep = " | " ) # S3 method for default posthoc_anova( y, group = NULL, method = c("Games-Howell", "Tukey"), conf_level = 0.95, digits = 3, digits_p = 3, p_adjust = "none", format_pvalue = TRUE, data = NULL, ... ) # S3 method for posthoc_anova print( x, digits = x$input$digits, digits_p = x$input$digits_p, digits_param = 2, ... ) # S3 method for posthoc_anova plot( x, ..., zero_line_color = "grey", add_p = TRUE, p_size = 1, p_color = "blue", p_pos_adj = 0.22, flip_xy = TRUE )
y | (numeric|formula) |
---|---|
group | (factor) |
method | ( |
conf_level | (number) |
digits | (integer) |
digits_p | (integer) |
p_adjust | Any valid |
format_pvalue | (does not work yet) |
data | (data frame) |
... | Further arguments to methods. |
sep | (character) |
x | object to print. |
zero_line_color | (character) Color for line indicating zero differences. |
add_p | (logical) Flag if p values should be added. |
p_size | (numeric) Font size to p-values-related text. |
p_color | (character) Color for p values. |
p_pos_adj | (numeric) Factor for p value position correction |
flip_xy | (logical) Flag if x and y axes should be swapped. |
A list of three elements:
List with input arguments
List with post-hoc test results
The main part of the function code and descriptions were
imported from posthocTGH()
in package userfriendlyscience.
Options that carry out Games-Howell and Tukey HSD analyses are based
on code of function posthocTGH()
in package userfriendlyscience
(version 0.7.0).
library(biostat) # Compute post-hoc statistics using the Games-Howell method posthoc_anova(weight ~ Diet, data = ChickWeight, method = "Games-Howell")#> Games-Howell test results (ANOVA post-hoc) #> #> groups difference ci_lower ci_upper t df p #> 1 2-1 19.971 0.358 39.585 2.64 201.38 0.044 * #> 2 3-1 40.305 17.544 63.065 4.59 175.92 <0.001 *** #> 3 4-1 32.617 13.452 51.783 4.41 203.16 <0.001 *** #> 4 3-2 20.333 -6.203 46.870 1.98 229.94 0.197 #> 5 4-2 12.646 -10.909 36.201 1.39 235.88 0.507 #> 6 4-3 -7.687 -33.899 18.524 0.76 226.16 0.873 #> #> group n mean variance sd cld spaced_cld #> 1 1 220 102.645 3209.965 56.657 a a_ #> 2 2 120 122.617 5127.633 71.607 b _b #> 3 3 120 142.950 7489.476 86.542 b _b #> 4 4 118 135.263 4737.392 68.829 b _b# Compute post-hoc statistics using the Tukey method posthoc_anova(weight ~ Diet, data = ChickWeight, method = "Tukey")#> Tukey HSD test results (ANOVA post-hoc) #> #> groups difference ci_lower ci_upper t df p #> 1 2-1 19.971 -0.300 40.242 2.54 574.00 0.055 . #> 2 3-1 40.305 20.034 60.576 5.12 574.00 <0.001 *** #> 3 4-1 32.617 12.235 52.999 4.12 574.00 <0.001 *** #> 4 3-2 20.333 -2.727 43.394 2.27 574.00 0.106 #> 5 4-2 12.646 -10.512 35.804 1.41 574.00 0.495 #> 6 4-3 -7.687 -30.845 15.470 0.86 574.00 0.828 #> #> group n mean variance sd cld spaced_cld #> 1 1 220 102.645 3209.965 56.657 a a_ #> 2 2 120 122.617 5127.633 71.607 ab ab #> 3 3 120 142.950 7489.476 86.542 b _b #> 4 4 118 135.263 4737.392 68.829 b _b