You are on page 1of 23

Two way ANOVA

(axb Factorial Design)

Lemma Derseh (BSc., MPH)


Two-way ANOVA (axb Factorial Design)
 Let ‘A’ and ‘B’ are the set of treatments (also called factors
or main effects) that have ‘a’ and ‘b’ different treatments,
respectively called treatment levels or groups

 Thus, the main interest in a Two-Way ANOVA is in the


combined effect of A and B, as well as ‘A’ considered
separately and ‘B’ considered separately.

 That means it will have the same results as the separate one-
way ANOVA on each variable, except that here the interaction
effect is also included in the model
Two-way ANOVA (axb Factorial Design)

 In Two-Way ANOVA, the experimental units (subjects) are


assigned at random to each of the axb combinations, and

 The subjects to be assigned are also assumed to be


homogeneous
Main effects, simple effects, interaction
 Main effect is a difference in population means for a factor
collapsed (or pooled) over the levels of all other factors in the
design

 Thus, a significant main effect demonstrates that an independent


variable influences the dependent variable.

 However, it does not establish which of the independent variable


levels are significantly different from another

 To identify those significantly different levels, we use a priori


(pre-planed) or post hoc tests
Main effects, simple effects, cont…
 An interaction occurs when the effect of one independent variable
is affected by another independent variable; or

 When the effect of one factor is not the same at the levels of
another

 Or it is when the effect on the dependent variable at different


levels of an independent variable is influenced by the
corresponding levels of another variable.

 E.g. Grade score for females will be greater than males’ when
tutor is present than absent
Main effects, simple effects, interaction
cont…
 A simple effect is the effect of one independent variable on the
dependent variable at one particular level of another
independent variable.
 We can test the differences between effects by two levels of
an independent variable at each level of another independent
variable separately

 If the difference is significant ,we can confirm the existence of


simple effects at that particular level of second variable.

 Usually we only look at simple effects if you have found a


significant interaction.
Two way ANOVA cont…
Calculate total Sum of Squares (for equal cell size = n)
T = ΣiΣjΣkxijk2 S = ΣiΣjTij.2/n CF = T2…/abn
A = ΣjT.j.2/na B = ΣiT2i../nb

Source df SS MS F
Factor A a-1 SSa =A - CF SSa/(a-1) MSa/MSe
Factor B b-1 SSb = B - CF SSb/(b-1) MSb/MSe
AxB (a-1)(b-1) SSab= S-A-B+CF SSab/(a-1)(b-1) MSab/MSe
Error ab(n-1) SSe = T - S SSe/ab(n-1)
Total abn-1 SSt = T - FC
Where “a” and “b”, are the number of groups in treatment A and
B respectively and ‘n’ is the repilication
The two-way Linear model
 The formal model underlying two-Way ANOVA, with 2 treatments A and B is:
Xijk = μ + Ai + Bj +ABij + Ɛijk

 Xijk is the kth replicate of treatment A level i and treatment B level j

 Ai is the effect of the ith level of treatment A (= difference between μ and mean of
all data in this treatment).

 Bj is the effect of the jth level of treatment B (= difference between μ and mean of
all data in treatment B).

 Ɛijk is the unexplained error in Observation Xijk


Two way ANOVA cont…
The null hypotheses in a two-way ANOVA are these:
– The population means for the dependent variable are equal
across levels of the first factor

– The population means for the dependent variable are equal


across levels of the second factor

– The effects of the first and second factors on the


dependent variable are independent of one another
Two way ANOVA cont….
Handling treatment
B1 B2
Example (Steel & Torrie p. 343) 8.53 17.53
20.53 21.07
12.53 20.80
Effect of 2 treatments on blood A1 14.0 17.33
phospholipids in lambs. The Time 10.8 20.07
first was a handling treatment, treatment
39.14 32.00
and the second one was the time 26.20 23.80
treatment. 31.33 28.87
A2 45.80 25.06
40.20 29.33
Two-Way ANOVA con…
Start by a preliminary eyeballing of the data:

They are continuous, plausibly normally distributed.


There are 2 handling treatments and 2 time treatments,
Both are combined in a factorial design so that each of the 4
combinations is replicated 5 times.

The basic findings are the following:


n = 20
T… = ΣΣΣxijk = 484.92
T = ΣΣΣxijk2 = 13676.7
T…2/N = (ΣΣΣxijk)2/N = (484.92)2 / 20 = 11757.37
SST = 13676.7 – 11757.37= 1919.33
Now get totals for treatments A and B

B1 B2 Ti.
A1 66.39 96.80 163.19
A2 182.67 139.06 321.73
T.j 249.06 235.86 484.92

Hence the sums of squares for A and B can be calculated:

SSa = 163.192/10 + 321.732 / 10 - 11757.37 = 1256.75

SSb = 249.062/10 + 235.862/10 - 11757.37 = 8.712


A alone
Source Df SS MS F
A 1 1256.75 1256.75 34.14**
error 18 662.58 36.81
total 19 1919.33

B alone
Source Df SS MS F
B 1 8.71 8.71 0.08
error 18 1910.62 106.15
total 19 1919.33
Pooled
Source Df SS MS F
A 1 1256.75 1256.75 32.67**
B 1 8.71 8.71 0.24
error 17 653.87 38.86
total 19 1919.33
Interaction terms
 We now meet a unique, powerful feature of factorial ANOVA.
It can examine data for interactions between treatments -
synergism or antagonism.
 Some treatments intensify each others’ effects:

 The classic examples come from pharmacology.


 Alcohol alone is lethal (toxic) at the 20-40 unit range.
Barbiturates are lethal. Together they are a vastly more
lethal combination, as the 2 drugs synergize.

 In ecology, SO2 + NO2 is more damaging than the additive


effects of each gas alone - a synergism.
Antagonism.

 It is the opposite - two treatments nullifying each


other.

 Drought antagonizes effects of air pollution on plants,


as drought leads to closed stomata excluding the
noxious/harmful gas.
B2
Response I
I Treatment B categories
I
I B1
I No interaction
I
I
1 2 3 Treatment A
Synergism
Response Antagonism I
I
I I
I
I I
I I
I I

1 2 3 Treatment A 1 2 3
Incorporating interaction into the
ANOVA model
 First, work out a sum of squares caused by ALL treatments at
ALL levels.

 Thus for a 2*2 design, there are actually 4 treatments and for
3*3 design there are 9 treatments, etc. Call this SStrt
 Now, we can partition this Sum of squares:
SStrt = SSa + SSb + SSi , Where, SSi is for Sum Square
interaction
 We know SSa, we know SSb, so we get SSi by subtraction after
calculating the SStrt using the computational formula

But SStrt = ΣΣxij.2/n - CF


For the lamb blood data:
 We have 4 separate treatments: A1B1, A1B2, A2B1, A2B2

 The data within these 4 groups add to: 66.39, 182.67,


96.80 and 139.06.

 There are 5 replicates in each treatment

 SStrt = 66.392/5 + 182.672/5 + 96.82/5 + 139.062/5 -


11757.37 = 1539.407
Two-Way ANOVA table with
interaction

Source df SS MS F
All treat 3 1539.07 …………………………..
A 1 1256.75 1256.75 52.93**
B 1 8.71 8.71 0.37
AxB 1 273.95 273.95 11.54**
Error 16 379.92 23.75
Total 19 1919.33 ………………………
Example Two Way ANOVA
(4x3 factorial ANOVA)
Twenty four men each weighting 35 kg overweight, are
assigned to the 12 treatments that arise from 4 diets and
3 levels of jogging with replication of 2. Each man
consumes the same amount of food per day, but the
diets differ in their proportion of proteins, fat, and
carbohydrate. The aim of the experiment is to reduce
weight .

(Data in the following slide)


4x3 Factorial Design

Diet

Equal High High Fat High Total


Protein Carbohyd.
0’ 8.5 15.5 8.5 15.5 97
11.5(20) 16.5(32) 7.5(16) 13.5 (29)
Data
Jogging
14 20 13 21 136
1’ 16(30) 23(43) 11(24) 18 (39)
(in minutes) 24.5 27 22 24.5 196
2’ 19.5(44) 24(51) 27(49) 27.5 (52)

Total 94 126 89 120 429


Example-Three way ANOVA
(2x2x3 factorial ANOVA)
Maxwell and Delaney (1990) studied the effect of three different
treatments:
1. Drug (a medication having three levels: X, Y and Z)
2. Biofeed (a psychological feedback : present and absent)
3. Diet (special diet as given or not given)
 Seventy-two subjects suffering from hypertension were recruited to
the study with being randomly allocated to each of the 12 treatment
combinations. Blood pressure measurements were made on each
subject after treatments.
(Data in the following slide)
Data…. which is a 3X2x2 Design
Treatments Special Diet
Biofeedback Drug No Yes

X 170,175,165,180,160,158 161,173,157,152,181,190
.
Present Y 186,194,201,215,219,209 164,166,159,182,187,174

Z 180,187,199,170,204,194 162,184,183,156,180,173

X 173,194,197,190,176,198 164,190,169,164,176,175

Y 189,194,217,206,199,195 171,173,196,169,199,180,203
Absent
Z 202,228,190,206,224,204 205,199,170,160,179,179

You might also like