R: Multiple comparisons

From MathWiki

This article is a stub, just the start of a potential article on this topic. Please help the site by improving it.

An easy way to generate Bonferroni -- or even better, Holm -- corrections for multiple hypotheses is


which will transform a set of ordinary p-values into Holm adjusted or even Benjamini & Hochberg and Benjamini & Yekutieli p-values controlling the 'false discovery rate' instead of the 'family-wise error rate'.

Messages on the R mailing list: --Georges Monette 14:21, 15 Sep 2005 (EDT)

R has various methods for multiple comparison procedures. See package 
multcomp, or ?TukeyHSD or ?pairwise.t.test for example. An 
RSiteSearch("multiple comparison") returned 187 results. A priori contrasts 
can be constructed using the make.contrasts function in the gmodels 
package, for example. We try not to do anything like in SAS.


At 11:12 AM 12/09/2005, Hongyu Sun wrote:

>>Hi, Sorry I have to bother a question.
>>Does R have the functions to do lsd, tukey, bonferonni, contrast etc. like
>>in SAS?
>>Many thanks,
>>R-help@stat.math.ethz.ch mailing list
>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Do RSiteSearch("lsmeans") and go from there.


>> From: Felipe
>> Hash: SHA1
>> Thank you, I think multcomp is very near to what I was looking for.
>> However, I am still looking for a mean to obtain least-squares
>> (adjusted) means and std. errors of these means, and performing
>> comparisons among these means, as the LSMEANS do in SAS. I have read
>> other messages and have looked at car, effects and Design 
>> manuals, but I
>> am not sure if this is what I am looking for. Any clue?
>> Felipe
>> Dieter Menne wrote:
>> | Felipe <felipe <at> unileon.es> writes:
>> |
>> |
>> |>With the SAS/STAT, I generally used the MEANS (for comparison of
>> |>arithmetic means) and the LSMEANS (for adjusted means) 
>> statements of the
>> |>GLM procedure (I think it is equivalent to lm in R). They 
>> provided a lot
>> |>of tests: LSD, Duncan, Tukey-Kramer, Bonferroni, Scheffé, SNK, etc.
>> |>However, in R I have only discovered Tukey-HSD.
>> |
>> |
>> | Package multcomp with the workhorse-function simint comes close to
>> what you
>> | want.
>> |
>> |
>> | Dieter
>> |
>> | __
>> iEYEARECAAYFAkMpo6UACgkQWtdQtNzjBl72rwCcCuw5qxD1BWsensDI71RzhNgL
>> MUcAnA0Iq4tfoKSr/ymIV1nEZHZijvLW
>> =pavA
>> -----END PGP SIGNATURE-----