[R] multiple comparison tests & simultaneous multiple plots

Douglas Bates bates at stat.wisc.edu
Fri Aug 4 04:03:59 CEST 2000


Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> writes:

> Steve Arthur <sarthur at protogene.com> writes:
> 
> > Does R support multiple comparison tests (Tukey, Bonferroni, etc...) and
> > are they easy to implement?
> 
> Bonferroni is in pairwise.t.test. The studentized range distribution
> is there (ptukey & friends) and doing Tukey multiple comparisons is
> relatively trivial with that in hand *provided* the groups have the
> same size and the variances are equal. I believe Doug Bates recently
> rolled up a function for Tukey comparisons with the popular
> approximation for unequal group sizes?

It's in the Devore5 contributed package on CRAN.

 > library(Devore5)
 > example(Tukey)

 Tukey> data(xmp10.01)

 Tukey> fm1 <- aov(strength ~ type, data = xmp10.01)

 Tukey> Tukey(fm1)
   Tukey multiple comparisons of means
     95% family-wise confidence level

 Fit: aov(formula = strength ~ type, data = xmp10.01)

 $type
           diff        lwr         upr
 B-A   43.93333  -22.53671  110.403377
 C-A  -14.93333  -81.40338   51.536711
 D-A -150.98333 -217.45338  -84.513289
 C-B  -58.86667 -125.33671    7.603377
 D-B -194.91667 -261.38671 -128.446623
 D-C -136.05000 -202.52004  -69.579956


 Tukey> Tukey(fm1, ord = TRUE, conf = 0.9)
   Tukey multiple comparisons of means
     90% family-wise confidence level
     factor levels have been ordered

 Fit: aov(formula = strength ~ type, data = xmp10.01)

 $type
          diff         lwr       upr
 C-D 136.05000  77.9216830 194.17832
 A-D 150.98333  92.8550163 209.11165
 B-D 194.91667 136.7883497 253.04498
 A-C  14.93333 -43.1949837  73.06165
 B-C  58.86667   0.7383497 116.99498
 B-A  43.93333 -14.1949837 102.06165

-- 
Douglas Bates                            bates at stat.wisc.edu
Statistics Department                    608/262-2598
University of Wisconsin - Madison        http://www.stat.wisc.edu/~bates/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list