fat <- c(64, 72, 68,77,56,95,
78, 91, 97, 82, 85, 77,
75,93,78,71,63,76,
55,66,49,64,70,68)
Fat_type= c(rep("Fat1",6), rep("Fat2",6), rep("Fat3",6), rep("Fat4",6))
dataset<- data.frame(fat,Fat_type)
plot(fat ~ Fat_type, data=dataset)
comments
results = aov(fat~ Fat_type, data=dataset)
summary(results)
Df Sum Sq Mean Sq F value Pr(>F)
Fat_type 3 1636 545.5 5.406 0.00688 **
Residuals 20 2018 100.9
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
I reject the Null Hypothesis that the means are the same. The value is very small.
pairwise.t.test(fat, Fat_type, p.adjust="bonferroni")
Pairwise comparisons using t tests with pooled SD
data: fat and Fat_type
Fat1 Fat2 Fat3
Fat2 0.2189 - -
Fat3 1.0000 0.8182 -
Fat4 0.6005 0.0046 0.1529
P value adjustment method: bonferroni
There is a significant difference between Fat 2 at Fat 3 and Fat 2 at Fat 4.
TukeyHSD(results, conf.level = 0.95)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = fat ~ Fat_type, data = dataset)
$Fat_type
diff lwr upr p adj
Fat2-Fat1 13 -3.232221 29.232221 0.1461929
Fat3-Fat1 4 -12.232221 20.232221 0.8998057
Fat4-Fat1 -10 -26.232221 6.232221 0.3378150
Fat3-Fat2 -9 -25.232221 7.232221 0.4270717
Fat4-Fat2 -23 -39.232221 -6.767779 0.0039064
Fat4-Fat3 -14 -30.232221 2.232221 0.1065573
There is a significant difference between Fat 2 and Fat 4. That P Value is much smaller than 0.05. Thus, we reject the null.