View source: R/GamesHowellTest.R
| GHTest | R Documentation |
Performs the Games-Howell test for pairwise comparisons after ANOVA, without assuming equal variances or sample sizes. It is suitable when Levene or Bartlett test indicates heterogeneity of variances.
GHTest(modelo, comparar = NULL, alpha = 0.05)
modelo |
An |
comparar |
Character vector with the name(s) of the factor(s) to compare:
- One name: main effect (e.g., "treatment" or "A")
- Several names: interaction (e.g., |
alpha |
Significance level (default is 0.05). |
Advantages: - Excellent for heteroscedastic data. - Controls Type I error across unequal group sizes.
Disadvantages: - Slightly conservative in small samples. - More complex to compute than Tukey.
An object of class "gameshowell" and "comparaciones",
which contains:
Resultados: A data frame with pairwise comparisons, including:
Comparacion, Diferencia, t_value, gl,
p_value, and Significancia.
Promedios: A named numeric vector of group means as defined by comparar.
Orden_Medias: Group names ordered from highest to lowest mean.
Metodo: A character string indicating the method used ("Games-Howell").
Termino: The term being compared (e.g., "A", "B", or "A:B").
Games, P. A., & Howell, J. F. (1976). "Pairwise Multiple Comparison Procedures with Unequal N's and/or Variances: A Monte Carlo Study". Journal of Educational Statistics, 1(2), 113–125. <https://doi.org/10.1002/j.2162-6057.1976.tb00211.x>
data(d_e, package = "Analitica")
mod <- aov(Sueldo_actual ~ as.factor(labor), data = d_e)
# Comparación sobre el primer factor del modelo
resultado <- GHTest(mod)
summary(resultado)
plot(resultado)
# Con bloques, comparando solo el factor de interés
mod2 <- aov(Sueldo_actual ~ as.factor(labor) + Sexo, data = d_e)
res2 <- GHTest(mod2, comparar = "as.factor(labor)")
summary(res2)
plot(res2)
# Modelo con interacción
mod3 <- aov(Sueldo_actual ~ as.factor(labor) * Sexo, data = d_e)
# efecto principal
resA <- GHTest(mod3, comparar = "as.factor(labor)")
# interacción
resAB <- GHTest(mod3, comparar = c("as.factor(labor)", "Sexo"))
summary(resAB)
plot(resAB)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.