[R] Anova and tukey-grouping
arun
smartpink111 at yahoo.com
Sun Sep 30 17:45:02 CEST 2012
Hi,
I got your data from Nabble. I meant to do it by dput() because the .csv files may not get through the R-help mailing list.
This is what I got:
dat1<-read.delim("typohne.csv")
str(dat1)
#'data.frame': 60 obs. of 3 variables:
# $ typ : Factor w/ 5 levels "A","B","C","D",..: 1 2 3 4 5 1 2 3 4 5 ...
# $ abun: int 7 3 14 8 15 5 21 19 9 21 ...
# $ div : int 7 3 11 6 14 5 12 15 8 12 ...
summary(fm1<-aov(abun~typ,data=dat1))
# Df Sum Sq Mean Sq F value Pr(>F)
#typ 4 847 211.69 3.654 0.0104 *
#Residuals 55 3186 57.93
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
myresults<-TukeyHSD(fm1,"typ",ordered=TRUE)
myresults
# Tukey multiple comparisons of means
# 95% family-wise confidence level
# factor levels have been ordered
#Fit: aov(formula = abun ~ typ, data = dat1)
#
#$typ
# diff lwr upr p adj
#B-A 6.500000 -2.2633699 15.26337 0.2382355
#D-A 6.750000 -2.0133699 15.51337 0.2055350
#E-A 9.083333 0.3199635 17.84670 0.0386441
#C-A 11.166667 2.4032968 19.93004 0.0060292
#D-B 0.250000 -8.5133699 9.01337 0.9999902
#E-B 2.583333 -6.1800365 11.34670 0.9197106
#C-B 4.666667 -4.0967032 13.43004 0.5657010
#E-D 2.333333 -6.4300365 11.09670 0.9432637
#C-D 4.416667 -4.3467032 13.18004 0.6167517
#C-E 2.083333 -6.6800365 10.84670 0.9619249
library(agricolae)
HSD.test(fm1,"typ",group=TRUE)
#Study:
#HSD Test for abun
#Mean Square Error: 57.92879
#typ, means
# abun std.err replication
#A 6.25000 0.6976693 12
#B 12.75000 2.4061947 12
#C 17.41667 2.9062585 12
#D 13.00000 2.6198543 12
#E 15.33333 1.5970301 12
#alpha: 0.05 ; Df Error: 55
#Critical Value of Studentized Range: 3.988545
#Honestly Significant Difference: 8.76337
#Means with the same letter are not significantly different.
#Groups, Treatments and means
#a C 17.4166666666667
#a E 15.3333333333333
#ab D 13
#ab B 12.75
# b A 6.25
I am not sure why you didn't get the results as above. Check str() to see whether the str() I got matches with yours.
Have a great day!
A.K.
----- Original Message -----
From: Landi <ent-artet at gmx.de>
To: r-help at r-project.org
Cc:
Sent: Friday, September 28, 2012 10:35 AM
Subject: Re: [R] Anova and tukey-grouping
Hello !
Thanks for your advice. I tried it, but the output is the same:
> HSD.test(anova.typabunmit, "typ", group=TRUE)
Name: typ
ds.typabunmit$typ
I don't get the values...!?!?
--
View this message in context: http://r.789695.n4.nabble.com/Anova-and-tukey-grouping-tp4644485p4644513.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
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