I would like to figure out if there are significant differences between the following groups. I use R:
group <- c(rep("A",7),rep("B",5),rep("C",8),rep("D",6))
values <- c(32,45,68,29,41,37,78,54,23,33,35,11,30,23,41,42,31,37,22,45,61,34,38,39,28,29)
data <- as.data.frame(group);data$values<-values
I suspect that group A is significantly different from the rest, but when performing ANOVA test:
car::Anova(lm(values~group, data),type=2)
Anova Table (Type II tests)
Response: values
Sum Sq Df F value Pr(>F)
group 952.5 3 1.6008 0.2178
Residuals 4363.4 22
Thus the p-value is 0.217>0.05 which means that there are no significant differences between groups. On the other hand, when using the Tukey test I see that substracting the mean of group A cause more variability concerning the general mean, but I don't know if it is enough to say that group A is significantly different from the rest.
TukeyHSD(AV, conf.level = 0.99)
Tukey multiple comparisons of means
99% family-wise confidence level
Fit: aov(formula = values ~ group, data = T)
$p
diff lwr upr p adj
B-A -15.942857 -44.84640 12.96069 0.2435065
C-A -13.267857 -38.81522 12.27951 0.2908288
D-A -8.976190 -36.43878 18.48640 0.6660606
C-B 2.675000 -25.46578 30.81578 0.9868982
D-B 6.966667 -22.92363 36.85696 0.8458237
D-C 4.291667 -22.36697 30.95030 0.9415981
My question is if there are significant differences between all groups and if the choice of the tests performed is correct. Thank you in advance,
T
is used as a synonym forTRUE
. It's best to not redefine special names, likeT
. So, you might call your data frameData
ordf
or so on. $\endgroup$