Chap 11
Chap 11
Chapter 11
Analysis of Variance
Chapter Topics
The Completely Randomized Design:
One-Way Analysis of Variance
ANOVA Assumptions
F Test for Differences in More than Two Means
The Tukey-Kramer Procedure
Levene’s Test for Homogeneity of Variance
The Randomized Block Design
F Test for the Difference in More than Two Means
The Tukey Procedure
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-2
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-3
Why ANOVA?
Could Compare the Means One Pair at a Time
Using t Test for Difference of Means
Each t Test Contains Type I Error
The Total Type I Error with k Pairs of Means
is 1- (1 - α) k
E.g., If there are 5 means and use α = .05
Must perform 10 comparisons
Type I Error is 1 – (.95) 10 = .40
40% of the time you will reject the null hypothesis
of equal means in favor of the alternative when the
null hypothesis is true!
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-4
One-Way ANOVA
(No Treatment Effect)
H 0 : µ1 = µ 2 = L = µ c
H1 : Not all µ j are the same
The Null
Hypothesis is
True
µ1 = µ 2 = µ3
© 2004 Prentice-Hall, Inc. Chap 11-10
One-Way ANOVA
(Treatment Effect Present)
H 0 : µ1 = µ 2 = L = µ c
H1 : Not all µ j are the same The Null
Hypothesis is
NOT True
µ1 = µ 2 ≠ µ3 µ1 ≠ µ 2 ≠ µ3
© 2004 Prentice-Hall, Inc. Chap 11-11
One-Way ANOVA
(Partition of Total Variation)
Total Variation SST
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-5
Total Variation
c nj
SST = ∑ ∑ ( X ij − X ) 2
j =1 i =1
∑∑ X
j =1 i =1
ij
( ) +(X ) +L + ( X )
2 2 2
SST = X 11 − X 21 −X nc c −X
Response, X
Among-Group Variation
c
SSA = ∑ n j ( X j − X ) 2 M SA =
SSA
j =1 c −1
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-6
Among-Group Variation(continued)
( ) ( ) ( )
2 2 2
SSA = n1 X1 − X + n2 X 2 − X +L+ nc Xc − X
Response, X
X2 X3
X
X1
Within-Group Variation
c nj
SSW
SSW = ∑ ∑ (X
j =1 i =1
ij − X j )2 MSW =
n−c
X j : The sample mean of group j
X ij : The i -th observation in group j
Within-Group Variation(continued)
Response, X
X2 X3
X
X1
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-7
Within-Group Variation(continued)
SSW For c = 2, this is the
MSW = pooled-variance in the
n−c t test.
(n1 − 1)S12 + (n2 − 1)S22 + ••• + (nc − 1)Sc2
=
(n1 − 1) + (n2 − 1) + ••• + (nc − 1)
•If more than 2 groups,
use F Test.
•For 2 groups, use t test.
F Test more limited.
µj
© 2004 Prentice-Hall, Inc. Chap 11-19
One-Way ANOVA
F Test Statistic
Test Statistic
MSA
F=
MSW
MSA is mean squares among
MSW is mean squares within
Degrees of Freedom
df1 = c − 1
df 2 = n − c
One-Way ANOVA
Summary Table
Degrees Mean
Source of Sum of F
of Squares
Variation Squares Statistic
Freedom (Variance)
Among MSA =
c–1 SSA MSA/MSW
(Factor) SSA/(c – 1 )
Within MSW =
n–c SSW
(Error) SSW/(n – c )
SST =
Total n–1
SSA + SSW
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-8
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-9
Summary Table
Degrees Mean
Source of Sum of F
of Squares
Variation Squares Statistic
Freedom (Variance)
Among MSA/MSW
3-1=2 47.1640 23.5820
(Factor) =25.60
Within
15-3=12 11.0532 .9211
(Error)
Total 15-1=14 58.2172
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-10
Critical Value(s):
Decision:
Reject at α = 0.05.
α = 0.05 Conclusion:
There is evidence that at
least one µ j differs from
0 3.89 F the rest.
© 2004 Prentice-Hall, Inc. Chap 11-28
Solution in Excel
Microsoft Excel
Worksheet
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-11
Solution in PHStat
Microsoft Excel
Worksheet
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-12
Levene’s Test:
Absolute Difference from the Median
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-13
Summary Table
SUMMARY
Groups Count Sum Average Variance
Machine1 5 3.87 0.774 0.35208
Machine2 5 3.5 0.7 0.19
Machine3 5 3.05 0.61 0.5005
ANOVA
Source of Variation SS df MS F P-value F crit
Between Groups 0.067453 2 0.033727 0.097048 0.908218 3.88529
Within Groups 4.17032 12 0.347527
Total 4.237773 14
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-14
Total Variation
( )
c r
SST = ∑∑ X ij − X
2
j =1 i =1
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-15
Among-Group Variation
( )
c 2
SSA = r ∑ X • j − X
j =1
r
∑X ij
X• j = i =1
(treatment group means)
r
df = c − 1
SSA
MSA =
c −1
© 2004 Prentice-Hall, Inc. Chap 11-43
Among-Block Variation
( )
r 2
SSBL = c ∑ X i• − X
i =1
c
∑X
j =1
ij
X i• = (block means)
c
df = r − 1
SSBL
MSBL =
r −1
© 2004 Prentice-Hall, Inc. Chap 11-44
Random Error
( )
c r 2
SSE = ∑∑ X ij − X i• − X • j + X
j =1 i =1
df = ( r − 1)( c − 1)
SSE
MSE =
( r − 1)( c − 1)
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-16
Summary Table
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-17
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-18
Microsoft Excel
Worksheet
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-19
Two-Way ANOVA
Assumptions
Normality
Populations are normally distributed
Homogeneity of Variance
Populations have equal variances
Independence of Errors
Independent random samples are drawn
Two-Way ANOVA
Total Variation Partitioning
SSB +
Variation Due to
d.f.= c-1
Total Variation Factor B
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-20
Two-Way ANOVA
Total Variation Partitioning
Total Variation
( )
r c n' 2
SST = ∑ ∑ ∑ X ijk − X
i =1 j =1 k =1
∑ ∑ ∑ X ijk
i =1 j =1 k =1
∑∑∑ X
i =1 j =1 k =1
ijk
X = '
=
rcn n
= the overall or grand mean Chap 11-59
© 2004 Prentice-Hall, Inc.
Factor A Variation
( )
r 2
SSA = cn ' ∑ X i•• − X
i =1
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-21
Factor B Variation
( )
c 2
SSB = rn ' ∑ X • j • − X
j =1
Interaction Variation
( )
r c 2
SSAB = n ' ∑∑ X ij • − X i•• − X • j • + X
i =1 j =1
Random Error
( )
r c n'
SSE = ∑∑∑ X ijk − X ij •
i =1 j =1 k =1
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-22
Two-Way ANOVA:
The F Test Statistic
H0: µ1 ..= µ2 .. = ••• = µr .. F Test for Factor A Main Effect
MSA SSA Reject if
H1: Not all µi .. are equal F = MSE MSA =
r −1 F > FU
H0: µ.1. = µ.2. = ••• = µ.c. F Test for Factor B Main Effect
MSB SSB
H1: Not all µ.j. are equal F = MSE MSB = Reject if
c −1 F > FU
Two-Way ANOVA
Summary Table
Source of Degrees of Sum of Mean F
Variation Freedom Squares Squares Statistic
Factor A MSA = MSA/
r–1 SSA
(Row) SSA/(r – 1) MSE
Factor B MSB = MSB/
c–1 SSB
(Column) SSB/(c – 1) MSE
AB MSAB = MSAB/
(r – 1)(c – 1) SSAB
(Interaction) SSAB/ [(r – 1)(c – 1)] MSE
MSE =
Error r•c •(n’ – 1) SSE
SSE/[r•c •(n’ – 1)]
Total r•c •n’ – 1 SST
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-23
n = n1 + n2 + L + nc
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-24
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-25
⎡ 2⎤
⎢ 12 c Tj ⎥
H =⎢ ∑ − 3( n + 1)
n( n + 1) j = 1 n ⎥
⎢ j⎥
⎣ ⎦
⎡ 12 ⎛ 652 382 17 2 ⎞ ⎤
=⎢ ⎜ + + ⎟ ⎥ − 3(15 + 1)
⎢15(15 + 1) ⎜ 5 5 5 ⎟⎥
⎣ ⎝ ⎠⎦
= 11.58
© 2004 Prentice-Hall, Inc. Chap 11-74
Conclusion:
α = .05
There is evidence that
population medians are
not all equal.
0 5.991
© 2004 Prentice-Hall, Inc. Chap 11-75
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-26
Microsoft Excel
Worksheet
Assumptions
The r blocks are independent
The random variable is continuous
The data constitute at least an ordinal scale of
measurement
No interaction between the r blocks and the c
treatment levels
The c populations have the same variability
The c populations have the same shape
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-27
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-28
Conclusion:
α = .05
There is evidence that
population medians are
not all equal.
0 5.991
© 2004 Prentice-Hall, Inc. Chap 11-82
Chapter Summary
Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.