Comp 201
Comp 201
In this section, we will be considering the analysis of a two-factor factorial design (say,
factor A and factor B) in a completely randomized design (i.e. the design of the
experiment must satisfy the assumptions of a CRD).
There are levels in factor A and levels in factor B.
There are treatments in total and replicates for each treatment.
Factor B
… Total
…
Factor A
…
Total …
E.g. is the response to the level of factor A and the level of factor B.
Some more notation…
𝑏 𝑟
𝑌 =
o 𝑖.. ∑ ∑ 𝑌 𝑖𝑗𝑘is the total of the responses for the level of factor A.
𝑗=1 𝑘=1
𝑎 𝑟
o𝑌 𝑖𝑗. = ∑ 𝑌 𝑖𝑗𝑘is the total of the observations for the treatment corresponding to level of factor A
𝑘 =1 and level of factor B.
𝑎 𝑏 𝑟
Pressure
200 215 230 Total
Pressure
200 215 230 Total
For each level of temperature, the average response is plotted corresponding to each level of pressure.
Average Response
91.00
Pressure
90.80
200 215 230
90.00
200 215 230
Pressure
Continue to plot these points for each temperature level…
Average Response
91.00
Temp = 40
Pressure
90.80
200 215 230
Temp = 30
90.00
200 215 230
Pressure
Average Response
91.00
Temp = 40
90.80
90.60
90.40
Temp = 20
90.20
Temp = 30
90.00
200 215 230
Pressure
From this plot, we can see that there is a pressure by temperature interaction effect.
If no interaction was present, the lines for each temperature level would never intersect.
For example:
Average Response
91.00
Temp = 40
90.80
90.60
90.40
Temp = 20
90.20
Temp = 30
90.00
200 215 230
Pressure
The Statistical Model
The statistical model for a factorial design in a CRD (a fixed effects model) has the following form:
is the effect of the level of factor A (also known as the main effect of factor A);
is the effect of the level of factor B (also known as the main effect of factor B);
is the mean of the combination of the level of factor A and the level of factor B, i.e., the treatment mean;
The are the random error terms which are assumed to be independently and normally distributed with a mean of
0 and constant variance .
Since this is a fixed effects model, the usual assumptions apply:
The parameters , and are fixed constants;
𝑎 𝑏 𝑎 𝑏
∑ 𝜏 𝑖 =∑ 𝛽 𝑗 =∑ (𝜏𝛽 )𝑖𝑗 =∑ (𝜏𝛽 )𝑖𝑗 =0
𝑖=1 𝑗 =1 𝑖=1 𝑗 =1
Treatment Effects:
For a factorial design, multiple hypothesis tests are carried out starting with a test concerning the treatment effects
(factor level combinations):
The treatments (factor level combinations) have a significant effect on the response
or
Interaction Effects:
Before carrying out a hypothesis test concerning the main effects of each factor, we first need to determine if there is
an interaction effect between the factors:
Only if the null hypothesis concerning the interaction effects is NOT rejected we can carry out hypothesis tests
concerning the main effects of each of the factors.
Main Effects:
If no interaction effects between the two factors are present, then we can carry out hypothesis tests concerning the
effects of factor A as well as factor B:
ANOVA
The procedure of carrying out the hypothesis test concerning the treatment effects for the analysis of variance is the
same as the previous chapters.
𝑎 𝑏 𝑟
1 2
SSTO¿ ∑ ∑ ∑ 𝑌 − 𝑎𝑏𝑟 𝑌 . ..
2
𝑖𝑗𝑘
df
𝑖=1 𝑗=1 𝑘=1
As usual, SSTO can be decomposed into
𝑎 𝑏
1 2 1 2
¿
SST ∑ ∑ 𝑟 𝑌 𝑖 𝑗. − 𝑎𝑏𝑟 𝑌 . . . df
𝑖=1 𝑗=1
𝑎
1 2 1
¿∑
2
SSA 𝑌 𝑖 .. − 𝑌 .. . df
𝑖=1 𝑏𝑟 𝑎𝑏𝑟
𝑏
1 2 1 2
¿
SSB ∑ 𝑎𝑟 𝑌 . 𝑗 . − 𝑎𝑏𝑟 𝑌 . .. df
𝑗=1
F=
Factor A SSA 𝑎− 1 MSA
F=
Factor B SSB 𝑏 −1 MSB
F=
Interaction AB SSAB (𝑎 −1)(𝑏 −1) MSAB
Using the data from this example, let us obtain the ANOVA table in the form of that on the previous slide.
Recall for this example:
Pressure
200 215 230 Total
𝑎 𝑏
1 1 2
( 181.3 )2 ( 180.5 )2 ( 1627.4 )2
¿ ∑ ∑ 𝑌 𝑖 𝑗. −
SST
2 2 ( 180.6 )
𝑌 .¿. . 2 + 2 + …+ 2 − 18
𝑖=1 𝑗=1 𝑟 𝑎𝑏𝑟
¿ 1.138
SSE SSTO – SST ¿ 1.298 −1.138¿ 0.160
Now we need to calculate the decomposed parts of SST:
Pressure
200 215 230 Total
𝑎
1 2 1 2( 542.5 )
2
( 541.5 )2 ( 543.4 )2 ( 1627.4 )2
¿∑
SSA = SSTemp 𝑌 𝑖 .. − 𝑌¿ .. . + + −
𝑖=1 𝑏 𝑟 𝑎𝑏𝑟 6 6 6 18
¿ 0.301
Next we calculate SSB (SS for Pressure):
Pressure
200 215 230
𝑏
1 1 (2542.2 )2 ( 544.1 )2 ( 541.1 )2 ( 1627.4 )2
¿∑
SSB =SSPressure
2
𝑌. 𝑗 .− ¿𝑌 . .. + + −
𝑗=1 𝑎𝑟 𝑎𝑏𝑟 6 6 6 18
¿ 0.768
Lastly, we can find the sum of squares for the interaction between temperature and pressure:
df(SSTO) ¿ 18 −1=17
df(SST) ¿ 9 − 1=8
These 2 sum to df(SSTO)
df(SSE) ¿9
df(SSTemp) ¿ 3 − 1=2
df(SSPress) ¿ 3 − 1=2 These 3 sum to df(SST)
df(SSTemp*Press) ¿4
The ANOVA table for this factorial design example of a CRD:
1.138
Treatment 1.138 8 =0.142 F
8
0.301 F
Temperature 0.301 2 2
=0.151
0.768 F
Pressure 0.768 2 2
=0.384
0.069
Temp*Press 0.069 4 4
=0.017 F
0.160
Error 0.160 9 9
=0 .018
Total 1.298 17
Now, we start the ANOVA test by performing a hypothesis test concerning the treatments using a level of
significance of 5%:
Treatment Effects:
The treatments (factor level combinations) have a significant effect on the response
or
The critical value for this test: (from the statistical F-tables).
Therefore, (from the ANOVA table) since is rejected a 5% l.o.s., therefore we can conclude that the treatments have a
significant effect on the response (or that at least two treatment means differ).
Since on the previous slide was rejected, we can then perform a hypothesis test for the presence of an interaction effect
Interaction Effects:
The critical value for this test: (from the statistical F-tables).
Therefore, (from the ANOVA table) since is NOT rejected a 5% l.o.s., therefore we can conclude that there are no interaction
effects present between temperature and pressure.
Since there are NO interaction effects present between temperature and pressure, we are now able to perform hypothesis
tests concerning the effects of temperature and pressure separately.
Main Effects:
The critical value for this test: (from the statistical F-tables).
Therefore, (from the ANOVA table) since is rejected a 5% l.o.s., therefore we can conclude that factor ‘temperature’ has a
significant effect on the response.
Therefore, (from the ANOVA table) since is rejected a 5% l.o.s., therefore we can conclude that factor ‘pressure’ has a
significant effect on the response.
Pairwise Comparisons
Recall from previous chapters: If the null hypothesis concerning the treatment effects is rejected, and thus we can
conclude at least two treatment means differ, we may wish to determine which treatment means differ by carrying out a
pairwise comparison of the means.
However, since the treatment effects for a factorial design are made up of the effects of TWO factors (in this course) and
potential interaction effects, the process of a pairwise comparison differs to what we have done in previous
chapters.
Let us calculate the mean for each treatment:
Pressure
200 215 230
Suppose there was an interaction effect present between temperature and pressure on the response variable. Let us carry out
a pairwise comparison on the factor level means for each factor.
Pairwise Comparison in the PRESENCE of an Interaction Effect:
Assuming there is an interaction effect, we can only compare the means between the rows within the SAME column
when doing a pairwise comparison for Temperature.
Pressure
200 215 230
𝐿𝑆𝐷=𝑡
𝑎𝑏 ( 𝑟 −1 ) ;1 −
𝛼
2 √ 2 𝑀𝑆𝐸
𝑟 √
¿ 𝑡 9 ;0.975
2(0.018 )
2
¿ 2.262
√
2(0.018 )
2
¿ 0.303
Now, comparing the temperature factor level means when pressure = 200:
Pressure
200 |90.3 −90.2|=0.1 ¿ 𝐿𝑆𝐷
30 180.4 ÷ 2 = 90.20
Temperature |90.2− 90.6|=0.4 ¿ 𝐿𝑆𝐷
40 181.2 ÷ 2 = 90.60
Therefore, and are significantly different.
Similarly, comparing the temperature factor level means when pressure = 215:
Pressure
215
|90.65 −90.55|=0.1 ¿ 𝐿𝑆𝐷
Pressure
200 215 230
|90.60 −90.85|=0.25 ¿ 𝐿𝑆𝐷 |𝟗𝟎 . 𝟔𝟎 −𝟗𝟎 .𝟐𝟓|=𝟎 .𝟑𝟓 ¿ 𝐿𝑆𝐷 |𝟗𝟎 . 𝟖𝟓 −𝟗𝟎 .𝟐𝟓|=𝟎 .𝟔𝟎¿ 𝐿𝑆𝐷
N.B: To demonstrate the pairwise comparison procedure when an interaction effect is significant, we assumed there was
an interaction effect in this example.
However, in this temperature/pressure example, we found the interaction effect to be insignificant, and thus were able to
perform hypothesis tests concerning the main effects of each factor.
Pairwise Comparison in the ABSENCE of an Interaction Effect:
Since no interaction effect is present, we can compare the overall factor level means for temperature, ignoring the factor
levels of pressure.
Thus, we need to determine the mean of ALL the responses in each level of temperature:
Pressure
200 215 230 Total Mean
¿ 𝑡 9 ;0.975
√ 2(0.018 )
2(3)
¿ 2.262
2(0.018 )
2(3) √
¿ 0.1752
20 90.42
|90.42− 90.57|=0.15 ¿ 𝐿𝑆𝐷
Temperature 30 90.25
|90.25 −90.57|=0.32 ¿ 𝐿𝑆𝐷
40 90.57
Therefore, and are significantly different.
Similarly, for pressure: Pressure
200 215 230
𝐿𝑆𝐷=𝑡
𝑎𝑏 ( 𝑟 −1 ) ;1 −
𝛼
2 √ 2 𝑀𝑆𝐸
𝑎𝑟 ¿ 𝑡 9 ;0.975
√ 2(0.018 )
2(3) √
¿ 2.262
2(0.018 )
2(3)
¿ 0.1752
Pressure
200 215 230
Therefore, and are significantly different, as well as and . That is, all the means differ from each other
significantly.