0% found this document useful (0 votes)
11 views28 pages

Chap 11

stat 10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views28 pages

Chap 11

stat 10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Chapter 11 Student Lecture Notes 11-1

Basic Business Statistics


(9th Edition)

Chapter 11
Analysis of Variance

© 2004 Prentice-Hall, Inc. Chap 11-1

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

© 2004 Prentice-Hall, Inc. Chap 11-2

Chapter Topics (continued)

The Factorial Design: Two-Way Analysis of


Variance
Examine Effects of Factors and Interaction
Kruskal-Wallis Rank Test: Nonparametric
Analysis for the Completely Randomized
Design
Friedman Rank Test: Nonparametric Analysis
for the Randomized Block Design

© 2004 Prentice-Hall, Inc. Chap 11-3

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-2

General Experimental Setting


Investigator Controls One or More
Independent Variables
Called treatment variables or factors
Each treatment factor contains two or more groups
(or levels)
Observe Effects on Dependent Variable
Response to groups (or levels) of independent
variable
Experimental Design: The Plan Used to Test
Hypothesis

© 2004 Prentice-Hall, Inc. Chap 11-4

Completely Randomized Design

Experimental Units (Subjects) are Assigned


Randomly to Groups
Subjects are assumed to be homogeneous
Only One Factor or Independent Variable
With 2 or more groups (or levels)
Analyzed by One-Way Analysis of Variance
(ANOVA)

© 2004 Prentice-Hall, Inc. Chap 11-5

Completely Randomized Design


Example

Factor (Training Method)


Factor Levels
(Groups)
Randomly
Assigned
Units
21 hrs 17 hrs 31 hrs
Dependent
Variable 27 hrs 25 hrs 28 hrs
(Response)
29 hrs 20 hrs 22 hrs
© 2004 Prentice-Hall, Inc. Chap 11-6

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-3

One-Way Analysis of Variance


F Test
Evaluate the Difference Among the Mean
Responses of 2 or More (c ) Populations
E.g., Several types of tires, oven temperature
settings
Assumptions
Samples are randomly and independently drawn
This condition must be met
Populations are normally distributed
F Test is robust to moderate departure from
normality
Populations have equal variances
Less sensitive to this requirement when samples
are of equal size from each population
© 2004 Prentice-Hall, Inc. Chap 11-7

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!

© 2004 Prentice-Hall, Inc. Chap 11-8

Hypotheses of One-Way ANOVA


H 0 : µ1 = µ 2 = L = µ c
All population means are equal
No treatment effect (no variation in means among
groups)
H1 : Not all µ j are the same
At least one population mean is different (others
may be the same!)
There is a treatment effect
Does not mean that all population means are
different
© 2004 Prentice-Hall, Inc. Chap 11-9

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

Variation Due to Variation Due to Random


= Group SSA + Sampling SSW
Commonly referred to as: Commonly referred to as:
Among Group Variation Within Group Variation
Sum of Squares Among Sum of Squares Within
Sum of Squares Between Sum of Squares Error
Sum of Squares Model Sum of Squares Unexplained
Sum of Squares Explained
Sum of Squares Treatment
© 2004 Prentice-Hall, Inc. Chap 11-12

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 ij : the i -th observation in group j


n j : the number of observations in group j
n : the total number of observations in all groups
c : the number of groups
c nj

∑∑ X
j =1 i =1
ij

X = the over all or grand mean


© 2004 Prentice-Hall, Inc.
n Chap 11-13

Total Variation (continued)

( ) +(X ) +L + ( X )
2 2 2
SST = X 11 − X 21 −X nc c −X

Response, X

Group 1 Group 2 Group 3


© 2004 Prentice-Hall, Inc. Chap 11-14

Among-Group Variation
c
SSA = ∑ n j ( X j − X ) 2 M SA =
SSA
j =1 c −1

X j : The sample mean of group j


X : The overall or grand mean

µ j µ j' Variation Due to Differences Among Groups

© 2004 Prentice-Hall, Inc. Chap 11-15

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

Group 1 Group 2 Group 3


© 2004 Prentice-Hall, Inc. Chap 11-16

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

Summing the variation


within each group and then
adding over all groups
µj
© 2004 Prentice-Hall, Inc. Chap 11-17

Within-Group Variation(continued)

SSW = ( X11 − X1 ) + ( X 21 − X1 ) + L+ X ncc − X c ( )


2 2 2

Response, X

X2 X3
X
X1

Group 1 Group 2 Group 3


© 2004 Prentice-Hall, Inc. Chap 11-18

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

© 2004 Prentice-Hall, Inc. Chap 11-20

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

© 2004 Prentice-Hall, Inc. Chap 11-21

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-8

Features of One-Way ANOVA


F Statistic
The F Statistic is the Ratio of the Among
Estimate of Variance and the Within Estimate
of Variance
The ratio must always be positive
df1 = c -1 will typically be small
df2 = n - c will typically be large
The Ratio Should Be Close to 1 if the Null is
True

© 2004 Prentice-Hall, Inc. Chap 11-22

Features of One-Way ANOVA


F Statistic (continued)

If the Null Hypothesis is False


The numerator should be greater than the
denominator
The ratio should be larger than 1

© 2004 Prentice-Hall, Inc. Chap 11-23

One-Way ANOVA F Test


Example

As production manager, you Machine1 Machine2 Machine3


want to see if 3 filling 25.40 23.40 20.00
machines have different mean 26.31 21.80 22.20
filling times. You assign 15 24.10 23.50 19.75
similarly trained & 23.74 22.75 20.60
experienced workers, 5 per
25.10 21.60 20.40
machine, to the machines. At
the .05 significance level, is
there a difference in mean
filling times?

© 2004 Prentice-Hall, Inc. Chap 11-24

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-9

One-Way ANOVA Example:


Scatter Diagram
Machine1 Machine2 Machine3 27
Time in Seconds
25.40 23.40 20.00 26 •
26.31 21.80 22.20 •
24.10 23.50 19.75
25 • X1
24 •
23.74 22.75 20.60 • ••
23
25.10 21.60 20.40
22

X2 • X
••
21
X 1 = 24.93 X 2 = 22.61 •• X3
20 ••
X 3 = 20.59 X = 22.71 19

© 2004 Prentice-Hall, Inc. Chap 11-25

One-Way ANOVA Example


Computations
Machine1 Machine2 Machine3 X 1 = 24.93 nj = 5
25.40 23.40 20.00
26.31 21.80 22.20 X 2 = 22.61 c=3
24.10 23.50 19.75 X 3 = 20.59 n = 15
23.74 22.75 20.60
25.10 21.60 20.40 X = 22.71

SSA = 5 ⎡ ( 24.93 − 22.71) + ( 22.61 − 22.71) + ( 20.59 − 22.71) ⎤


2 2 2
⎣ ⎦
= 47.164
SSW = 4.2592 + 3.112 + 3.682 = 11.0532
MSA = SSA /( c -1) = 47.1640 / 2 = 23.5820
MSW = SSW /( n - c ) = 11.0532 /12 = .9211
© 2004 Prentice-Hall, Inc. Chap 11-26

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

© 2004 Prentice-Hall, Inc. Chap 11-27

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-10

One-Way ANOVA Example


Solution
Test Statistic:
H0: µ1 = µ2 = µ3
H1: Not All Equal MSA 23.5820
α = .05 F= = = 25.6
df1= 2 df2 = 12 MSW .9211

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

Use Tools | Data Analysis | ANOVA: Single


Factor
Excel Worksheet that Performs the One-Factor
ANOVA of the Example

Microsoft Excel
Worksheet

© 2004 Prentice-Hall, Inc. Chap 11-29

The Tukey-Kramer Procedure


Tells which Population Means are Significantly
Different
f(X)
E.g., µ1 = µ2 ≠ µ3
2 groups whose means
may be significantly
different µ1= µ2 µ3 X
Post Hoc (A Posteriori) Procedure
Done after rejection of equal means in ANOVA
Pairwise Comparisons
Compare absolute mean differences with critical
range
© 2004 Prentice-Hall, Inc. Chap 11-30

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-11

The Tukey-Kramer Procedure:


Example
1. Compute absolute mean
Machine1 Machine2 Machine3 differences:
25.40 23.40 20.00
26.31 21.80 22.20
X1 − X 2 = 24.93 − 22.61 = 2.32
24.10 23.50 19.75 X1 − X 3 = 24.93 − 20.59 = 4.34
23.74 22.75 20.60
25.10 21.60 20.40 X 2 − X 3 = 22.61 − 20.59 = 2.02
2. Compute critical range:
MSW ⎛ 1 1 ⎞
Critical Range = QU ( c ,n −c ) ⎜⎜ + ⎟⎟ = 1.618
2 ⎝ nj nj' ⎠
3. All of the absolute mean differences are greater than the
critical range. There is a significant difference between
each pair of means at the 5% level of significance.
© 2004 Prentice-Hall, Inc. Chap 11-31

Solution in PHStat

Use PHStat | c-Sample Tests | Tukey-Kramer


Procedure …
Excel Worksheet that Performs the Tukey-
Kramer Procedure for the Previous Example

Microsoft Excel
Worksheet

© 2004 Prentice-Hall, Inc. Chap 11-32

Levene’s Test for


Homogeneity of Variance

The Null Hypothesis


H 0 : σ 12 = σ 22 = L = σ c2
The c population variances are all equal
The Alternative Hypothesis
H1 : Not all σ 2j are equal ( j = 1, 2, L , c )
Not all the c population variances are equal

© 2004 Prentice-Hall, Inc. Chap 11-33

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-12

Levene’s Test for Homogeneity


of Variance: Procedure

1. For each observation in each group, obtain


the absolute value of the difference between
each observation and the median of the
group.
2. Perform a one-way analysis of variance on
these absolute differences.

© 2004 Prentice-Hall, Inc. Chap 11-34

Levene’s Test for Homogeneity


of Variances: Example

As production manager, you Machine1 Machine2 Machine3


want to see if 3 filling 25.40 23.40 20.00
machines have different 26.31 21.80 22.20
variance in filling times. You 24.10 23.50 19.75
assign 15 similarly trained & 23.74 22.75 20.60
experienced workers, 5 per
25.10 21.60 20.40
machine, to the machines. At
the .05 significance level, is
there a difference in the
variance in filling times?

© 2004 Prentice-Hall, Inc. Chap 11-35

Levene’s Test:
Absolute Difference from the Median

Time abs(Time - median(Time))


Machine1 Machine2 Machine3 Machine1 Machine2 Machine3
25.4 23.4 20 0.3 0.65 0.4
26.31 21.8 22.2 1.21 0.95 1.8
24.1 23.5 19.75 1 0.75 0.65
23.74 22.75 20.6 1.36 0 0.2
25.1 21.6 20.4 0 1.15 0
median 25.1 22.75 20.4

© 2004 Prentice-Hall, Inc. Chap 11-36

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

© 2004 Prentice-Hall, Inc. Chap 11-37

Levene’s Test Example:


Solution

H0: σ 12 = σ 22 = σ 32 Test Statistic:


H1: Not All Equal MSA 0.0337
α = .05 F= = = 0.0970
MSW 0.3475
df1= 2 df2 = 12
Decision:
Critical Value(s):
Do not reject at α = 0.05.
α = 0.05 Conclusion:
There is no evidence that
at least one σ 2j differs
0 3.89 F from the rest.
© 2004 Prentice-Hall, Inc. Chap 11-38

Randomized Blocked Design


Items are Divided into Blocks
Individual items in different samples are matched,
or repeated measurements are taken
Reduced within group variation (i.e., remove the
effect of block before testing)
Response of Each Treatment Group is
Obtained
Assumptions
Same as completely randomized design
No interaction effect between treatments and
blocks
© 2004 Prentice-Hall, Inc. Chap 11-39

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-14

Randomized Blocked Design


(Example)
Factor (Training Method)
Factor Levels
(Groups)
Blocked
Experiment
Units
21 hrs 17 hrs 31 hrs
Dependent
Variable 27 hrs 25 hrs 28 hrs
(Response)
29 hrs 20 hrs 22 hrs
© 2004 Prentice-Hall, Inc. Chap 11-40

Randomized Block Design


(Partition of Total Variation)
Variation Due Commonly referred to as:
to Group Sum of Squares Among
SSA Among Groups Variation
+
Variation Commonly referred to as:
Variation Among
Among All Sum of Squares Among
Blocks Blocks
Observations
SST
= SSBL
+
Variation Due Commonly referred to as:
to Random Sum of Squares Error
Sampling Sum of Squares
SSW Unexplained
© 2004 Prentice-Hall, Inc. Chap 11-41

Total Variation

( )
c r
SST = ∑∑ X ij − X
2

j =1 i =1

r = the number of blocks


c = the number of groups or levels
n = the total number of observations ( n = rc )
X ij = the value in the i -th block for the j -th treatment level
X i• = the mean of all values in block i
X • j = the mean of all values for treatment level j
df = n − 1
© 2004 Prentice-Hall, Inc. Chap 11-42

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)

© 2004 Prentice-Hall, Inc. Chap 11-45

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-16

Randomized Block F Test for


Differences in c Means
H 0 : µ•1 = µ •2 = • • • = µ• c
No treatment effect
H1 : Not all µ• j are equal
Test Statistic Reject
MSA
F= α
MSE
Degrees of Freedom
df1 = c − 1 0 FU F
df 2 = ( r − 1)( c − 1)
© 2004 Prentice-Hall, Inc. Chap 11-46

Summary Table

Source of Degrees of Sum of Mean F


Variation Freedom Squares Squares Statistic

Among MSA = MSA/


c–1 SSA
Groups SSA/(c – 1) MSE

Among MSBL = MSBL/


r–1 SSBL
Blocks SSBL/(r – 1) MSE
MSE =
Error (r – 1) •(c – 1) SSE
SSE/[(r – 1)•(c– 1)]
Total rc – 1 SST

© 2004 Prentice-Hall, Inc. Chap 11-47

Randomized Block Design:


Example
As production manager, you
want to see if 3 filling machines Machine1 Machine2 Machine3
have different mean filling 25.40 23.40 20.00
times. You assign 15 workers 26.31 21.80 22.20
with varied experience into 5 24.10 23.50 19.75
groups of 3 based on similarity 23.74 22.75 20.60
of their experience, and
25.10 21.60 20.40
assigned each group of 3
workers with similar experience
to the machines. At the .05
significance level, is there a
difference in mean filling
times?
© 2004 Prentice-Hall, Inc. Chap 11-48

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-17

Randomized Block Design


Example Computation
Machine1 Machine2 Machine3 X •1 = 24.93 r =5
25.40 23.40 20.00
26.31 21.80 22.20 X •2 = 22.61 c=3
24.10 23.50 19.75 X •3 = 20.59 n = 15
23.74 22.75 20.60
25.10 21.60 20.40 X = 22.71
SSA = 5 ⎡( 24.93 − 22.71) + ( 22.61 − 22.71) + ( 20.59 − 22.71) ⎤
2 2 2
⎣ ⎦
= 47.164
SSE = 8.4025
MSA = SSA /(c -1) = 47.16 / 2 = 23.5820
MSE = SSE / ⎡⎣ ( r -1) ( c − 1) ⎤⎦ = 8.4025 / 8 = 1.0503
© 2004 Prentice-Hall, Inc. Chap 11-49

Randomized Block Design


Example: Summary Table

Source of Degrees of Sum of Mean F


Variation Freedom Squares Squares Statistic

Among SSA= MSA = 23.582/1.0503


2
Groups 47.164 23.582 =22.452

Among SSBL= MSBL = .6627/1.0503


4
Blocks 2.6507 .6627 =.6039
SSE= MSE =
Error 8
8.4025 1.0503
SST=
Total 14
58.2172
© 2004 Prentice-Hall, Inc. Chap 11-50

Randomized Block Design


Example: Solution
H0: µ1 = µ2 = µ3 Test Statistic:
H1: Not All Equal MSA 23.582
α = .05 F= = = 22.45
df1= 2 df2 = 8 MSE 1.0503

Critical Value(s): Decision:


Reject at α = 0.05.
α = 0.05 Conclusion:
There is evidence that at
least one µ j differs from
0 4.46 F the rest.
© 2004 Prentice-Hall, Inc. Chap 11-51

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-18

Randomized Block Design


in Excel

Tools | Data Analysis | ANOVA: Two Factor


Without Replication
Example Solution in Excel Spreadsheet

Microsoft Excel
Worksheet

© 2004 Prentice-Hall, Inc. Chap 11-52

The Tukey Procedure


Similar to the Tukey Procedure for the
Completely Randomized Design Case
Critical Range
MSE
Critical Range = QU ( c ,( r −1)( c −1) )
r

© 2004 Prentice-Hall, Inc. Chap 11-53

The Tukey Procedure: Example


1. Compute absolute mean
Machine1 Machine2 Machine3 differences:
25.40 23.40 20.00
26.31 21.80 22.20
X •1 − X •2 = 24.93 − 22.61 = 2.32
24.10 23.50 19.75 X •1 − X •3 = 24.93 − 20.59 = 4.34
23.74 22.75 20.60
25.10 21.60 20.40 X •2 − X •3 = 22.61 − 20.59 = 2.02
2. Compute critical range:
MSE 1.0503
Critical Range = QU ( c ,( r −1)( c −1) ) = 4.04 =1.8516
r 5
3. All of the absolute mean differences are greater. There
is a significance difference between each pair of means at
5% level of significance.
© 2004 Prentice-Hall, Inc. Chap 11-54

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-19

Two-Way ANOVA

Examines the Effect of:


Two factors 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 percentage of
carbonation depend on which level the line speed is
set?

© 2004 Prentice-Hall, Inc. Chap 11-55

Two-Way ANOVA (continued)

Assumptions
Normality
Populations are normally distributed
Homogeneity of Variance
Populations have equal variances
Independence of Errors
Independent random samples are drawn

© 2004 Prentice-Hall, Inc. Chap 11-56

Two-Way ANOVA
Total Variation Partitioning

Variation Due to SSA +


Factor A d.f.= r-1

SSB +
Variation Due to
d.f.= c-1
Total Variation Factor B

Variation Due to SSAB +


SST
= Interaction d.f.= (r-1)(c-1)
d.f.= n-1
Variation Due to SSE
Random Sampling d.f.= rc(n’-1)

© 2004 Prentice-Hall, Inc. Chap 11-57

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

r = the number of levels of factor A


c = the number of levels of factor B
n ' = the number of values (replications) for each cell
n = the total number of observations in the experiment
X ijk = the value of the k -th observation for level i of
factor A and level j of factor B

© 2004 Prentice-Hall, Inc. Chap 11-58

Total Variation

( )
r c n' 2
SST = ∑ ∑ ∑ X ijk − X
i =1 j =1 k =1

Sum of Squares Total


= total variation among all
observations around the grand mean
r c n' r c n'

∑ ∑ ∑ 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

Sum of Squares Due to Factor A


= the difference among the means of
the various levels of factor A and the
grand mean

© 2004 Prentice-Hall, Inc. Chap 11-60

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

Sum of Squares Due to Factor B


= the difference among the means of
the various levels of factor B and the
grand mean

© 2004 Prentice-Hall, Inc. Chap 11-61

Interaction Variation

( )
r c 2
SSAB = n ' ∑∑ X ij • − X i•• − X • j • + X
i =1 j =1

Sum of Squares Due to Interaction between A and B


= the effect of the combinations of factor A and
factor B

© 2004 Prentice-Hall, Inc. Chap 11-62

Random Error

( )
r c n'
SSE = ∑∑∑ X ijk − X ij •
i =1 j =1 k =1

Sum of Squares Error


= the differences among the observations within
each cell and the corresponding cell means

© 2004 Prentice-Hall, Inc. Chap 11-63

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

H0: ΑΒij = 0 (for all i and j) F Test for Interaction Effect


MSAB SSAB Reject if
H1: ΑΒij ≠ 0 F= MSAB =
MSE ( r − 1)( c − 1) F > FU
© 2004 Prentice-Hall, Inc. Chap 11-64

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

© 2004 Prentice-Hall, Inc. Chap 11-65

Features of Two-Way ANOVA


F Test
Degrees of Freedom Always Add Up
rcn’-1=rc(n’-1)+(c-1)+(r-1)+(c-1)(r-1)
Total=Error+Column+Row+Interaction
The Denominator of the F Test is Always the
Same but the Numerator is Different
The Sums of Squares Always Add Up
Total=Error+Column+Row+Interaction

© 2004 Prentice-Hall, Inc. Chap 11-66

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-23

Kruskal-Wallis Rank Test


Used to Analyze Completely Randomized
Experimental Designs
Extension of Wilcoxon Rank Sum Test
Tests the equality of more than 2 population
medians
Distribution-Free Test Procedure
Use χ2 Distribution to Approximate if Each
Sample Group Size nj > 5
df = c – 1

© 2004 Prentice-Hall, Inc. Chap 11-67

Kruskal-Wallis Rank Test


Assumptions
Independent random samples are drawn
Continuous dependent variable
Data may be ranked both within and among
samples
Populations have same variability
Populations have same shape
Robust with Regard to Last 2 Conditions
Use F test in completely randomized designs and
when the more stringent assumptions hold

© 2004 Prentice-Hall, Inc. Chap 11-68

Kruskal-Wallis Rank Test


Procedure
Obtain Ranks
In event of tie, each of the tied values gets their
average rank
Add the Ranks for Data from Each of the c
Groups
Square to obtain Tj2
⎡ 12 c T2 ⎤
H =⎢
+
∑ j
⎥ − 3(n + 1)
⎣⎢ n( n 1) j =1 n ⎥
j ⎦

n = n1 + n2 + L + nc

© 2004 Prentice-Hall, Inc. Chap 11-69

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-24

Kruskal-Wallis Rank Test


Procedure (continued)

Compute Test Statistic


⎡ 12 c T2 ⎤
H =⎢ ∑ j ⎥ − 3(n + 1)
⎢⎣ n(n + 1) j =1 n j ⎥⎦
n = n1 + n2 + L + nc
n j = # of observation in the j –th sample ; ( j =
1, 2, …, c )
T j = sum of the ranks assigned to the j –th
sample
T j2 = square of T j
H may be approximated by chi-square
© 2004 Prentice-Hall, Inc. distribution with df = c –1 when each nj >5 Chap 11-70

Kruskal-Wallis Rank Test


Procedure (continued)

Critical Value for a Given α


Upper tail χ U2
Decision Rule
Reject H0: M1 = M2 = ••• = Mc if test statistic
H > χU
2

Otherwise, do not reject H0

© 2004 Prentice-Hall, Inc. Chap 11-71

Kruskal-Wallis Rank Test:


Example
Machine1 Machine2 Machine3
As production manager, you
25.40 23.40 20.00
want to see if 3 filling machines
26.31 21.80 22.20
have different median filling
24.10 23.50 19.75
times. You assign 15 similarly
23.74 22.75 20.60
trained & experienced workers,
25.10 21.60 20.40
5 per machine, to the
machines. At the .05
significance level, is there a
difference in median filling
times?

© 2004 Prentice-Hall, Inc. Chap 11-72

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-25

Example Solution: Step 1


Obtaining a Ranking
Raw Data Ranks
Machine1 Machine2 Machine3 Machine1 Machine2 Machine3
25.40 23.40 20.00 14 9 2
26.31 21.80 22.20 15 6 7
24.10 23.50 19.75 12 10 1
23.74 22.75 20.60 11 8 4
25.10 21.60 20.40 13 5 3
65 38 17

© 2004 Prentice-Hall, Inc. Chap 11-73

Example Solution: Step 2


Test Statistic Computation

⎡ 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

Kruskal-Wallis Test Example


Solution
H0: M1 = M2 = M3 Test Statistic:
H1: Not all equal H = 11.58
α = .05
df = c - 1 = 3 - 1 = 2 Decision:
Critical Value(s): Reject at α = .05.

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

Kruskal-Wallis Test in PHStat

PHStat | c-Sample Tests | Kruskal-Wallis Rank


Sum Test …
Example Solution in Excel Spreadsheet

Microsoft Excel
Worksheet

© 2004 Prentice-Hall, Inc. Chap 11-76

Friedman Rank Test

Used to Analyze Randomized Block


Experimental Designs
Tests the equality of more than 2 population
medians
Distribution-Free Test Procedure
Use χ2 Distribution to Approximate if the
Number of Blocks r > 5
df = c – 1

© 2004 Prentice-Hall, Inc. Chap 11-77

Friedman Rank Test

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

© 2004 Prentice-Hall, Inc. Chap 11-78

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-27

Friedman Rank Test:


Procedure

Replace the c observations by their ranks in


each of the r blocks; assign average rank
for ties
c
12
Test statistic: FR = ∑
rc ( c + 1) j =1
R⋅2j − 3r ( c + 1)

R.j2 is the square of the rank total for group j


FR can be approximated by a chi-square
distribution with (c –1) degrees of freedom
The rejection region is in the right tail

© 2004 Prentice-Hall, Inc. Chap 11-79

Friedman Rank Test: Example


As production manager, you
want to see if 3 filling Machine1 Machine2 Machine3
machines have different 25.40 23.40 20.00
median filling times. You
assign 15 workers with varied 26.31 21.80 22.20
experience into 5 groups of 3 24.10 23.50 19.75
based on similarity of their 23.74 22.75 20.60
experience, and assigned each 25.10 21.60 20.40
group of 3 workers with similar
experience to the machines. At
the .05 significance level, is
there a difference in median
filling times?

© 2004 Prentice-Hall, Inc. Chap 11-80

Friedman Rank Test:


Computation Table
Timing Rank
Machine 1 Machine 2 Machine 3 Machine 1 Machine 2 Machine 3
25.4 23.4 20 3 2 1
26.31 21.8 22.2 3 1 2
24.1 23.5 19.75 3 2 1
23.74 22.75 20.6 3 2 1
25.1 21.6 20.4 3 2 1
R. j 15 9 6
2
R. j 225 81 36
c
12
FR = ∑ R⋅2j − 3r ( c + 1)
rc ( c + 1) j =1
12
= ( 342 ) − 3 ( 5)( 4 ) = 8.4
© 2004 Prentice-Hall, Inc.
( 5)( 3)( 4 ) Chap 11-81

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.
Chapter 11 Student Lecture Notes 11-28

Friedman Rank Test Example


Solution
H0: M1 = M2 = M3 Test Statistic:
H1: Not all equal FR = 8.4
α = .05
df = c - 1 = 3 - 1 = 2 Decision:
Critical Value: Reject at α = .05

Conclusion:
α = .05
There is evidence that
population medians are
not all equal.
0 5.991
© 2004 Prentice-Hall, Inc. Chap 11-82

Chapter Summary

Described 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
Discussed the Randomized Block Design
F Test for the Difference in More than Two Means
The Tukey Procedure

© 2004 Prentice-Hall, Inc. Chap 11-83

Chapter Summary (continued)

Described the Factorial Design: Two-Way


Analysis of Variance
Examine effects of factors and interaction
Discussed Kruskal-Wallis Rank Test:
Nonparametric Analysis for the Completely
Randomized Design
Illustrated Friedman Rank Test:
Nonparametric Analysis for the Randomized
Block Design
© 2004 Prentice-Hall, Inc. Chap 11-84

Statistics for Managers Using Microsoft Excel, 2/e © 1999 Prentice-Hall, Inc.

You might also like