Re: [R] ANOVA and confidence intervals plot

From: Max Manfrin <>
Date: Mon 02 Apr 2007 - 16:15:13 GMT

On 02 Apr 2007, at 04:40, Richard M. Heiberger wrote:

>> 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.

> library(multcomp)
> ### multiple comparison procedures
> ### set up a one-way ANOVA
> amod <- aov(breaks ~ tension, data = warpbreaks)
> warp.pairwise <- glht(amod, linfct = mcp(tension = "Means"))
> confint(warp.pairwise)
> plot(warp.pairwise)

Dear Dr. Heiberger,

        thank you for your help. Following the example above I was able to test the independence of each factors in my anova analysis.

My anova model is built in a way similar to this:

myObj.aov <- aov(response~(factor1+factor2+factor2+factor4+factor5) ^2,data=myDataFrame)

I used the code below for each factor of my model:

myObj.pairwise <- glht(myObj.aov, linfct=mcp(factor1="Means")) confint(myObj.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.
> library(HH)
> warp.mmc <- glht.mmc(amod, linfct = mcp(tension = "Tukey"))
> warp.mmc
> plot(warp.mmc)

Unluckly, I was not able to try this last example on my own data.

If I use the following line of code, I obtain an error

myObj.mmc <- glht.mmc(myObj.aov, linfct=mcp(factor1="Tukey"))

 > Error in means %*% abs(lmat.factor) : non -conformable arguments

Thank you for your help.


Max MANFRIN                                 Tel.: +32 (0)2 650 3168
IRIDIA - CoDE, CP 194/6                     Fax.: +32 (0)2 650 2715
Université Libre de Bruxelles
Av. F. D. Roosevelt, 50
1050 Brussels                             Email:
BELGIUM                      WWW:

gpg DSA: 0x7E67B4C4
gpg fingerprint: C2E9 1689 CADD 7CAE 2FAB A355 8FD9 9DD1 7E67 B4C4 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.
Received on Tue Apr 03 02:19:49 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 - 17:30:37 GMT.

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