Post-hoc tests for one-way ANOVA with Welch's correction in R

jjulip picture jjulip · Feb 18, 2015 · Viewed 9.6k times · Source

I have run a one-way ANOVA test with welch's correction using oneway.test() in R, as I have data that violate the assumption of equal variance (transformations did not solve the problem).

A simple data example:

> dput(df)
structure(list(Count = c(13, 14, 14, 12, 11, 13, 14, 15, 13, 
12, 20, 15, 9, 5, 13, 14, 7, 17, 18, 14, 12, 12, 13, 14, 11, 
10, 15, 14, 14, 13), Group = structure(c(1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("a", "b", "c"
), class = "factor")), .Names = c("Count", "Group"), row.names = c(NA, 
-30L), class = "data.frame")

library(car) 
grp = as.factor(c(rep(1, 10), rep(2, 10),rep(3, 10)))
leveneTest(df$Count,grp) #unequal variances

#one-way ANOVA with welch's correction
oneway.test(Count ~ Group, data=df, na.action=na.omit, var.equal=FALSE)

I have multiple groups so I would now like to run pairwise post-hoc tests. Is there anyway to do this with an object from the oneway.test() function? If not, how would one go about running pair-wise tests on groups with unequal variances? I have not been able to find an answer to this question online. Any advice would be appreciated.

Answer

Ana Maria Mendes-Pereira picture Ana Maria Mendes-Pereira · Jun 26, 2015

Just to add, despite the bad timing and given than I have been seeking for something similar myself, there is also the option to perform a Games-Howell test. This has even been incorporated under the 'posthoc.tgh' function in the 'userfriendlyscience' R package as introduced in this stackexchange_post. It represents an extension of the Tukey‐Kramer test for unequal variances. posthocTGH {userfriendlyscience}

Original publication (even from before I was born): Paul A. Games and John F. Howell. Pairwise Multiple Comparison Procedures with Unequal N's and/or Variances: A Monte Carlo Study. Journal of Educational & Behavioral Statistics, Vol.1, No. 2, 1976, pp. 113-125. doi: 10.3102/10769986001002113