[R] ANOVA and confidence intervals plot

Max Manfrin mmanfrin at ulb.ac.be
Mon Apr 2 18:15:13 CEST 2007


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)
plot(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.

Cheers

--------------------------------------------------------------------
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: mmanfrin at ulb.ac.be
BELGIUM                      WWW: http://iridia.ulb.ac.be/~mmanfrin

gpg DSA: 0x7E67B4C4
gpg fingerprint: C2E9 1689 CADD 7CAE 2FAB A355 8FD9 9DD1 7E67 B4C4
--------------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20070402/59093b15/attachment.bin 


More information about the R-help mailing list