The Games-Howell Test in R: Post-hoc Comparisons for Unequal Variances

The Games-Howell test is a post-hoc technique designed to perform multiple comparisons between group means when the variances are not homogeneous.. Unlike the Tukey test, which assumes equal variances, Games-Howell is more robust to heterogeneity of variances and differences in sample sizes.

When to use the Games-Howell Test?

  • Unequal variances: When Levene's test indicates that the variances between groups are not homogeneous (p < 0.05).
  • Unequal sample sizes: Useful when group sizes are very different.
  • After a Welch ANOVA: When the ANOVA shows significant differences (p < 0.05), but the variances are not homogeneous.

Implementation in R

An R, Games-Howell test is not included in base packages, but it can be easily done with the package userfriendlyscience.

Paso 1: Package Installation and Loading
# Instalar y cargar el paquete
if (!require(userfriendlyscience)) install.packages("userfriendlyscience")
library(userfriendlyscience)
Paso 2: Example Data

We will use the data set PlantGrowth included in R. This dataset has 30 observations divided into three groups (ctrl, trt1, Y trt2), and we will measure if the weight means differ significantly.

# Visualizar los datos
head(PlantGrowth)
Paso 3: Check Variances with Levene's Test

Before proceeding, we check if the variances are homogeneous:

library(car)

# Prueba de Levene
leveneTest(weight ~ group, data = PlantGrowth)

Interpretation:

  • If the p-value is less than 0.05, the variances are not homogeneous and the Games-Howell test is appropriate.
Paso 4: Apply the Games-Howell Test

We use the function posthocTGH() to perform the Games-Howell test.

# Prueba de Games-Howell
games_howell_result <- posthocTGH(y = PlantGrowth$weight, x = PlantGrowth$group, method = "games-howell")
print(games_howell_result)

Interpretation of Results

The output shows comparisons between pairs of groups, including:

  1. Mean difference: The average difference between the compared groups.
  2. Confidence interval: A range in which we are confident that the real difference between the means lies.
  3. Adjusted p-value: If this value is less than 0.05, indicates that the difference between the means is statistically significant.

For example:

    group1 group2    mean.difference   p.value
1     ctrl    trt1         -0.371      0.025
2     ctrl    trt2         -0.492      0.001
3     trt1    trt2         -0.121      0.456

Interpretation:

  • The group ctrl has a significantly lower mean than trt2 (p = 0.001) Y trt1 (p = 0.025).
  • There are no significant differences between trt1 Y trt2 (p = 0.456).

Advantages of the Games-Howell Test

  1. Robustness to unequal variances: It is ideal when the assumptions of the classic ANOVA are not met..
  2. Type I error control: Adjust p-values ​​for multiple comparisons.
  3. Versatility: Works well even with uneven sample sizes.

Limitations

  1. Greater computational complexity: May be slower with large volumes of data.
  2. Less intuitive than Tukey: Especially for those familiar with traditional analytics.

Conclusion

The Games-Howell test is a powerful tool for performing multiple comparisons when variances are not homogeneous.. An R, Its implementation is simple thanks to packages such as userfriendlyscience, enabling accurate and robust analyzes in real-world contexts.

Leave a Comment

Your email address will not be published. Required fields are marked *