0
$\begingroup$

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,

$\endgroup$
4
  • 1
    $\begingroup$ 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]. $\endgroup$ Commented Feb 3, 2020 at 11:23
  • $\begingroup$ That's what I thought, thank you. $\endgroup$
    – fina
    Commented Feb 3, 2020 at 11:40
  • $\begingroup$ 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. $\endgroup$ Commented Feb 3, 2020 at 11:51
  • 1
    $\begingroup$ For reserved names in R, see the documentation $\endgroup$ Commented Feb 3, 2020 at 12:01

1 Answer 1

2
$\begingroup$

(Partially from comments.)

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].

The residuals from the analysis are relatively normal and homoscedastic, so the model is probably a reasonable one.

It does appear that with more data, one might find group A to have higher values that the others.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.