While reading Discovering Statistics Using R pp. 431-432, Dr. Field says that

"There are a variety of tests designed to deal with these situations [multiple comparison procedures with unequal group sizes &/or different population variances], none of which are implemented in R. Hochberg's GT2 is one such test and is worth mentioning because it is not implemented in R...

I didn't find anything in a Google search that indicated otherwise neither have I found an alternative post-hoc test for this situation.

So, does anybody know if R has post hoc tests robust to unequal sample sizes/population variances?


3 Answers 3


Robustness would not come from the package used to do post hoc tests. It would come from the model upon which they are based.

If you were to use, for example, nlme::gls() to model the data, that would allow for unequal variances and accommodate unbalanced data. Then, following that up with multcomp::glht() or lsmeans::lsmeans() would provide post hoc tests that inherit their robustness from the robustness of the model used. There are probably other modeling options in other R packages as well.


It's not been added to R, because no one thought it was important enough to add to R.

SPSS seems to have taken a scattergun approach to post hoc tests - they've just kept adding them. Stuff that appears in (say) SPSS is based on marketing, rather than need. SPSS thinks that they can say "We have more post hoc tests than SAS, Stata and Statistica put together, so you should buy our software". One rarely sees these tests mentioned outside the context of SPSS (and rarely outside the context of books that try to cover everything in a particular SPSS function). A slight problem with that book is that it's a rewrite of a book that was written for SPSS, and so sometimes a different structure would be sensible, so that it matched R, not SPSS.

For R, if someone cared enough to put it in, someone will have put it in. The fact that people have found the time to write thousands of packages for R, and none of them included (say) the Hochberg GT2 test might be telling us something.

If you really must do these post hoc tests (I'm not a fan, and rarely do them), I guess you have two choices: You could bootstrap it. You could write it yourself. The algorithms that SPSS uses are publised here: ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/20.0/en/client/Manuals/IBM_SPSS_Statistics_Algorithms.pdf

Also, note that this issue came up several years ago on the R help list (I suspect they'd read the same book), https://stat.ethz.ch/pipermail/r-help/2005-November/083595.html


'DTK' package in R has Dunnett’s Modified Tukey-Kramer Pairwise Multiple Comparison Test.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.