Professional Documents
Culture Documents
Isye 6421: Biostatistics: Analysis of Variance (Anova) Pairwise Comparison For Confidence Intervals
Isye 6421: Biostatistics: Analysis of Variance (Anova) Pairwise Comparison For Confidence Intervals
Isye 6421: Biostatistics: Analysis of Variance (Anova) Pairwise Comparison For Confidence Intervals
1
Recall Our Example
Group 1 2 3 4
65 75 59 94
87 69 78 89
73 81 67 80
79 62 88
76 75 66.5 87.75
Questions:
• One might guess that 𝝁𝟒 > 𝝁𝟏 > 𝝁𝟐 > 𝝁𝟑 , but are they
statistically significantly different?
• We need to adjust multiple comparisons.
2
Multiple Comparison
3
Tukey Method
4
R code for one-way ANOVA
score <- c(65, 87, 73, 79, 75, 69, 81, 59, 78, 67, 62,
94, 89, 80, 88)
type <- as.factor(c(rep(1,4), rep(2,3), rep(3,4), rep(4,4)));
score.aov <- aov(score ~ type)
summary(score.aov)
5
TukeyHSD(score.aov,conf.level=0.95)
TukeyHSD(score.aov, conf.level=0.95)
## Output
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = score ~ type)
$type
diff lwr upr p adj
2-1 -1.00 -18.556836 16.556836 0.9980975
3-1 -9.50 -25.754471 6.754471 0.3416067
4-1 11.75 -4.504471 28.004471 0.1898345
3-2 -8.50 -26.056836 9.056836 0.4929037
4-2 12.75 -4.806836 30.306836 0.1869988
4-3 21.25 4.995529 37.504471 0.0106831
6
Bonferroni vs Tukey
The CIs for i-k are of the form
𝟏 𝟏
ഥ 𝒊⋅ − 𝒀
𝒀 ഥ 𝒌⋅ ± 𝑪 +
𝒏𝒊 𝒏𝒌
Bonferroni Tukey
1-2 (-17.3, 19.3) (-16.6, 18.6)
1-3 (-7.5, 26.5) (-6.8,25.8)
1-4 (-28.7,5.2) (-28.0,4.5)
2-3 (-9.8, 26.8) (-9.1, 26.1)
2-4 (-31.1,5.6) (-30.3,4.8)
3-4 (-38.2,-4.3) (-37.5,-5.0)
7
Conclusion from TukeyHSD
Group 1 2 3 4
65 75 59 94
87 69 78 89
73 81 67 80
79 62 88
76 75 66.5 87.75
Conclusions:
• 𝝁𝟒 > 𝝁𝟑
• 𝝁𝟑 = 𝝁𝟏 = 𝝁𝟐
• 𝝁𝟒 = 𝝁𝟏 = 𝝁𝟐
8
plot(TukeyHSD(score.aov,conf.level=0.95))
9
Summary
10