Statistics for Business and Economics
Chapter 8
Design of Experiments and Analysis of Variance
Learning Objectives
1. Describe Analysis of Variance (ANOVA)
2. Explain the Rationale of ANOVA
3. Compare Experimental Designs
4. Test the Equality of 2 or More Means• Completely Randomized Design• Factorial Design
Experiments
Experiment
• Investigator controls one or more independent variables
– Called treatment variables or factors– Contain two or more levels (subcategories)
• Observes effect on dependent variable – Response to levels of independent variable
• Experimental design: plan used to test hypotheses
Examples of Experiments
1. Thirty stores are randomly assigned 1 of 4 (levels) store displays (independent variable) to see the effect on sales (dependent variable).
2. Two hundred consumers are randomly assigned 1 of 3 (levels) brands of juice (independent variable) to study reaction (dependent variable).
Experimental Designs
Factorial
One-Way ANOVA
Experimental Designs
Completely Randomized
Two-Way ANOVA
Completely Randomized Design
Experimental Designs
Factorial
One-Way ANOVA
Experimental Designs
Completely Randomized
Two-Way ANOVA
Completely Randomized Design
• Experimental units (subjects) are assigned randomly to treatments
– Subjects are assumed homogeneous
• One factor or independent variable– Two or more treatment levels or
classifications
• Analyzed by one-way ANOVA
Factor (Training Method)
Factor levels(Treatments)
Level 1 Level 2 Level 3
Experimentalunits
Dependent 21 hrs. 17 hrs. 31 hrs.
variable 27 hrs. 25 hrs. 28 hrs.
(Response) 29 hrs. 20 hrs. 22 hrs.
Randomized Design Example
One-Way ANOVA F-Test
Experimental Designs
Factorial
One-Way ANOVA
Experimental Designs
Completely Randomized
Two-Way ANOVA
One-Way ANOVA F-Test
• Tests the equality of two or more (k) population means
• Variables– One nominal scaled independent variable
Two or more (k) treatment levels or classifications
– One interval or ratio scaled dependent variable
• Used to analyze completely randomized experimental designs
Conditions Required for a Valid ANOVA F-test:
Completely Randomized Design
1. Randomness and independence of errors• Independent random samples are drawn
2. Normality• Populations are approximately normally
distributed
3. Homogeneity of variance• Populations have equal variances
One-Way ANOVA F-Test Hypotheses
• H0: 1 = 2 = 3 = ... = k
— All population means are equal
— No treatment effect
• Ha: Not All i Are Equal— At least 2 pop. means
are different— Treatment effect—1 2 ... k is
Wrong
X
f(X)
1 = 2 = 3
1 2 3X
f(X)
=
Why Variances?
• Same treatment variation
• Different random variation
Possible to conclude means are equal!
Pop 1 Pop 2 Pop 3
Pop 4 Pop 6Pop 5
Variances WITHIN differ
A Pop 1 Pop 2 Pop 3
Pop 4 Pop 6Pop 5
Variances AMONG differ
B
Different treatment variation
Same random variation
1. Compares two types of variation to test equality of means
2. Comparison basis is ratio of variances
3. If treatment variation is significantly greater than random variation then means are not equal
4. Variation measures are obtained by ‘partitioning’ total variation
One-Way ANOVA Basic Idea
One-Way ANOVA Partitions Total Variation
Total variationTotal variation
Variation due to treatment
Variation due to treatment
Variation due to random samplingVariation due to
random sampling
• Sum of Squares Among• Sum of Squares Between• Sum of Squares Treatment• Among Groups Variation
• Sum of Squares Within• Sum of Squares Error• Within Groups Variation
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-19
Partitioning the Variation• Total variation can be split into two parts:
SST = Total Sum of Squares (Total variation)
SSA = Sum of Squares Among Groups (Treatment or Among-group variation)
SSW = Sum of Squares Within Groups (Random or Within-group variation)
SST = SSA + SSW
Total Variation
X
Group 1 Group 2 Group 3
Response, X
22 2
11 21 ijSS Total X X X X X X
Among Group Variation
XX3
X2X1
Group 1 Group 2 Group 3
Response, X
22 2
1 1 2 2 j jSSA n X X n X X n X X
With Group (Random) Variation
X2X1
X3
Group 1 Group 2 Group 3
Response, X
22 2
11 1 21 2 ij jSSW X X X X X X
2 2 2 211 21 12 22
2 211 1 1 21 2 2
2 212 1 1 22 2 2
2 211 1 1 11 1 1
2 221 2 2 21 2
Consider the case i=2 and j=2
( ) ( ) ( ) ( )
( ) ( )
( ) ( )
( ) ( ) 2( )( )
( ) ( ) 2( )(
SST X X X X X X X X
X X X X X X X X
X X X X X X X X
X X X X X X X X
X X X X X X X
2
2 212 1 1 12 1 1
2 222 2 2 22 2 2
)
( ) ( ) 2( )( )
( ) ( ) 2( )( )
X
X X X X X X X X
X X X X X X X X
2 211 1 1 11 1 1
2 221 1 1 21 1 1
2 212 2 2 12 2 2
222 2
The first two items can be rewritten as
( ) ( ) 2( )( )
( ) ( ) 2( )( )
Likewise, the last two items can be rewritten as
( ) ( ) 2( )( )
( )
X X X X X X X X
X X X X X X X X
X X X X X X X X
X X
22 22 2 2( ) 2( )( )X X X X X X
1 11 12 1
2 21 22 2
2 2 2 211 1 21 1 12 2 22 2
2 2 2 21 1 2 2
2 2 211 1 21 1 12 2
Because 2( )( 2 ) equals to zero
and 2( )( 2 ) equals to zero
, we have
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) (
X X X X X
X X X X X
SST X X X X X X X X
X X X X X X X X
X X X X X X
222 2
2 21 2
)
2( ) 2( )
X X
X X X X
SSW SSA
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-26
Obtaining the Mean Squares
cn
SSWMSW
1c
SSAMSA
1n
SSTMST
The Mean Squares are obtained by dividing the various sum of squares by their associated degrees of freedom
Mean Square Among(d.f. = c-1)
Mean Square Within(d.f. = n-c)
Mean Square Total(d.f. = n-1)
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-27
One-Way ANOVA Table
Source of Variation
Sum OfSquares
Degrees ofFreedom
Mean Square(Variance)
Among Groups
c - 1 MSA =
Within Groups
SSWn - c MSW =
Total SSTn – 1
SSA
MSA
MSW
F
c = number of groupsn = sum of the sample sizes from all groupsdf = degrees of freedom
SSA
c - 1
SSW
n - c
FSTAT =
One-Way ANOVA F-Test Critical Value
If means are equal, F = MSA / MSW 1. Only reject large F!
Always One-Tail!
F(α; c – 1, n – c)
0
Reject H 0
Do NotReject H 0
F
© 1984-1994 T/Maker Co.
One-Way 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, 5 per machine, to the machines. At the .05 level of significance, is there a difference in mean filling times?
Mach1Mach1 Mach2Mach2 Mach3Mach325.4025.40 23.4023.40 20.0020.0026.3126.31 21.8021.80 22.2022.2024.1024.10 23.5023.50 19.7519.7523.7423.74 22.7522.75 20.6020.6025.1025.10 21.6021.60 20.4020.40
One-Way ANOVA F-Test Solution
• H0:• Ha:• = • 1 = 2 = • Critical Value(s):
F0 3.89
= .05
1 = 2 = 3
Not All Equal
.05
2 12
Summary TableSolution
From Computer
Treatment (Machines)
3 - 1 = 2 47.1640 23.5820 25.60
Error 15 - 3 = 12 11.0532 .9211
Total 15 - 1 = 14 58.2172
Source of Variation
Degreesof
Freedom
Sum of Squares
Mean Square
(Variance)F
One-Way ANOVA F-Test Solution
Test Statistic:
Decision:
Conclusion:
Reject at = .05
There is evidence population means are different
FMSA
MSW
23 5820
921125.6
.
.
表 14.1 A 、 B 、 C 廠牌汽車耗油試驗
表 14.5 變異數分析表
變異來源 平方和(SS) 自由度(df) 平均平方和(MS) F值
因子 17.652 2 8.83 55.19
隨機 1.868 12 0.16
總和 19.520 14
圖 14.6 汽車耗油的檢定
f (F )
拒絕域接受域
3.89 55.19 F
F 2,12
One-Way ANOVA F-Test Thinking Challenge
You’re a trainer for Microsoft Corp. Is there a difference in mean learning times of 12 people using 4 different training methods ( =.05)?
M1 M2 M3 M410 11 13 18
9 16 8 235 9 9 25
Use the following table.
© 1984-1994 T/Maker Co.
Summary Table Solution*
Treatment(Methods)
4 - 1 = 3 348 116 11.6
Error 12 - 4 = 8 80 10
Total 12 - 1 = 11 428
Source of Variation
Degreesof
Freedom
Sum of Squares
Mean Square
(Variance)F
One-Way ANOVA F-Test Solution*
• H0:• Ha:• = • 1 = 2 = • Critical Value(s):
0 4.07
= .05
1 = 2 = 3 = 4
Not All Equal
One-Way ANOVA F-Test Solution*
Test Statistic:
Decision:
Conclusion:
Reject at = .05
There is evidence population means are different
FMSA
MSW
116
1011 6.
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-40
ANOVA Assumptions• Randomness and Independence
– Select random samples from the c groups (or randomly assign the levels)
• Normality– The sample values for each group are from a normal
population
• Homogeneity of Variance– All populations sampled from have the same variance
– Can be tested with Levene’s Test
Randomized Block Design
• Reduces sampling variability (MSE)
• Matched sets of experimental units (blocks)
• One experimental unit from each block is randomly assigned to each treatment
Randomized Block Design Total Variation Partitioning
Variation Due to Random Sampling
SST
SSB
Total Variation
Variation Due to Blocks
Variation Due to Treatment
SSW
SSA
Conditions Required for a Valid ANOVA F-test:
Randomized Block Design
1. The blocks are randomly selected, and all treatments are applied (in random order) to each block
2. The distributions of observations corresponding to all block-treatment combinations are approximately normal
3. All block-treatment distributions have equal variances
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-44
Partitioning the Variation
• Total variation can now be split into three parts:
SST = Total variationSSA = Among-Group variationSSBL = Among-Block variationSSE = Random variation
SST = SSA + SSBL + SSE
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-45
Sum of Squares for Blocks
Where:
c = number of groups
r = number of blocks
Xi. = mean of all values in block i
X = grand mean (mean of all data values)
r
1i
2i. )XX(cSSBL
SST = SSA + SSBL + SSE
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-46
Partitioning the Variation• Total variation can now be split into three parts:
SST and SSA are computed as they were in One-Way ANOVA
SST = SSA + SSBL + SSE
SSE = SST – (SSA + SSBL)
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-47
Mean Squares
1c
SSAgroups among square MeanMSA
SSBMSBL Mean square blocking
r 1
SSEMSE Mean square error
( 1)( 1)r c
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-48
Randomized Block ANOVA Table
Source of Variation
dfSS MS
Among Groups
SSA MSA
Error n-r-c+1SSE MSE
Total n - 1SST
c - 1 MSA
MSE
F
c = number of populations n=rc = total number of observationsr = number of blocks df = degrees of freedom
Among Blocks SSB r - 1 MSB
MSB
MSE
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-49
• Main Factor test: df1 = c – 1
df2 = (r – 1)(c – 1)
MSA
MSE
c..3.2.10 μμμμ:H
equal are means population all Not:H1
FSTAT =
Reject H0 if FSTAT > Fα
Testing For Factor Effect
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-50
Test For Block Effect
• Blocking test: df1 = r – 1
df2 = (r – 1)(c – 1)
MSB
MSE
r.3.2.1.0 ...:H μμμμ
equal are means block all Not:H1
FSTAT =
Reject H0 if FSTAT > Fα
Randomized Block Design Example
A production manager wants to see if three assembly methods have different mean assembly times (in minutes). Five employees were selected at random and assigned to use each assembly method. At the .05 level of significance, is there a difference in mean assembly times?EmployeeEmployee Method 1Method 1 Method 2Method 2 Method 3Method 3
11 5.45.4 3.63.6 4.04.022 4.14.1 3.83.8 2.92.933 6.16.1 5.65.6 4.34.344 3.63.6 2.32.3 2.62.655 5.35.3 4.74.7 3.43.4
Random Block Design F-Test Solution*
• H0:• Ha:• =• 1 = 2 = • Critical Value(s):
F0 4.46
= .05
1 = ., 2 = ., 3
Not all equal.05
2 8
Summary Table Solution*
Treatment(Methods)
3 - 1 = 2 5.43 2.71 12.9
Error 15 - 3 - 5 + 1 = 8 = 2*4
1.68 .21
Total 15 - 1 = 14 17.8
Source of Variation
Degreesof
Freedom
Sum of Squares
Mean Square
(Variance)F
Block(Employee)
5 - 1 = 4 10.69 2.67 12.7
Random Block Design F-Test Solution*
Test Statistic:
Decision:
Conclusion:
Reject at = .05
There is evidence population means are different
FMST
MSE
2.71
.2112.9
Random Block Design F-Test Solution*
• H0:• Ha:• =• 1 = 2 = • Critical Value(s):
F0 4.46
= .05
1,. = 2 ,. = 3 ,.
Not all equal.05
4 8
Random Block Design F-Test Solution*
Test Statistic:
Decision:
Conclusion:
Reject at = .05
There is evidence block means are different
FMSBL
MSE
2.67
.2112.7
Factorial Experiments
Experimental Designs
Factorial
One-Way ANOVA
Experimental Designs
Completely Randomized
Two-Way ANOVA
Factorial Design
• Experimental units (subjects) are assigned randomly to treatments
– Subjects are assumed homogeneous
• Two or more factors or independent variables
– Each has two or more treatments (levels)
• Analyzed by two-way ANOVA
Two-Way ANOVA Data Table
Xijk
Level i Factor
A
Level j Factor
B
Observation k
Factor Factor BA 1 2 ... b
1 X111 X121 ... X1b1
X112 X122 ... X1b2
2 X211 X221 ... X2b1
X212 X222 ... X2b2
: : : : :
a Xa11 Xa21 ... Xab1
Xa12 Xa22 ... Xab2
Treatment
Factorial Design Example
Factor 2 (Training Method)FactorLevels
Level 1 Level 2 Level 3
Level 1 15 hr. 10 hr. 22 hr.Factor 1(Motivation)
(High)11 hr. 12 hr. 17 hr.
Level 2 27 hr. 15 hr. 31 hr.(Low)
29 hr. 17 hr. 49 hr.Treatment
Advantages of Factorial Designs
• Saves time and effort– e.g., Could use separate completely
randomized designs for each variable
• Controls confounding effects by putting other variables into model
• Can explore interaction between variables
Graphs of Interaction
Effects of motivation (high or low) and training method (A, B, C) on mean learning time
Interaction No Interaction
AverageResponse
A B C
High
Low
AverageResponse
A B C
High
Low
Two-Way ANOVA
Experimental Designs
Factorial
One-Way ANOVA
Experimental Designs
Completely Randomized
Two-Way ANOVA
Two-Way ANOVA
• Tests the equality of two or more population means when several independent variables are used
• Same results as separate one-way ANOVA on each variable
– No interaction can be tested
• Used to analyze factorial designs
Interaction
• Occurs when effects of one factor vary according to levels of other factor
• When significant, interpretation of main effects (A and B) is complicated
• Can be detected
– In data table, pattern of cell means in one row differs from another row
– In graph of cell means, lines cross
Graphs of Interaction
Effects of motivation (high or low) and training method (A, B, C) on mean learning time
Interaction No Interaction
AverageResponse
A B C
High
Low
AverageResponse
A B C
High
Low
Two-Way ANOVA Total Variation Partitioning
Variation Due to Random Sampling
Variation Due to Interaction
SS(AB)
SST
Total Variation
Variation Due to Treatment A
Variation Due to Treatment B
SSA SSB
SSE
Conditions Required for Valid F-Tests in Factorial
Experiments
1. Normality• Populations are approximately normally
distributed
2. Homogeneity of variance• Populations have equal variances
3. Independence of errors• Independent random samples are drawn
Source ofVariation
Degrees ofFreedom
Sum ofSquares
MeanSquare
F
A(Row)
r - 1 SS(A) MS(A) MS(A)MSE
B(Column)
c - 1 SS(B) MS(B) MS(B)MSE
AB(Interaction)
(r - 1)(c - 1) SS(AB) MS(AB) MS(AB)MSE
Error n - rc SSE MSE
Total n - 1 SS(Total)
Two-Way ANOVA Summary Table
Same as other designs
Two-Way ANOVA Hypotheses
• Test for Main Effect of Factor AH0: No difference among mean levels of factor A
Ha: At least two factor A mean levels differ
• Test StatisticF = MS(A) / MSE
• Degrees of Freedom1 = (r – 1) 2 = n – rc
Two-Way ANOVA Hypotheses
• Test for Main Effect of Factor BH0: No difference among mean levels of factor B
Ha: At least two factor B mean levels differ
• Test StatisticF = MS(B) / MSE
• Degrees of Freedom1 = (c – 1) 2 = n – rc
Two-Way ANOVA Hypotheses
• Test for Factor InteractionH0: The factors do not interact
Ha: The factors do interact
• Test StatisticF = MS(AB) / MSE
• Degrees of Freedom1 = (r – 1)(c – 1) 2 = n – rc
Two-Way ANOVA Hypotheses
• Test for Treatment MeansH0: The ab treatment means are equal
Ha: At least two of the treatment means differ
• Test StatisticF = MST / MSE
• Degrees of Freedom1 = rc – 1 2 = n – rc
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-76
Two-Way ANOVA Equations
2
1 1 1
( )r c n
ijki j k
SST X X
2r
1i
..i )XX(ncSSA
2c
1j
.j. )XX(nrSSB
Total Variation:
Factor A Variation:
Factor B Variation:
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-77
Two-Way ANOVA Equations
2r
1i
c
1j
.j.i..ij. )XXXX(nSSAB
r
1i
c
1j
n
1k
2.ijijk )XX(SSE
Interaction Variation:
Sum of Squares Error:
(continued)
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-78
Two-Way ANOVA Equations
where:
Mean Grandnrc
X
X
r
1i
c
1j
n
1kijk
r) ..., 2, 1, (i A factor of level i of Meannc
X
X th
c
1j
n
1kijk
..i
r = number of levels of factor A
c = number of levels of factor B
n’ = number of replications in each cell
(continued)
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc.. Chap 11-79
Two-Way ANOVA Equations
where:
c) ..., 2, 1, (j B factor of level j of Meannr
XX th
r
1i
n
1kijk
.j.
ij cell of Meann
XX
n
1k
ijk.ij
r = number of levels of factor A
c = number of levels of factor B
n’ = number of replications in each cell
(continued)
Factorial Design Example
Human Resources wants to determine if training time is different based on motivation level and training method. Conduct the appropriate ANOVA tests. Use α = .05 for each test.
Training MethodFactorLevels
Self–paced Classroom Computer
15 hr. 10 hr. 22 hr.
Motivation
High11 hr. 12 hr. 17 hr.
27 hr. 15 hr. 31 hr.Low
29 hr. 17 hr. 49 hr.
Source ofVariation
Degrees ofFreedom
Sum ofSquares
MeanSquare
F
A(Row)
1 546.75 546.75
B(Column)
2 531.5 265.75
AB(Interaction)
2 123.5 61.76
Error 6 188.5 31.42
Total 11 SS(Total)
Two-Way ANOVA Summary Table
Same as other designs
17.40
8.46
1.97
Main Factor A F-Test Solution
• H0:
• Ha:• =• 1 = 2 = • Critical Value(s):
F0 5.99
= .05
No difference between motivation levels
Motivation levels differ
.05
1 6
Main Factor A F-Test Solution
Test Statistic:
Decision:
Conclusion:
( )17.4
MS AF
MSE
Reject at = .05
There is evidence motivation levels differ
Source ofVariation
Degrees ofFreedom
Sum ofSquares
MeanSquare
F
A(Row)
1 546.75 546.75
B(Column)
2 531.5 265.75
AB(Interaction)
2 123.5 61.76
Error 6 188.5 31.42
Total 11 SS(Total)
Two-Way ANOVA Summary Table
Same as other designs
17.40
8.46
1.97
Main Factor B F-Test Solution
• H0:
• Ha:• =• 1 = 2 = • Critical Value(s):
F0 5.14
= .05
No difference between training methods
Training methods differ
.05
2 6
Main Factor B F-Test Solution
Test Statistic:
Decision:
Conclusion:
( )8.46
MS BF
MSE
Reject at = .05
There is evidence training methods differ
Source ofVariation
Degrees ofFreedom
Sum ofSquares
MeanSquare
F
A(Row)
1 546.75 546.75
B(Column)
2 531.5 265.75
AB(Interaction)
2 123.5 61.76
Error 6 188.5 31.42
Total 11 SS(Total)
Two-Way ANOVA Summary Table
Same as other designs
17.40
8.46
1.97
Interaction F-Test Solution
• H0:• Ha:• = • 1 = 2 = • Critical Value(s):
F0 5.14
= .05
The factors do not interact
The factors interact
.05
2 6
Interaction F-Test Solution
Test Statistic:
Decision:
Conclusion:
( )1.97
MS ABF
MSE
Do not reject at = .05
There is no evidence the factors interact
Treatment Means F-Test Solution
• H0:
• Ha:• = • 1 = 2 = • Critical Value(s):
F0 4.39
= .05
The 6 treatmentmeans are equal
At least 2 differ
.05 5 6
Source ofVariation
Degrees ofFreedom
Sum ofSquares
MeanSquare
F
Model 5 546.75 240.35
Error 6 188.5 31.42
CorrectedTotal
Two-Way ANOVA Summary Table
7.65
11 735.25
Treatment Means F-Test Solution
Test Statistic:
Decision:
Conclusion:
7.65MST
FMSE
Reject at = .05
There is evidence population means are different
Conclusion
1. Described Analysis of Variance (ANOVA)
2. Explained the Rationale of ANOVA
3. Compared Experimental Designs
4. Tested the Equality of 2 or More Means• Completely Randomized Design• Factorial Design