You are on page 1of 49

Statistics for

Business and Economics


6th Edition

Chapter 11

Analysis of Variance

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Chapter Goals

After completing this chapter, you should be able


to:
 Recognize situations in which to use analysis of variance
 Understand different analysis of variance designs
 Perform a one-way and two-way analysis of variance and
interpret the results
 Analyze two-factor analysis of variance tests with more than
one observation per cell

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


One-Way Analysis of Variance

 Evaluate the difference among the means of three


or more groups
Examples: Average production for 1st, 2nd, and 3rd shift
Expected mileage for five brands of tires

 Assumptions
 Populations are normally distributed
 Populations have equal variances
 Samples are randomly and independently drawn

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Hypotheses of One-Way ANOVA

 H0 : μ1  μ2  μ3    μK
 All population means are equal
 i.e., no variation in means between groups

 H1 : μi  μ j for at least one i, j pair


 At least one population mean is different
 i.e., there is variation between groups
 Does not mean that all population means are different
(some pairs may be the same)

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


One-Way ANOVA
H0 : μ1  μ2  μ3    μK
H1 : Not all μi are the same

All Means are the same:


The Null Hypothesis is True
(No variation between
groups)

μ1  μ2  μ3
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
One-Way ANOVA
(continued)
H0 : μ1  μ2  μ3    μK
H1 : Not all μi are the same

At least one mean is different:


The Null Hypothesis is NOT true
(Variation is present between groups)

or

μ1  μ2  μ3 μ1  μ2  μ3
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Variability
 The variability of the data is key factor to test the
equality of means
 In each case below, the means may look different, but a
large variation within groups in B makes the evidence
that the means are different weak
A B

A B C A B C
Group Group
Small variation within groups Large variation within groups
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Partitioning the Variation
 Total variation can be split into two parts:

SST = SSW + SSG


SST = Total Sum of Squares
Total Variation = the aggregate dispersion of the individual
data values across the various groups
SSW = Sum of Squares Within Groups
Within-Group Variation = dispersion that exists among the
data values within a particular group
SSG = Sum of Squares Between Groups
Between-Group Variation = dispersion between the group
sample means
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Partition of Total Variation

Total Sum of Squares


(SST)

Variation due to Variation due to


= random sampling + differences
(SSW) between groups
(SSG)

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Total Sum of Squares
SST = SSW + SSG
K ni
SST    (x ij  x) 2

Where: i 1 j 1

SST = Total sum of squares


K = number of groups (levels or treatments)
ni = number of observations in group i
xij = jth observation from group i
x = overall sample mean
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Total Variation
(continued)

SST  (x11  x )2  (X12  x )2  ...  (x KnK  x )2

Re s p o n s e , X

G roup 1 G rou p 2 G rou p 3

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Within-Group Variation
SST = SSW + SSG
K ni
SSW    (x ij  x i ) 2

i 1 j 1
Where:
SSW = Sum of squares within groups
K = number of groups
ni = sample size from group i
Xi = sample mean from group i
Xij = jth observation in group i
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Within-Group Variation
(continued)

K ni
SSW    (x ij  x i )2
i 1 j 1
SSW
Summing the variation
within each group and then
MSW 
adding over all groups n K
Mean Square Within =
SSW/degrees of freedom

μi
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Within-Group Variation
(continued)

2 2 2
SSW  (x11  x1 )  (x12  x1 )  ...  (x KnK  x K )

Re s p o n s e , X

x3
x2
x1

G rou p 1 G rou p 2 G ro u p 3
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Between-Group Variation
SST = SSW + SSG
K
SSG   ni ( x i  x ) 2

i1
Where:
SSG = Sum of squares between groups
K = number of groups
ni = sample size from group i
xi = sample mean from group i
x = grand mean (mean of all data values)
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Between-Group Variation
(continued)
K
SSG   ni ( x i  x ) 2

i1

SSG
Variation Due to
Differences Between
MSG 
Groups K 1
Mean Square Between Groups
= SSG/degrees of freedom

μi μj

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Between-Group Variation
(continued)

2 2 2
SSG  n1(x1  x)  n2 (x 2  x)  ...  nK (x K  x)

Re s p o n s e , X

x3
x
x2
x1

G rou p 1 G rou p 2 G rou p 3


Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Obtaining the Mean Squares

SST
MST 
n 1
SSW
MSW 
n K

SSG
MSG 
K 1

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


One-Way ANOVA Table

Source of SS df MS F ratio
Variation (Variance)
Between SSG MSG
SSG K-1 MSG =
Groups K - 1 F = MSW
Within SSW
SSW n-K MSW =
Groups n-K
Total SST = n-1
SSG+SSW
K = number of groups
n = sum of the sample sizes from all groups
df = degrees of freedom

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


One-Factor ANOVA
F Test Statistic
H0: μ1= μ2 = … = μK
H1: At least two population means are different
 Test statistic MSG
F
MSW
MSG is mean squares between variances
MSW is mean squares within variances

 Degrees of freedom
 df1 = K – 1 (K = number of groups)
 df2 = n – K (n = sum of sample sizes from all groups)

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Interpreting the F Statistic

 The F statistic is the ratio of the between


estimate of variance and the within estimate
of variance
 The ratio must always be positive
 df1 = K -1 will typically be small
 df2 = n - K will typically be large

Decision Rule:
 Reject H0 if  = .05

F > FK-1,n-K, 0 Do not Reject H0


reject H0
FK-1,n-K,
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
One-Factor ANOVA
F Test Example

You want to see if three Club 1 Club 2 Club 3


different golf clubs yield 254 234 200
different distances. You 263 218 222
randomly select five 241 235 197
measurements from trials on 237 227 206
an automated driving 251 216 204
machine for each club. At the
.05 significance level, is there
a difference in mean
distance?

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


One-Factor ANOVA Example:
Scatter Diagram
Distance
270
Club 1 Club 2 Club 3
254 234 200 260 •
263 218 222 ••
250 x1
241 235 197 •
240
237 227 206 • ••
251 216 204 230
• x2 x
220 •
••
210
x1  249.2 x 2  226.0 x 3  205.8
•• x3
200 ••
x  227.0 190

1 2 3
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc. Club
One-Factor ANOVA Example
Computations
Club 1 Club 2 Club 3 x1 = 249.2 n1 = 5
254 234 200
x2 = 226.0 n2 = 5
263 218 222
241 235 197 x3 = 205.8 n3 = 5
237 227 206 n = 15
251 216 204 x = 227.0
K=3
SSG = 5 (249.2 – 227)2 + 5 (226 – 227)2 + 5 (205.8 – 227)2 = 4716.4
SSW = (254 – 249.2)2 + (263 – 249.2)2 +…+ (204 – 205.8)2 = 1119.6

MSG = 4716.4 / (3-1) = 2358.2 2358.2


F  25.275
MSW = 1119.6 / (15-3) = 93.3 93.3

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


One-Factor ANOVA Example
Solution
H0: μ1 = μ2 = μ3 Test Statistic:
H1: μi not all equal
MSA 2358.2
 = .05 F   25.275
MSW 93.3
df1= 2 df2 = 12

Critical Value: Decision:


F2,12,.05= 3.89 Reject H0 at  = 0.05
 = .05 Conclusion:
There is evidence that
0 Do not Reject H0 at least one μi differs
reject H0 F = 25.275
F2,12,.05 = 3.89 from the rest
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
ANOVA -- Single Factor:
Excel Output
EXCEL: tools | data analysis | ANOVA: single factor
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        

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Two-Way Analysis of Variance

 Examines the effect of


 Two factors of interest on the dependent
variable
 e.g., Percent carbonation and line speed on soft drink
bottling process
 Interaction between the different levels of these
two factors
 e.g., Does the effect of one particular carbonation
level depend on which level the line speed is set?

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Two-Way ANOVA
(continued)

 Assumptions
 Populations are normally distributed
 Populations have equal variances
 Independent random samples are
drawn

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Randomized Block Design

Two Factors of interest: A and B


K = number of groups of factor A
H = number of levels of factor B
(sometimes called a blocking variable)
Group
Block 1 2 … K

1 x11 x21 … xK1


2 x12 x22 … xK2
. . . . .
. . . . .
H x1H x2H … xKH
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Two-Way Notation

 Let xji denote the observation in the jth group and ith
block
 Suppose that there are K groups and H blocks, for a
total of n = KH observations
 Let the overall mean be x
 Denote the group sample means by
x j (j  1,2,,K)

 Denote the block sample means by


x i (i  1,2, ,H)

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Partition of Total Variation
 SST = SSG + SSB + SSE

Variation due to
Total Sum of
Squares (SST) = differences between
groups (SSG)
+
Variation due to
differences between
blocks (SSB)
+
The error terms are assumed Variation due to
to be independent, normally random sampling
distributed, and have the same (unexplained error)
variance
(SSE)
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Two-Way Sums of Squares
 The sums of squares are Degrees of
Freedom:
K H
Total : SST    (x ji  x)2 n–1
j 1 i 1

K
Between - Groups : SSG  H (x j  x)2 K–1
j 1

H
Between - Blocks : SSB  K  (x i  x)2 H–1
i 1

K H
Error : SSE    (x ji  x j  x i  x)2 (K – 1)(K – 1)
j 1 i1

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Two-Way Mean Squares
 The mean squares are
SST
MST 
n 1
SST
MSG 
K 1
SST
MSB 
H 1
SSE
MSE 
(K  1)(H  1)
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Two-Way ANOVA:
The F Test Statistic

F Test for Groups


H0: The K population group
means are all the same MSG Reject H0 if
F
MSE
F > FK-1,(K-1)(H-1),

F Test for Blocks


H0: The H population block
means are the same MSB Reject H0 if
F
MSE
F > FH-1,(K-1)(H-1),

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


General Two-Way Table Format

Source of Sum of Degrees of Mean Squares F Ratio


Variation Squares Freedom
Between SSG MSG
groups SSG K–1 MSG 
K 1 MSE

Between SSB MSB


SSB H–1 MSB 
blocks H 1 MSE

SSE (K – 1)(H – 1) SSE


Error MSE 
(K  1)(H  1)

Total SST n-1

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


More than One
Observation per Cell

 A two-way design with more than one


observation per cell allows one further source
of variation
 The interaction between groups and blocks
can also be identified
 Let
 K = number of groups
 H = number of blocks
 L = number of observations per cell
 n = KHL = total number of observations

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


More than One
Observation per Cell
(continued)

SST = SSG + SSB + SSI + SSE Degrees of


Freedom:
SSG K–1
Between-group variation

SST SSB H–1


Between-block variation
Total Variation
SSI
Variation due to interaction (K – 1)(H – 1)
between groups and blocks
n–1
SSE KH(L – 1)
Random variation (Error)

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Sums of Squares with Interaction
Degrees of Freedom:

Total : SST     (x jil  x)2 n-1


j i l

K
Between - groups : SSG  HL  (x j  x)2 K–1
j 1

H
Between - blocks : SSB  KL  (x i  x)2 H–1
i 1

K H
Interactio n : SSI  L   (x ji  x j  x i  x)2 (K – 1)(H – 1)
j 1 i1

Error : SSE     (x jil  x ji )2 KH(L – 1)


i j l

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Two-Way Mean Squares
with Interaction
 The mean squares are SST
MST 
n 1
SST
MSG 
K 1
SST
MSB 
H 1
SSI
MSI 
(K - 1)(H  1)

SSE
MSE 
KH(L  1)
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Two-Way ANOVA:
The F Test Statistic
F Test for group effect
H0: The K population group
means are all the same MSG Reject H0 if
F
MSE
F > FK-1,KH(L-1),
F Test for block effect
H0: The H population block
means are the same MSB Reject H0 if
F
MSE F > FH-1,KH(L-1),

F Test for interaction effect


H0: the interaction of groups and
blocks is equal to zero MSI Reject H0 if
F
MSE
F > F(K-1)(H-1),KH(L-1),
Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.
Two-Way ANOVA
Summary Table
Source of Sum of Degrees of Mean F
Variation Squares Freedom Squares Statistic

Between MSG MSG


SSG K–1
groups = SSG / (K – 1) MSE
Between MSB MSB
SSB H–1
blocks = SSB / (H – 1) MSE

MSI MSI
Interaction SSI (K – 1)(H – 1)
= SSI / (K – 1)(H – 1) MSE

MSE
Error SSE KH(L – 1)
= SSE / KH(L – 1)

Total SST n–1

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Features of Two-Way
ANOVA F Test
 Degrees of freedom always add up
 n-1 = KHL-1 = (K-1) + (H-1) + (K-1)(H-1) + KH(L-1)
 Total = groups + blocks + interaction + error

 The denominator of the F Test is always the


same but the numerator is different
 The sums of squares always add up
 SST = SSG + SSB + SSI + SSE
 Total = groups + blocks + interaction + error

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.


Chapter Summary
 Described one-way analysis of variance
 The logic of Analysis of Variance
 Analysis of Variance assumptions
 Described two-way analysis of variance
 Examined effects of multiple factors
 Examined interaction between factors

Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc.

You might also like