# Checking ANOVA for unbalanced data

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

• There is no indication in the results of the Tukey HSD test that group A is different than the other groups. The p values for each comparison are greater than 0.24. [e.g. 0.24, 0.29, 0.67]. Also, the confidence interval for each difference between groups includes 0. [e.g. B-A has limits of -44.8 and 12.96]. – Sal Mangiafico Feb 3 at 11:23
• That's what I thought, thank you. – fina Feb 3 at 11:40
• One other comment: In R, T is used as a synonym for TRUE. It's best to not redefine special names, like T. So, you might call your data frame Data or df or so on. – Sal Mangiafico Feb 3 at 11:51
• For reserved names in R, see the documentation – Sal Mangiafico Feb 3 at 12:01