ANOVA Powerpoint
Download
Report
Transcript ANOVA Powerpoint
Principles of Biostatistics
ANOVA
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
10
13
9
8
12
10
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
10
13
9
8
12
10
ANOVA (Analysis of Variance)
Assumptions:
• Samples are independent (within and among groups)
• Population variances are equal
• Populations are normally distributed
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
9.4
11.6
10
10.33
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Diet
Standard
Junk Food
Organic
9
10
9
Diet
Standard
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
Square Deviations (within groups)
(9-9.4)2
(10-9.4)2 (10-9.4)2 (10-9.4)2
(8-9.4)2
Junk Food (10-11.6)2 (10-11.6)2 (13-11.6)2 (13-11.6)2 (12-11.6)2
Organic
Diet
Standard
Junk Food
Organic
(9-10)2
(10-10)2
(12-10)2
(9-10)2
Square Deviations (within groups)
0.16
0.36
0.36
0.36
2.56
2.56
1.96
1.96
1
0
4
1
(10-10)2
1.96
0.16
0
9.4
11.6
10
10.33
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Diet
Standard
Junk Food
Organic
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
Square Deviations (within groups)
0.16
0.36
0.36
0.36
2.56
2.56
1.96
1.96
1
0
4
1
8
12
10
1.96
0.16
0
Sum of Squares (within groups) 18.4
Degrees of Freedom 3(5 1) 12
Mean Square (within groups)
18.4
1.533
12
9.4
11.6
10
10.33
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
9.4
11.6
10
10.33
Diet
Square Deviations (between groups)
Standard
(9.4-10.33)2
Junk Food
(11.6-10.33)2
Organic
(10-10.33)2
Diet
Standard
Junk Food
Organic
Square Deviations (between groups)
0.87
1.60
0.11
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
Diet
Standard
Junk Food
Organic
8
12
10
9.4
11.6
10
10.33
Square Deviations (between groups)
0.87
1.60
0.11
Sum of Squares (between groups) (0.87 1.60 0.11)(5) 12.9
Degrees of Freedom 3 1 2
Mean Square (between groups)
12.9
6.45
2
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Mean Square (between groups)
F
Mean Square (within groups)
6.45
4.21
1.533
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gai (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
9.4
11.6
10
10.33
• Table shows weight gains for mice on 3 diets.
• Test the following hypothesis at the α = 0.05 sig level.
H0 : 1 2 3 vs Ha : 1 2 or 1 3 or 2 3
Mean Square (between groups)
F
Mean Square (within groups)
6.45
4.21
1.533
F2,12 (0.95) 3.89
Reject H0
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gai (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
9.4
11.6
10
10.33
Calculating the p-value
0.05
p-value 0.041
p-value 0.05
Since p-value we Reject H0
Post-hoc Tests
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
10
13
9
8
12
10
H 0 : 1 2 3 vs H a : 1 2 or 1 3 or 2 3
Rejected H0
Post-hoc Tests
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
10
13
9
8
12
10
H 0 : 1 2 3 vs H a : 1 2 or 1 3 or 2 3
Rejected H0
Need to test each pair
H 0 : 1 2 vs H a : 1 2
H 0 : 1 3 vs H a : 1 3
H 0 : 2 3 vs H a : 2 3
Post-hoc Tests
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
10
13
9
8
12
10
H 0 : 1 2 3 vs H a : 1 2 or 1 3 or 2 3
Rejected H0
Need to test each pair
H 0 : 1 2 vs H a : 1 2
H 0 : 1 3 vs H a : 1 3
H 0 : 2 3 vs H a : 2 3
Assumptions
• Samples are independent
• Population variances are equal
• Populations are normally distributed
• Not paired samples
Estimating the Pooled Variance
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
10
13
9
(n1 1) s12 (n2 1) s22 (n3 1) s32
s
n1 1 n2 1 n3 1
2
4·0.892 4·1.52 2 4·1.22 2
12
1.53
s 1.53 1.24
Degrees of Freedom 12
8
12
10
St Dev
0.89
1.52
1.22
Back to the Post-hoc Tests
Diet
Standard
Junk Food
Organic
H0 : 1 2 vs Ha : 1 2
t
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
9.4
11.6
10
t12,0.05/2 2.179
x1 x2
x x
1 2
Standard Error s n1 n1
1
2
9.4 11.6
2.2
2.81
1
1
0.784
1.24 5 5
Reject H0
Post-hoc Confidence Interval
Diet
Standard
Junk Food
Organic
9
10
9
Find a 95% confidence interval for 1 2
( x1 x2 ) t /2 (Standard Error)
( x1 x2 ) t /2 s
1 1
n1 n2
(9.4 11.6) 2.179(1.24)
2.2 1.71
(3.91, 0.49)
1 1
5 5
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
9.4
11.6
10
Post-hoc Summary
Diet
Standard
Junk Food
Organic
9
10
9
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
t-statistic Decision
H 0 : 1 2 vs H a : 1 2
-2.81
Reject H0
H 0 : 1 3 vs H a : 1 3
-0.77
Retain H0
H 0 : 2 3 vs H a : 2 3
2.04
Retain H0
9.4
11.6
10
Confidence Interval
1 2
1 3
2 3
(-3.91, -0.49)
(-2.31, 1.11)
(-0.11, 3.31)
SPSS Output
Bonferroni’s Correction
Overall error rate (Pairwise error rate)(# of comparisons)
Example
• A study has 3 groups.
• 3 comparisons must be made.
• 1 to 2, 1 to 3, 2 to 3
• If the pairwise error rate is 5%,
• approximate the overall error rate
• Answer: 15%
Bonferroni’s Correction
Overall error rate (Pairwise error rate)(# of comparisons)
Example
• A study has 4 groups.
• 6 comparisons must be made.
• 1 to 2, 1 to 3, 1 to 4,
2 to 3, 2 to 4, 3 to 4
• If the pairwise error rate is 5%,
• approximate the overall error rate
• Answer: 30%
Bonferroni’s Correction
Overall error rate (Pairwise error rate)(# of comparisons)
Example
• A study has 3 groups.
• 3 comparisons must be made.
• 1 to 2, 1 to 3, 2 to 3
• If the overall error rate is 5%,
• approximate the pairwise error rate
• Answer: 5% 1.67%
3
Bonferroni’s Correction
Overall error rate (Pairwise error rate)(# of comparisons)
Example
• A study has 4 groups.
• 6 comparisons must be made.
• 1 to 2, 1 to 3, 1 to 4,
2 to 3, 2 to 4, 3 to 4
• If the overall error rate is 5%,
• approximate the pairwise error rate
• Answer:
5%
0.83%
6
Formula for # of Comparisons
m # of groups
# of comparisons m C2
m!
2!( m 2)!
3 C2
3!
3·2·1
3
2!(3 2)! 2·1(1)
4 C2
4!
4·3·2·1
6
2!(4 2)! 2·1( 2·1)
Post-hoc Confidence Intervals with
Bonferroni’s Correction
Want overall error rate 0.05
0.05
# of comparisons 3
Pairwise error rate
0.05
0.0167
3
Post-hoc Confidence Intervals with
Bonferroni’s Correction
Want overall error rate 0.05
0.05
# of comparisons 3
Pairwise error rate
0.05
0.0167
3
Instead of using t12,0.05/2 2.179
well use t12,0.0167/2 2.779
Post-hoc Confidence Intervals with
Bonferroni’s Correction
Diet
Standard
Junk Food
Organic
9
10
9
Find a 95% confidence interval for 1 2
( x1 x2 ) t /2 (Standard Error)
( x1 x2 ) t /2 s
1 1
n1 n2
(9.4 11.6) 2.779(1.24)
2.2 2.179
(4.38, 0.02)
1 1
5 5
Weight Gain (grams)
10
10
10
13
10
12
Mean
10
13
9
8
12
10
9.4
11.6
10
SPSS Output