You are on page 1of 31

Chapter 4

BKU2032

 One-Way ANOVA
 Two-Way ANOVA

1
4.1: Introduction
 The approach that allow us to use sample data to see if the values of
three or more unknown population means are likely to be different.

 Although the focus is on detecting differences between several


population or process means, the primary tool used in these test is
based on a comparison of variances, thus the procedure become known
as the analysis of variance (ANOVA).

 Examples:
i) Will three different levels of a chemical concentration have
different effect on an electroplating process? ( H 0 : the mean
plating thickness is the same for all three concentration levels )
 one-way ANOVA

ii) Will three different levels of a chemical concentration have


different effect on four electroplating processes? ( H 0 : different
levels of a chemical concentration have no effect on the
electroplating processes)  two-way ANOVA 2
4.2: The Procedural Steps for an ANOVA Test
Step 1: State the Null and Alternative Hypotheses

Step 2: Determine the Test Statistic to use. An ftest is used


in an ANOVA test.

Step 3: Define Rejection Region and Critical Point, f ,1 ,2 .

Step 4: Decision Rule


 Reject in H 0 if f test  f ,v1 ,v2

3
4.3
One-way ANOVA
 1 factor (variable) is
considered.

LEARNING OBJECTIVE:
Use the one-way ANOVA
technique to determine if there
is a significant difference among
three or more means.

4
4.3.1: Data
Factor Total

1 y11 y12 … y1n 1 Y1.


Treatment 2 y21 y22 … y2n 2 Y2.
… …
i yi1 yi2 … yini Yi.
… …
k yk1 yk2 … ykn k Yk.
Y..
where
yij : the jth observation from the ith treatment
Yi. : the total of all observations from the ith treatment
Y.. : the total of all observations 5
4.3.2: Model
Model: yij     i   ij , i  1, 2,...k j  1, 2,...ni

Assumption: ij ~ NID(0, 2 )


k
Restriction: 
i 1
i 0

where
yij : the jth observation from the ith treatment
 : the overall mean
i : the ith treatment effect
 ij : the random error
k : number of populations (treatments)
ni : sample size from population i 6
4.3.3: Assumptions of Data
To use the one-way ANOVA test, the following assumptions
must be true

 The population under study have normal distribution

 The samples are drawn randomly, and each sample is independent


of the other samples.

 All the populations from which the samples values are obtained,
have the same unknown population variances, that is for k number
of populations,

 12   22    k2

7
4.3.4: Partitioning of Variation
 The total variation can be partioned into 2 components:

Sum of Squares of Total = Sum of Squares of Treatments + Sum of Squares of Errors


SST = SSTrt + SSE
k ni k k n

 ij ..
( y  y
i 1 j 1
) 2
 n  i. ..  ij i.
( y  y )
i 1
2
 ( y  y ) 2

i 1 j 1

where
ni
k
Y 2 k
Yi.2 Y..2
SST   yij 2  .. SSTrt   
i 1 j 1 N i 1 ni N
SSE = SST - SSTrt
8
Total Variation (SST)

Variation Due to Variation Due to Random


= Treatment(SSTrt) + Sampling (SSE)

Commonly referred to as: Commonly referred to as:


 Sum of Squares Between  Sum of Squares Within
 Sum of Squares Among  Sum of Squares Error
 Sum of Squares Explained  Sum of Squares Unexplained
 Among Groups Variation  Within Groups Variation

9
4.3.5: Hypothesis of One-Way ANOVA
H 0 : 1  2  3   k
 All population means are equal
 i.e., no treatment effect (no variation in means among groups)

H1 : i   j for at least one i, j 


 At least one population mean is different
 Not all of the population means are the same
 i.e., there is a treatment effect
 Does not mean that all population means are different (some
pairs may be the same)
10
All Means are the same:
The Null Hypothesis is True
(No Treatment Effect)

μ1  μ2  μ3

At least one mean is different:


The Null Hypothesis is NOT true
(Treatment Effect is present)

o
r

μ1  μ2  μ3 μ1  μ2  μ3 11
4.3.6: ANOVA Table
Source Degrees Sum of Squares (SS) Mean of Squares (MS)
of
fCalculated
of
Freedom
Variation
(Df)

SS (Tr ) ftest
k
Yi.2 Y..2
Treatment k-1 SSTrt    MSTrt 
i 1 ni N k 1 
MSTrt
MSE

Error SSE
N-k SSE  SST  SSTrt MSE 
N k
ni
k
Y..2
SST   y  2
ij
Total N- 1 i 1 j 1 N

Reject Ho if ftest  f ,k 1, N  k


12
Example 4.1
The following data are yields that produced from a chemical reaction for
several setting of temperature (oC).

Temperature Sample Values


(oC)
750 19.72 20.88 19.63 18.68 17.89
800 16.01 20.04 18.10 20.28 20.53
850 16.66 17.38 14.49 18.21 15.58
900 16.93 14.49 16.15 15.53 13.25

a) Write down the model, assumption and restriction of the one-way


ANOVA for the data above.

b) Perform the analysis of variance and test the hypothesis at 0.05 level of
significance that the mean data provided by the chemical reaction is
the same for all four temperatures. Discuss the results.
13
Example 4.2
Four catalysts that may affect the concentration of one component in a
three-component liquid mixture are being investigated. The following
concentrations are obtained.

Catalysts
1 2 3 4
58.2 56.3 50.1 52.9
57.2 54.5 54.2 49.9
58.4 57.0 55.4 50.0
55.8 55.3 51.7
54.9

a) Write down the model, assumption and restriction for the data above.
b) Is there any difference of the effect of catalysts on the concentration of
one component in a three-component liquid mixture? Test at 1%
significance level. 14
4.3.7(i): One-Way ANOVA using EXCEL
The data shows the Math’s test score for 4 groups of student with 3
different methods of study. Test the hypothesis that there’s no
difference between the Math’s score for 4 groups of student at
significance level 0.05

Score
Individually &
Group study 80 70 85 89

Group study 60 55 58 62
Individually 65 60 62 58

15
4.3.7(ii): One-Way ANOVA using EXCEL
 Excel – key in data

16
4.3.7(iii): One-Way ANOVA using EXCEL
 Tools – Add Ins – Analysis Toolpak – Data Analysis – ANOVA
single factor – enter the data range – set a value for α - ok

 Reject H0 if P-value ≤ α or F > F crit P-value < 0.05 so Reject H0


17
4.4
Two-way ANOVA
 2 factors (variables)
is considered.

LEARNING OBJECTIVE:
Use the two-way ANOVA
technique to determine if
there is an effect of
interaction between two
factors experiment.
18
4.4.1: Data a x b design
Factor Total
B
1 2 … b
1 yijk … Y1…
A 2 … Y2…
… …
a … Ya..
Total Y.1. Y.2. … Y.b. Y…
a :Number of levels of factor A b: Number of levels of factor B
where
yijk : the kth observation from the (ij)th cell
Yi .. : the total of all observations from the ith level of factor A
Y. j . : the total of all observations from the jth level of factor B
Y... : the total of all observations
19
4.4.2: Model of Two-Way ANOVA
Model: yijk     i   j   ij   ijk

Assumption:  ijk ~ NID(0,  2 )


b

  
a b a
Restriction: 
i 1
i 0  j 0   
i 1
ij
0
j 1
ij
0
j 1

where
yijk : the kth observation from the (ij)th cell
 : the overall mean
i : the effect of the ith level of factor A
j : the effect of the jth level of factor B
 ij : the interaction effect of the ith level of factor A and the jth level of factor B
 ijk : the random error 20
4.4.3: Assumptions of Data
To use the two-way ANOVA test, the following assumptions
must be true:
 The design must be complete
 Observations are taken on every possible treatment

 The design must be balanced


 The number of replicates is the same for each treatment

 The population under study have normal distribution

 The samples are drawn randomly, and each sample is independent


of the other samples.

 All the populations from which the samples values are obtained,
have the same unknown population variances.
21
4.4.4: Partitioning of Variation
Degrees of
SST = SSA + SSB + SS(AB) + SSE Freedom:

SSA a–1
Variation due to factor A

SST SSB b–1


Variation due to factor B
Total Variation
SS(AB)
Variation due to interaction (a – 1)(b – 1)
between A and B
N-1
SSE abr – ab
Inherent variation (Error)

22
4.4.5: Hypothesis of Two-Way ANOVA
Row Effect
H 0 A : There is no difference in means of factor A
H1A : There is a difference in means of factor A

Column Effect

H 0B : There is no difference in means of factor B


H1B : There is a difference in means of factor B

Interaction Effect
H 0 AB : There is no interaction effect between factor A and factor B
H1AB : There is an interaction effect between factor A and factor B
23
4.4.6: Two-Way ANOVA Table
Source (DoF) Sum of Squares (SS) Mean of Squares (MS) ftest Reject H 0 if

1 a 2 Y...2 SSA MSA ftest 


A a-1 SSA   Yi..  MSA  f test 
(row effect) br i 1 abr a 1 MSE f ,a 1,ab r 1
B 1 b 2 Y...2 SSB MSB ftest 
(Column b- 1 SSB   Y. j .  MSB  f test 
effect) ar j 1 abr b 1 MSE f ,b1,ab r 1

MS  AB  ftest 
1 a b 2 Y...2
AB SS  AB    Yij .  SS  AB 
(interaction (a-1)(b-1) r i 1 j 1 abr MS  AB   ftest 
effect)  SSA  SSB  a  1 b  1 MSE f ,( a 1)(b1),ab r 1

SSE  SST  SSA SSE


Error ab(r-1)
MSE 
 AB  ab  r  1
SSE
SSB
 Error MSE  SS
2

N k

a b r
Y...2
Total abr-1 SST   y  2
ijk
i 1 j 1 k 1 abr

24
Procedure for Two-Way ANOVA
START

Test for an interaction


Ho: No interaction between the two
factors
MSAB
between two factors Ftest 
MSE

Stop. Don’t consider the


Is there an effect due
effects of either factor
to interaction between the
two factors?
Yes without considering the
effects of the other
(Reject Ho)

No (Accept Ho)

Ho: No effects from the row Test for effect from MSA
factor A (the row means are row factor Ftest 
equal) MSE

Ho: No effects from the MSB


column factor B (the column Test for effect from Ftest 
column factor MSE
means are equal) 25
Example 4.3
Four air-conditioning compressor designs were tested in four different region in
Malaysia. The test was repeated by installing additional air conditioners in a second
cooling season. The following are times to failure (to the nearest month) of each
compressor tested.
Replicate 1 Replicate 2

Design A B C D A B C D

1 58 35 72 61 49 24 60 64
Region
2 40 18 54 38 38 22 64 50

3 63 44 81 52 59 16 60 48

4 36 9 47 30 29 13 52 41

Test at the 0.01 level of significance whether the differences among the designs and
for regions are significant and for the significance of the interaction between
compressor designs and regions. 26
Solution:
A B C D Total

1 107 59 132 125


Y1..  423
2 78 40 118 88
Y2..  324

3 122 60 141 100


Y3..  423
4 65 22 99 71 Y4..  257
Total
Y.1.  372 Y.2.  181 Y.3.  490 Y.4.  384 Y...  1427

27
Example 4.4
A chemical engineer is studying the effects of various reagents and catalyst on
the yield of a certain process. Yield is expressed as a percentage of a theoretical
maximum. 4 runs of the process were made for each combination of 3 reagents
and 4 catalysts. Construct an ANOVA table and test is there an interaction
effect between reagents and catalyst. Use α = 0.05

Reagent
Catalyst
1 2 3
A 86.8 82.4 93.4 85.2 77.9 89.6
86.7 83.5 94.8 83.1 89.9 83.7
B 71.9 72.1 74.5 87.1 87.5 82.7
80.0 77.4 71.9 84.1 78.3 90.1
C 65.5 72.4 66.7 77.1 72.7 77.8
76.6 66.7 76.7 86.1 83.5 78.8
D 63.9 70.4 73.7 81.6 79.8 75.7
77.2 81.2 84.2 84.9 80.5 72.9
28
4.4.7(i): Solve Two-Way ANOVA using EXCEL
 Excel – key in data

29
4.4.7(ii):Solve Two-Way ANOVA using EXCEL
 tools – Data Analysis – ANOVA two factor with
replication – enter the data range – set a value for α - ok

 Reject H0 if P-value ≤ α or F > F crit

Thank You – Chapter 5: Goodness-of-Fit test


30
Assignment (10%)
1. Set up a group that consists of 5 members.
2. Find a set of data for
a) one-way ANOVA
b) two-way ANOVA

3. For each type of data set, the writing must have the following
characteristics:
i) description/explaination of data
ii)the data must satisfy the assumptions for ANOVA.
- show that the data follows normal distribution
iii)analysis the data manually and using excel
iv)interpret the result of the analysis

4. Due date: 29 Oct 2010 before 5.00pm

31

You might also like