You are on page 1of 61

Basic Business Statistics

(8th Edition)
Chapter 11
Analysis of Variance

2002 Prentice-Hall, Inc.

Chap 11-1

Randomized Design Example


Factor (Training Method)
Factor
Levels
(Treatment
s)
Randomly
Assigned
Units

Dependent
Variable
(Response)

21 hrs
27 hrs
29 hrs

17 hrs
25 hrs
20 hrs

31 hrs
28 hrs
22 hrs

2002 Prentice-Hall, Inc.

Chap 11-2

One-Factor 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

2002 Prentice-Hall, Inc.

Chap 11-3

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)
groups

H1 : Not all i are the same

At least one population mean is different


(others may be the same!)

There is treatment effect

Does not mean that all population means are


different

2002 Prentice-Hall, Inc.

Chap 11-4

One-Factor ANOVA (No Treatment


Effect)

H 0 : 1 2 L c
H1 : Not all i are the same
The Null
Hypothesis is
True

1 2 3
2002 Prentice-Hall, Inc.

Chap 11-5

One-Factor ANOVA
(Treatment Effect Present)

H 0 : 1 2 L c

H1 : Not all i are the same

1 2 3
2002 Prentice-Hall, Inc.

The Null
Hypothesis is
NOT True

1 2 3
Chap 11-6

Total Variation
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

X
2002 Prentice-Hall, Inc.

nj

X
j 1 i 1

ij

the overall or grand mean


Chap 11-7

Total Variation
(continued)

SST X 11 X

X
2

21

L X nc c X

Response, X

X
Group 1
2002 Prentice-Hall, Inc.

Group 2

Group 3
Chap 11-8

Among-Group Variation

SSA n j ( X j X )
j 1

SSA
MSA
c 1

X j : The sample mean of group j


X : The overall or grand mean
i j
2002 Prentice-Hall, Inc.

Variation Due to Differences Among Groups


Chap 11-9

Among-Group Variation
(continued)

SSA n1 X 1 X

n2 X 2 X

L nc X c X

Response, X

X3
X1
Group 1
2002 Prentice-Hall, Inc.

Group 2

X2

Group 3
Chap 11-10

-Within Group Variation


c

nj

SSW ( X ij X j )

j 1 i 1

SSW
MSW
nc

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.
2002 Prentice-Hall, Inc.

Chap 11-11

Within-Group Variation(continued)

SSW X 11 X 1 X 21 X 1 L X nc c X c
2

Response, X

X3

X1
Group 1
2002 Prentice-Hall, Inc.

Group 2

X2
Group 3
Chap 11-12

Within-Group Variation

(continued)

For c = 2, this is the


SSW
MSW
pooled-variance in the
nc
t-Test.
2
2
2
(n1 1) S1 (n2 1) S 2 (nc 1) Sc

(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
2002 Prentice-Hall, Inc.

Chap 11-13

One-Factor ANOVA
F Test Statistic

Test statistic:

MSA
F
MSW

MSA is mean squares among or between


variances
MSW is mean squares within or error
variances

df

1
1
Degrees of freedom
df 2 n 1

2002 Prentice-Hall, Inc.

Chap 11-14

One-Factor ANOVA - Summary Table


Source of
Variation

Among
(Factor)
Within
(Error)
Total
2002 Prentice-Hall, Inc.

Degrees
of
Freedom

Sum of
Squares

Mean Squares
(Variance)

F
Statistic

SSA

MSA =
SSA/(c 1 )

MSA/MS
W

nc

SSW

MSW =
SSW/(n
c)

n1

SST =
SSA +
SSW

c1

Chap 11-15

Features of One-Factor 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 closed to 1 if the null


is true

2002 Prentice-Hall, Inc.

Chap 11-16

Features of One-Factor
ANOVA F Statistic

(continued)

The numerator is expected to be greater


than the denominator
The ratio will be larger than 1 if the null
is false

2002 Prentice-Hall, Inc.

Chap 11-17

One-Factor ANOVA F Test Example


As production manager, you
want to see if three filling
machines have different
mean filling times.
You assign 15 similarly
trained and experienced
workers, five per machine,
to the machines.
machines
At the .05 significance level,
is there a difference in
mean filling times?
2002 Prentice-Hall, Inc.

Machine1 Machine2 Machine3

25.40
26.31
24.10
23.74
25.10

23.40
21.80
23.50
22.75
21.60

20.00
22.20
19.75
20.60
20.40

Chap 11-18

One-Factor ANOVA Example: Scatter


Diagram
Machine1 Machine2 Machine3

25.40
26.31
24.10
23.74
25.10

23.40
21.80
23.50
22.75
21.60

20.00
22.20
19.75
20.60
20.40

27
26
25
24
23
22

X 1 24.93

X 2 22.61

X 3 20.59

X 22.71

2002 Prentice-Hall, Inc.

21
20

Time in Seconds

X1

X2

X
X3

19

Chap 11-19

One-Factor ANOVA
Example Computations
Machine1 Machine2 Machine3

25.40
26.31
24.10
23.74
25.10

23.40
21.80
23.50
22.75
21.60

20.00
22.20
19.75
20.60
20.40

X 1 24.93

nj 5

X 2 22.61

c3

X 3 20.59

n 15

X 22.71

2
2
2

SSA 5 24.93 22.71 22.61 22.71 20.59 22.71

47.164

SSW 4.2592 3.112 3.682 11.0532


MSA SSA /(c -1) 47.16 / 2 23.5820
MSW SSW /(n - c ) 11.0532 /12 .9211
2002 Prentice-Hall, Inc.

Chap 11-20

Summary Table

Source of
Variation

Degrees
of
Freedom

Sum of
Squares

Mean Squares
(Variance)

F
Statistic

MSA/MS
W
=25.60

Among
(Factor)

3-1=2

47.1640

23.5820

Within
(Error)

153=12

11.0532

.9211

Total

151=14

58.2172

2002 Prentice-Hall, Inc.

Chap 11-21

One-Factor ANOVA
Example Solution
Test Statistic:

H0: 1 = 2 = 3
H1: Not All Equal
= .05
df1= 2

MSA

23.5820
25.6
F

MSW
.9211

df2 = 12

Decision:
Reject at = 0.05

Critical Value(s):

= 0.05

0
2002 Prentice-Hall, Inc.

3.89

Conclusion:
There is evidence that at least
one i differs from the rest.
Chap 11-22

Solution in EXCEL

Use tools | data analysis | ANOVA: single


factor
EXCEL worksheet that performs the onefactor ANOVA of the example

Micros oft Excel


Works heet

2002 Prentice-Hall, Inc.

Chap 11-23

The Tukey-Kramer Procedure

Tells which population means are


significantly different
f(X)

Two groups whose means


may be significantly
different

1= 2

Post hoc (a posteriori) procedure

e.g.: 1 = 2 3

Done after rejection of equal means in ANOVA

Ability for pair-wise comparisons

Compare absolute mean differences with critical


range

2002 Prentice-Hall, Inc.

Chap 11-24

The Tukey-Kramer Procedure:


Example
Machine1 Machine2 Machine3
25.40
23.40
20.00
26.31
21.80
22.20
24.10
23.50
19.75
23.74
22.75
20.60
25.10
21.60
20.40
2. Compute critical range:

Critical Range QU ( c ,n c )

1. Compute absolute mean


differences:

X 1 X 2 24.93 22.61 2.32


X 1 X 3 24.93 20.59 4.34
X 2 X 3 22.61 20.59 2.02

MSW
2

1
1
1.618

n
n
j '
j

3. All of the absolute mean differences are greater. There is a


significant difference between each pair of means at 5% level
of significance.
2002 Prentice-Hall, Inc.

Chap 11-25

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

2002 Prentice-Hall, Inc.

Chap 11-26

Randomized Blocked Design


(Example)
Factor (Training Method)
Factor
Levels
(Treatment
s)
Blocked
Experiment
Units
Dependent
Variable
(Response)
2002 Prentice-Hall, Inc.

21 hrs
27 hrs
29 hrs

17 hrs
25 hrs
20 hrs

31 hrs
28 hrs
22 hrs
Chap 11-27

Randomized Block Design


(Partition of Total Variation)
Variation Due
to Treatment
SSA

Variation
among all
Observations
SST

2002 Prentice-Hall, Inc.

Variation
among
Blocks
SSBL

Variation Due
to Random
Sampling
SSW

Commonly referred to
as:
Sum of Squares
Among
Among Groups
Variation referred to
Commonly
as:
Sum of Squares
among Block
Commonly referred to as:
Sum of squares error
Sum of squares
unexplained
Chap 11-28

Total Variation
c

SST X ij X
j 1 i

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
2002 Prentice-Hall, Inc.

Chap 11-29

Among-Group Variation
c

SSA r X j X
j 1

X j

X
i 1

ij

r
df c 1
SSA
MSA
c 1
2002 Prentice-Hall, Inc.

(treatment group means)

Chap 11-30

Among-Block Variation
r

SSBL c X i X
i 1

X i

X
j 1

ij

(block means)

c
df r 1
SSBL
MSBL
r 1
2002 Prentice-Hall, Inc.

Chap 11-31

Random Error
c

SSE X ij X i X j X
j 1 i 1

df r 1 c 1
SSE
MSE
r 1 c 1

2002 Prentice-Hall, Inc.

Chap 11-32

Randomized Block F Test for Differences in c


Means

H 0 : 1 2 c

H1 : Not all j are equal

Test Statistic

No treatment effect

Reject

MSA
F
MSE

Degrees of Freedom

df1 c 1
df 2 r 1 c 1

2002 Prentice-Hall, Inc.

FU

F
Chap 11-33

Summary Table

Source of
Variation

Degrees of
Freedom

Sum of
Squares

Mean
Squares

F
Statistic

Among
Treatmen
t

c1

SSA

MSA =
SSA/(c 1)

MSA/
MSE

SSBL

MSBL =
SSBL/(r 1)

MSBL/
MSE

Error

(r 1) c
1)

SSE

MSE =
SSE/[(r 1)(c
1)]

Total

rc 1

SST

Among
Block

2002 Prentice-Hall, Inc.

r1

Chap 11-34

Randomized Block Design: Example


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

2002 Prentice-Hall, Inc.

Chap 11-35

Randomized Block Design Example


Computation
Machine1 Machine2 Machine3

25.40
26.31
24.10
23.74
25.10

23.40
21.80
23.50
22.75
21.60

20.00
22.20
19.75
20.60
20.40

X 1 24.93

r 5

X 2 22.61

c3
n 15

X 3 20.59
X 22.71

2
2
2

SSA 5 24.93 22.71 22.61 22.71 20.59 22.71

47.164

SSE 8.4025
MSA SSA /(c -1) 47.16 / 2 23.5820
MSE SSE / (r -1) c 1

2002 Prentice-Hall, Inc.

8.4025 / 8 1.0503
Chap 11-36

Randomized Block Design Example:


Summary Table
Source of
Variation

Degrees of
Freedom

Sum of
Squares

Mean
Squares

F
Statistic

Among
Treatment

SSA=
47.164

MSA =
23.582

23.582/1.050
3=22.452

Among
Block

SSBL=
2.6507

MSBL = .6627/1.0503
.6627
=.6039

Error

SSE=
8.4025

MSE =
1.0503

Total

14

SST=
58.2172

2002 Prentice-Hall, Inc.

Chap 11-37

Randomized Block Design Example:


Solution
Test Statistic:

H0: 1 = 2 = 3
H1: Not All Equal
= .05
df1= 2

MSA

23.582
22.45
F

MSE 1.0503

df2 = 8

Decision:
Reject at = 0.05

Critical Value(s):

= 0.05

0
2002 Prentice-Hall, Inc.

4.46

Conclusion:
There is evidence that at least
one i differs from the rest.
Chap 11-38

The Tukey-Kramer Procedure

Similar to the Tukey-Kramer procedure


for the completely randomized design
case

Critical
Criticalrange
Range Q

2002 Prentice-Hall, Inc.

U ( c , r 1 c 1 )

MSE
r

Chap 11-39

The Tukey-Kramer Procedure: Example

Machine1 Machine2 Machine3

25.40
26.31
24.10
23.74
25.10

23.40
21.80
23.50
22.75
21.60

20.00
22.20
19.75
20.60
20.40

1. Compute absolute mean


differences:

X 1 X 2 24.93 22.61 2.32


X 1 X 3 24.93 20.59 4.34
X 2 X 3 22.61 20.59 2.02

2. Compute Critical Range:

Critical Range QU ( c , r 1 c 1 )

MSE
1.0503
4.04
1.8516
r
5

3. All of the absolute mean differences are greater. There is a


significant difference between each pair of means at 5% level
of significance.
2002 Prentice-Hall, Inc.

Chap 11-40

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

2002 Prentice-Hall, Inc.

e.g.: Does the effect of one particular


percentage of carbonation depend on
which level the line speed is set?

Chap 11-41

Two-Way ANOVA

(continued)

Assumptions

Normality

Populations are normally distributed

Homogeneity of variance

Populations have equal variances

Independence of errors

2002 Prentice-Hall, Inc.

Independent random samples are


drawn
Chap 11-42

Total Variation
Partitioning
Variation Due to
Treatment A

Total Variation
SST
d.f.= n-1

Variation Due to
Treatment B
Variation Due to
Interaction
Variation Due to
Random Sampling

2002 Prentice-Hall, Inc.

SSA

d.f.= r-1
SSB
d.f.= c-1

+
+

SSAB +
d.f.= (r-1)(c-1)
SSE
d.f.= rc(n-1)
Chap 11-43

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

2002 Prentice-Hall, Inc.

Chap 11-44

Total Variation
r

n'

SST X ijk X
i 1 j 1 k 1

Sum of Squares Total


= total variation among all
observations around the grand mean
r

n'

X
i 1 j 1 k 1
'

ijk

n'

X
i 1 j 1 k 1

rcn
n
the overall or grand mean

2002 Prentice-Hall, Inc.

ijk

Chap 11-45

Factor A Variation
r

SSA cn X i X
'

i 1

Sum of Squares Due to Factor A


= the difference among the various
levels of factor A and the grand
mean
2002 Prentice-Hall, Inc.

Chap 11-46

Factor B Variation
c

SSB rn X j X
'

j 1

Sum of Squares Due to Factor B


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

2002 Prentice-Hall, Inc.

Chap 11-47

Interaction Variation
r

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

2002 Prentice-Hall, Inc.

Chap 11-48

Random Error
r

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
2002 Prentice-Hall, Inc.

Chap 11-49

Two-Way ANOVA: The F Test Statistic


H0: 1 .= 2 . = = r .

F Test for Factor A Main Effect


MSA
F
MSE

SSA
MSA
r 1

Reject if
F > FU

SSB
MSB
c 1

Reject if
F > FU

H1: Not all i . are equal


H0: 1 = . 2 = = c F Test for Factor B Main Effect
H1: Not all . j are equal

MSB
F
MSE

H0: ij = 0 (for all i and j)


H1: ij 0
2002 Prentice-Hall, Inc.

MSAB
F
MSE

F Test for Interaction Effect


SSAB
MSAB
r 1 c 1

Reject if
F > FU
Chap 11-50

Two-Way ANOVA
Summary Table
Degrees of
Freedom

Sum of
Square
s

Mean
Squares

F
Statisti
c

r1

SSA

MSA =
SSA/(r 1)

MSA/
MSE

c1

SSB

MSB =
SSB/(c 1)

MSB/
MSE

AB
(Interaction
)

(r 1)(c 1)

SSAB

MSAB =
SSAB/ [(r 1)(c 1)]

MSAB/
MSE

Error

rc n 1)

SSE

MSE =
SSE/[rc n 1)]

Total

rc n 1

SST

Source of
Variation

Factor A
(Row)
Factor B
(Column)

2002 Prentice-Hall, Inc.

Chap 11-51

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

2002 Prentice-Hall, Inc.

Chap 11-52

Kruskal-Wallis Rank Test


for c Medians

Extension of Wilcoxon Rank-Sum Test

Tests the equality of more than two (c)


population medians

Distribution-free test procedure

Used to analyze completely randomized


experimental designs

Use 2 distribution to approximate if


each sample group size nj > 5

df = c 1

2002 Prentice-Hall, Inc.

Chap 11-53

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 two conditions

Use F test in completely randomized designs


and when the more stringent assumptions hold

2002 Prentice-Hall, Inc.

Chap 11-54

Kruskal-Wallis Rank Test


Procedure

Obtain ranks

In event of a tie, each of the tied values gets


its average rank

Add the ranks for data from each of the


c

T
12
j
H
3(n 1)
groups

n(n 1) j 1 n j 2

Square to obtain tj
n n1 n2 L nc

2002 Prentice-Hall, Inc.

Chap 11-55

Kruskal-Wallis Rank Test


Procedure
(continued)

Compute test statistic

T
12
j
H
3(n 1)

n(n 1) j 1 n j
n n1 n2 L nc
c

n j # Of observation in j th sample
H may be approximated by chi-square
distribution with df = c 1 when each nj >5

2002 Prentice-Hall, Inc.

Chap 11-56

Kruskal-Wallis Rank Test


Procedure
(continued)

Critical value for a given


Upper tail

2
U

Decision rule

Reject2 H0: M1 = M2 = = mc if test statistic

H>
Otherwise do not reject H0

2002 Prentice-Hall, Inc.

Chap 11-57

Kruksal-Wallis Rank Test:


Example
As production manager, you
want to see whether three
filling machines have different
median filling times. You
assign 15 similarly trained
and experienced workers,
five per machine, to the
machines. At the .05
significance level, is there a
difference in median filling
times?

2002 Prentice-Hall, Inc.

Machine1 Machine2
Machine3

25.40
26.31
24.10
23.74
25.10

23.40
21.80
23.50
22.75
21.60

20.00
22.20
19.75
20.60
20.40

Chap 11-58

Example Solution: Step 1 Obtaining a


Ranking
Ranks

Raw Data

Machine1 Machine2 Machine3

25.40
26.31
24.10
23.74
25.10

2002 Prentice-Hall, Inc.

23.40
21.80
23.50
22.75
21.60

20.00
22.20
19.75
20.60
20.40

Machine1 Machine2 Machine3

14
15
12
11
13
65

9
6
10
8
5
38

2
7
1
4
3
17

Chap 11-59

Example Solution: Step 2


Test Statistic Computation

T
c
12
j
3(n 1)

n(n 1) j 1 n
j

2
2
2

12
65
38
17

3(15 1)

5
5
15(15 1) 5

11.58
2002 Prentice-Hall, Inc.

Chap 11-60

Kruskal-Wallis Test Example Solution


H0: M1 = M2 = M3
H1: Not all equal
= .05
df = c - 1 = 3 - 1 = 2
Critical Value(s):

= .05

0
2002 Prentice-Hall, Inc.

5.991

Test Statistic:
H = 11.58

Decision:
Reject at = .05

Conclusion:
There is evidence that
population medians are
not all equal.
Chap 11-61

You might also like