Re: [R] ANOVA and confidence intervals plot

From: Richard M. Heiberger <>
Date: Mon 02 Apr 2007 - 02:40:01 GMT

> I would like to obtain for each factor of my anova model the
> "response variable vs factor" plot with means and 95% Tukey HSD
> intervals.

I believe you are asking for the multiple comparisons plots from the multcomp package. The example below is an extension of one of the examples in ?glht:


      ### multiple comparison procedures
       ### set up a one-way ANOVA
       amod <- aov(breaks ~ tension, data = warpbreaks)

       ### set up all-pair comparisons for factor `tension'
       ### using a symbolic description (`type' argument 
       ### to `contrMat()')

warp.mca <- glht(amod, linfct = mcp(tension = "Tukey"))


You asked about the level means themselves, rather than the pairwise comparisons above. That is done with

warp.pairwise <- glht(amod, linfct = mcp(tension = "Means")) confint(warp.pairwise)

I recommend the MMC (Mean-mean Multiple Comparison) plot that includes both sets of information, pairwise comparisons and individual means, and also allows arbitrary contrasts.

warp.mmc <- glht.mmc(amod, linfct = mcp(tension = "Tukey")) warp.mmc

See the help files
for more details. Both glht and glht.mmc extend to multi-way designs. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon Apr 02 12:45:10 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 02 Apr 2007 - 16:30:35 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.