[R] visualize TukeyHSD results
Mendiburu, Felipe (CIP)
F.MENDIBURU at CGIAR.ORG
Tue Nov 2 20:44:59 CET 2010
Dear Timothy,
Use library(agricolae)
> library(agricolae)
> a = aov(Weight~Feed)
> HSD.test(a,"Feed")
HSD.test(a,"Feed", group=TRUE)
HSD.test(a,"Feed", group=FALSE)
Regards,
Felipe de Mendiburu.
http://tarwi.lamolina.edu.pe/~fmendiburu
International Potato Center. www.cipotato.org
University: Agraria La Molina - Peru. www.lamolina.edu.pe
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Timothy Spier
Sent: Thursday, October 21, 2010 9:50 PM
To: r-help at r-project.org
Subject: [R] visualize TukeyHSD results
I am a new R user but a long time SAS user. I searched for a response to
this question but no luck, so forgive me if this topic has been covered
before. I am running a TukeyHSD post hoc test after running an ANOVA. I
get the results of all pairwise comparisons, no problem. However, the
output table is a little "busy", and I'd like to make the output easier
to read. Specifically, I would like all groups which are not
significantly different to be given the same letter.
For example, here is a simple ANOVA with Tukey post hoc. It compares
weight gain in pigs among 4 feeds labeled "A", "B", "C", and "D":
> a = aov(Weight~Feed)
> TukeyHSD(a)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = Weight ~ Feed)
$Feed
diff lwr upr p adj
B-A 6.68 1.096263 12.263737 0.0168421
C-A 8.73 2.807553 14.652447 0.0034914
D-A -1.38 -6.963737 4.203737 0.8906642
C-B 2.05 -3.872447 7.972447 0.7530266
D-B -8.06 -13.643737 -2.476263 0.0041505
D-C -10.11 -16.032447 -4.187553 0.0009497
What I really want would look something like this:
Feed Mean TukeyResult
C 73.4 a
B 71.3 a
A 64.6 b
D 63.2 b
Any ideas?
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list