[R] ANOVA and confidence intervals plot

Richard M. Heiberger rmh at temple.edu
Mon Apr 2 04:40:01 CEST 2007

> 	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"))

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"))

See the help files
for more details.  Both glht and glht.mmc extend to multi-way designs.

More information about the R-help mailing list