Primer ejercicio
#Ejercicio en la guía ANOVA
efi <- c(63,60,61,62,67,63,71,69,68,67,70,71)
set <- as.factor(c(1,1,1,1,2,2,2,2,3,3,3,3))
summary(aov(efi~set))
Df Sum Sq Mean Sq F value Pr(>F)
set 2 126 63.00 11.34 0.00347 **
Residuals 9 50 5.56
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
TukeyHSD(aov(efi~set))
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = efi ~ set)
$set
diff lwr upr p adj
2-1 6.0 1.346657 10.653343 0.0143238
3-1 7.5 2.846657 12.153343 0.0038138
3-2 1.5 -3.153343 6.153343 0.6537573
gplots::plotmeans(efi~set,n.label = F, ci.label = T)
NA
NA
NA
Segundo ejercicio
# Ejercicio Trainees
time <- c(9,12,11,14,13,10,6,9,9,10,12,14,11,13,11,9,8,11,7,8)
program <- as.factor(c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4))
fit0 <- aov(time~program)
summary (fit0)
Df Sum Sq Mean Sq F value Pr(>F)
program 3 54.95 18.32 7.045 0.00311 **
Residuals 16 41.60 2.60
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
TukeyHSD(fit0)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = time ~ program)
$program
diff lwr upr p adj
2-1 -3.0 -5.9176792 -0.08232082 0.0427982
3-1 0.4 -2.5176792 3.31767918 0.9788127
4-1 -3.2 -6.1176792 -0.28232082 0.0291638
3-2 3.4 0.4823208 6.31767918 0.0197459
4-2 -0.2 -3.1176792 2.71767918 0.9972140
4-3 -3.6 -6.5176792 -0.68232082 0.0133087
gplots::plotmeans(time~program, n.label = F, ci.label = T)