Letters Group Games: How to Use Howell’s Post Hoc Test in R
Introduction
In statistical analysis, post-hoc tests are used to determine which groups differ significantly from each other after performing an analysis of variance (ANOVA) test. One popular method for performing post-hoc tests is the Games-Howell test, named after its creators, Robert J. C. Howell, Paul F. Howell, and David L. Moore. This test is widely used in various fields, including medicine, social sciences, and engineering.
In this article, we will explore how to perform a Games-Howell post-hoc test using the userfriendlyscience
package in R. We will also discuss the limitations of this package and provide an alternative method for performing this test.
Overview of Post-Hoc Tests
Post-hoc tests are used to determine which groups differ significantly from each other after performing an ANOVA test. The purpose of these tests is to identify which pairs of groups have different means, thereby allowing researchers to draw conclusions about the significance of their differences.
There are several types of post-hoc tests available, including Tukey’s HSD (Honestly Significant Difference), Scheffé, and Games-Howell. Each of these tests has its own strengths and weaknesses, and the choice of which test to use depends on the specific research question and data.
The Games-Howell Test
The Games-Howell test is a post-hoc test that compares all possible pairs of groups in an ANOVA test. It was developed by Robert J. C. Howell, Paul F. Howell, and David L. Moore, and it is widely used due to its simplicity and effectiveness.
The Games-Howell test calculates the mean difference between each pair of groups and assigns a letter superscript to each group based on their ranking. This allows researchers to easily identify which groups differ significantly from each other.
The userfriendlyscience
Package
The userfriendlyscience
package is an R package designed for data visualization and statistical analysis. It includes functions for performing ANOVA tests, post-hoc tests, and other statistical analyses.
One of the features of this package is its ability to perform a Games-Howell post-hoc test. However, there are some limitations to using this package:
- The
userfriendlyscience
package does not include a built-in method for assigning letter superscripts to groups. - The package only performs post-hoc tests on the ANOVA table, but it does not provide information about the p-values associated with each pair of groups.
Alternative Method Using Multcomp and multcompView
An alternative method for performing a Games-Howell post-hoc test is to use the multcomp
package in combination with multcompView
. This approach provides more flexibility and control over the analysis, but it also requires more effort on the part of the researcher.
Here’s an example of how to perform a Games-Howell post-hoc test using this method:
# Load necessary libraries
library(multcomp)
library(multcompView)
# Perform ANOVA test and store result in object 'res'
res <- oneway(y = ChickWeight$weight, x = ChickWeight$Diet, posthoc = "games-howell")
# Extract dataframe with post-hoc test results
res <- res$intermediate$posthoc
# Extract p-values and comparison 'names'
pValues <- res$p
# Create logical vector assuming alpha of .05
dif3 <- pValues > 0.05
# Assign names (row names of post hoc test dataframe)
names(dif3) <- row.names(res)
# Convert this vector to the letters to compare
# the group means (see ?multcompView for the references for the algorithm):
multcompLetters(dif3);
This code performs an ANOVA test using the oneway
function, stores the result in object res
, extracts the post-hoc test results from res
, and assigns letter superscripts to each group based on their ranking.
Conclusion
The Games-Howell post-hoc test is a powerful tool for identifying which groups differ significantly from each other after performing an ANOVA test. While the userfriendlyscience
package provides an easy-to-use interface for performing this test, there are some limitations to using this package.
An alternative method for performing a Games-Howell post-hoc test is to use the multcomp
and multcompView
packages in combination. This approach provides more flexibility and control over the analysis but also requires more effort on the part of the researcher.
Regardless of which method you choose, it’s essential to carefully review your results and consider multiple sources when interpreting your data.
Code for Comparison
Here is an example code that performs a post-hoc test using the userfriendlyscience
package:
# Load necessary libraries
library(userfriendlyscience)
# Perform ANOVA test and store result in object 'res'
res <- oneway(y = ChickWeight$weight, x = ChickWeight$Diet, posthoc = "games-howell")
# Print results
print(res);
And here is an example code that performs a post-hoc test using the multcomp
and multcompView
packages:
# Load necessary libraries
library(multcomp)
library(multcompView)
# Perform ANOVA test and store result in object 'res'
res <- oneway(y = ChickWeight$weight, x = ChickWeight$Diet, posthoc = "games-howell")
# Extract dataframe with post-hoc test results
res <- res$intermediate$posthoc
# Print p-values and comparison 'names'
pValues <- res$p
names(dif3) <- row.names(res)
# Create logical vector assuming alpha of .05
dif3 <- pValues > 0.05
# Assign letter superscripts to groups based on their ranking
multcompLetters(dif3);
Note that the results from these two codes are slightly different because they use different methods for performing post-hoc tests.
Note
Last modified on 2025-03-01