CHapter 5 1
CHapter 5 1
12th Edition
Chapter 5
Analysis of Variance
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-1
Learning Objectives
In this chapter, you learn:
The basic concepts of experimental design
How to use one-way analysis of variance to test for differences
among the means of several populations (also referred to as
“groups” in this chapter)
To learn the basic structure and use of a randomized block design
How to use two-way analysis of variance and interpret the
interaction effect
How to perform multiple comparisons in a one-way analysis of
variance and a two-way analysis of variance
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-2
Chapter Overview
DCOVA
Analysis of Variance (ANOVA)
population
Observe effects on the dependent variable
Are the groups the same?
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-4
Completely Randomized Design
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-5
One-Way Analysis of Variance
DCOVA
Assumptions
Populations are normally distributed
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-6
Hypotheses of One-Way ANOVA
DCOVA
H0 : μ1 μ2 μ3 μc
All population means are equal
i.e., no factor effect (no variation in means among
groups)
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-7
One-Way ANOVA
DCOVA
H0 : μ1 μ2 μ3 μc
H1 : Not all μ j are the same
The Null Hypothesis is True
All Means are the same:
(No Factor Effect)
μ1 μ 2 μ 3
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-8
One-Way ANOVA DCOVA
(continued)
H0 : μ1 μ2 μ3 μc
H1 : Not all μ j are the same
The Null Hypothesis is NOT true
At least one of the means is different
(Factor Effect is present)
or
μ1 μ2 μ3 μ1 μ2 μ3
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-9
Partitioning the Variation
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-10
Partitioning the Variation
(continued)
DCOVA
SST = SSA + SSW
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-11
Partition of Total Variation
DCOVA
Total Variation (SST)
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-12
Total Sum of Squares
DCOVA
SST ( X 11 X ) 2 ( X 12 X ) 2 ( X cnc X ) 2
Response, X
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-14
Among-Group Variation
DCOVA
i j
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-16
Among-Group Variation
DCOVA
(continued)
SSA n1 ( X 1 X ) 2 n2 ( X 2 X ) 2 nc ( X c X ) 2
Response, X
X3
X2 X
X1
μj
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-19
Within-Group Variation
DCOVA
(continued)
SSW ( X 11 X 1 ) 2 ( X 12 X 2 ) 2 ( X cnc X c ) 2
Response, X
X3
X2
X1
c = number of groups
n = sum of the sample sizes from all groups
df = degrees of freedom
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-22
One-Way ANOVA
F Test Statistic DCOVA
H0: μ1= μ2 = … = μc
H1: At least two population means are different
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-23
Interpreting One-Way ANOVA
F Statistic DCOVA
Decision Rule:
Reject H0 if FSTAT > Fα,
otherwise do not reject
H0 0 Do not Reject H0
reject H0
Fα
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-24
One-Way ANOVA
F Test Example DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-25
One-Way ANOVA Example:
Scatter Plot DCOVA
Distance
Club 1 Club 2 Club 3 270
254 234 200 260 •
263 218 222 250 •• X1
241 235 197 240 •
237 227 206 • ••
251 216 204 230
220
•
X2 • X
••
210
X1 249.2 X 2 226.0 X 3 205.8 •• X3
200
••
X 227.0 190
1 2 3
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Club Chap 11-26
One-Way ANOVA Example
Computations DCOVA
Critical Decision:
Value:
Reject H0 at = 0.05
Fα = 3.89
= .05 Conclusion:
There is evidence that
0 Do not Reject H at least one μj differs
0
reject H0
FSTAT = 25.275 from the rest
Fα = 3.89
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-28
Exercise
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-29
One-Way ANOVA
Excel Output DCOVA
SUMMARY
Groups Count Sum Average Variance
Club 1 5 1246 249.2 108.2
Club 2 5 1130 226 77.5
Club 3 5 1029 205.8 94.2
ANOVA
Source of
SS df MS F P-value F crit
Variation
Between
4716.4 2 2358.2 25.275 4.99E-05 3.89
Groups
Within
1119.6 12 93.3
Groups
Total 5836.0 14
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-30
One-Way ANOVA
Minitab Output DCOVA
One-way ANOVA: Distance versus Club
Source DF SS MS F P
Club 2 4716.4 2358.2 25.28 0.000
Error 12 1119.6 93.3
Total 14 5836.0
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-31
The Tukey-Kramer Procedure
DCOVA
μ1= μ2 μ3 x
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-32
Tukey-Kramer Critical Range
DCOVA
MSW 1 1
Critical Range Qα
2 n n
j j'
where:
Qα = Upper Tail Critical Value from Studentized
Range Distribution with c and n - c degrees
of freedom (see appendix E.7 table)
MSW = Mean Square Within
nj and nj’ = Sample sizes from groups j and j’
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-33
The Tukey-Kramer Procedure:
Example DCOVA
1. Compute absolute mean
Club 1 Club 2 Club 3 differences:
254 234 200
263 218 222 x1 x 2 249.2 226.0 23.2
241 235 197 x1 x 3 249.2 205.8 43.4
237 227 206
251 216 204 x 2 x 3 226.0 205.8 20.2
Q α 3.77
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-34
The Tukey-Kramer Procedure:
Example
(continued)
3. Compute Critical Range: DCOVA
MSW 1
Critical Range Qα 1 3 .77 93 .3 1 1 16 .285
2 n n 2 5 5
j j'
4. Compare:
5. All of the absolute mean differences
x1 x 2 23.2
are greater than critical range.
Therefore there is a significant x1 x 3 43.4
difference between each pair of
means at 5% level of significance. x 2 x 3 20.2
Thus, with 95% confidence we can conclude
that the mean distance for club 1 is greater
than club 2 and 3, and club 2 is greater than
club 3.
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-35
ANOVA Assumptions
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-36
ANOVA Assumptions
Levene’s Test DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-37
Levene Homogeneity Of Variance
Test Example
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-38
Levene Homogeneity Of Variance
Test Example (Excel) (continued)
DCOVA
Anova: Single Factor
SUMMARY Since the
Groups Count Sum Average Variance p-value is
Club 1 5 39 7.8 36.2
greater
Club 2 5 35 7 17.5
than 0.05
Club 3 5 31 6.2 50.2
there is
insufficient
P- evidence
Source of Variation SS df MS F value F crit of a
Between Groups 6.4 2 3.2 0.092 0.912 3.885
difference
Within Groups 415.6 12 34.6 in the
Total 422 14 variances
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-39
Levene Homogeneity Of Variance
Test Example (Minitab)
(continued)
One-way ANOVA: Abs. Diff versus Club
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-40
The Randomized Block Design
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-41
Partitioning the Variation
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-42
Sum of Squares for Blocks
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-44
Mean Squares
DCOVA
SSBL
MSBL Mean square blocking
r 1
SSA
MSA Mean square among groups
c1
SSE
MSE Mean square error
( r 1)(c 1)
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-45
Randomized Block ANOVA Table
DCOVA
Source of SS df MS F
Variation
Among MSA
Groups SSA c-1 MSA
MSE
Among SSBL r-1 MSBL MSBL
Blocks
MSE
Error SSE (r–1)(c-1) MSE
Total SST rc - 1
c = number of populations rc = total number of observations
r = number of blocks df = degrees of freedom
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-46
Testing For Factor Effect
DCOVA
H 0 : μ .1 μ .2 μ .3 μ . c
H 1 : Not all population means are equal
MSA
FSTAT =
MSE Main Factor test: df1 = c – 1
df2 = (r – 1)(c – 1)
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-47
Test For Block Effect
DCOVA
H 0 : μ1. μ 2. μ 3. ... μ r.
H1 : Not all block means are equal
MSBL
FSTAT =
MSE Blocking test: df1 = r – 1
df2 = (r – 1)(c – 1)
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-48
Randomized Block Design
Example DCOVA
Ratings at Four Restaurants of a Fast-Food Chain
RESTAURANTS
6 78 68 98 86 330 82.50 c r
X ij
j 1 i 1 1,887
Totals 465 400 546 476 1,887 X 78.625
rc 24
H0: μA= μB= μC= μD vs H1: At least one of the μ’s is different
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-50
ANOVA Output From Excel
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-51
ANOVA Output From Minitab
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-52
Factorial Design:
Two-Way ANOVA DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-53
Two-Way ANOVA
(continued)
DCOVA
Assumptions
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-54
Two-Way ANOVA
Sources of Variation DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-56
Two-Way ANOVA Equations
DCOVA
Total Variation: r c n
2
SST ( X ijk X )
i 1 j 1 k 1
Factor A Variation: r
2
SSA cn ( X i .. X )
i 1
Factor B Variation: c
SSB rn ( X . j . X ) 2
j 1
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-57
Two-Way ANOVA Equations
(continued)
DCOVA
Interaction Variation:
r c
SSAB n ( X ij. X i.. X .j. X ) 2
i 1 j 1
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-58
Two-Way ANOVA Equations
(continued)
r c n
where: X
i1 j 1 k 1
ijk DCOVA
X Grand Mean
c n
rcn
X
j1 k 1
ijk
X ijk
X. j. i1 k 1
Mean of jth level of factor B (j 1, 2, ..., c)
rn
Xijk n
r = number of levels of factor A
Xij. Mean of cell ij c = number of levels of factor B
k 1 n n’ = number of replications in each cell
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-59
Mean Square Calculations
DCOVA
SSA
MSA Mean square factor A
r 1
SSB
MSB Mean square factor B
c 1
SSAB
MSAB Mean square interaction
( r 1)(c 1)
SSE
MSE Mean square error
rc ( n'1)
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-60
Two-Way ANOVA:
The F Test Statistics DCOVA
Degrees
Source of Sum of Mean
Of F
Variation Squares Squares
Freedom
MSA MSA
Factor A r–1 SSA
= SSA /(r – 1) MSE
MSB MSB
Factor B c-1 SSB
= SSB /(c – 1) MSE
AB MSAB MSAB
(r–1)(c-1) SSAB
(Interaction) = SSAB / (r – 1)(c – 1) MSE
MSE =
Error rc(n’ – 1) SSE
SSE/rc(n’ – 1)
Total n-1 SST
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-62
Features of Two-Way ANOVA
F Test DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-63
Examples:
Interaction vs. No Interaction
DCOVA
Interaction is present:
No interaction: line some line segments
segments are parallel not parallel
Factor B Level 1
Mean Response
Mean Response
Factor B Level 1
Factor B Level 3
Factor B Level 2
Factor B Level 2
Factor B Level 3
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-64
Multiple Comparisons:
The Tukey Procedure DCOVA
X 2.. X3..
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-65
Multiple Comparisons:
The Tukey Procedure DCOVA
MSE
Critical Range Q
c n'
(where Qα is from Table E.7 with r and rc(n’–1) d.f.)
MSE
Critical Range Q
r n'
(where Qα is from Table E.7 with c and rc(n’–1) d.f.)
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-66
Do ACT Prep Course Type & Length
Impact Average ACT Scores DCOVA
ACT Scores for Different Types and Lengths of Courses
LENGTH OF COURSE
Traditional 26 18 34 28
Traditional 27 24 24 21
Traditional 25 19 35 23
Traditional 21 20 31 29
Traditional 21 18 28 26
Online 27 21 24 21
Online 29 32 16 19
Online 30 20 22 19
Online 24 28 20 24
Online 30 29 23 25
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-67
Plotting Cell Means Shows A
Strong Interaction DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-68
Excel Analysis Of ACT Prep
Course Data DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-69
Minitab Analysis Of ACT Prep
Course Data DCOVA
The interaction between course
length & type is significant
because its p-value is 0.0000.
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-70
With The Significant Interaction
Collapse The Data Into Four Groups
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-71
Excel Analysis Of Collapsed
Data
DCOVA
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-73
Chapter Summary
Described one-way analysis of variance
The logic of ANOVA
ANOVA assumptions
F test for difference in c means
The Tukey-Kramer procedure for multiple comparisons
The Levene test for homogeneity of variance
Examined the basic structure and use of a
randomized block design
Described two-way analysis of variance
Examined effects of multiple factors
Examined interaction between factors
Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 11-74