You are on page 1of 43

1

The Two-way ANOVA


 We have learned how to test for the effects of
independent variables considered one at a time.
 However, much of human behavior is determined
by the influence of several variables operating at
the same time.
 Sometimes these variables combine to influence
performance.

Two Way ANOVA


2
The Two-way ANOVA
 We need to test for the independent and combined effects of
multiple variables on performance. We do this with an
ANOVA that asks:

(i) how different from each other are the means for levels of
Variable A?
(ii) how different from each other are the means for levels of
Variable B?
(iii) how different from each other are the means for the
treatment combinations produced by A and B together?

Two Way ANOVA


3
The Two-way ANOVA
 The first two of those questions are questions about
main effects of the respective independent
variables.

 The third question is about the interaction effect,


the effect of the two variables considered
simultaneously.

Two Way ANOVA


4
The Two-way ANOVA
 Main effect
 A main effect is the effect on performance of one
treatment variable considered in isolation (ignoring
other variables in the study)

 Interaction
 an interaction effect occurs when the effect of one
variable is different across levels of one or more other
variables

Two Way ANOVA


5
Interaction of variables
 In order to detect interaction effects, we must use
“factorial” designs.
 In a factorial design each variable is tested at every
level of all of the other variables.

A1 A2
B1 I II
B2 III IV

Two Way ANOVA


6
Interaction of variables
I II
III IV
I vs III
 Effect of B at level A1 of variable A
II vs IV
 Effect of B at A2
 If these are different, then we say that A and B
interact

Two Way ANOVA


7
Interaction of variables
I II
III IV
I vs II
 Effect of A at B1
III vs IV
 Effect of A at B2
 If these are different, then we say that A and B
interact

Two Way ANOVA


B1 B1

B2 B2

A1 A2 A1 A2

• In the graphs above, the effect of A varies at levels of


B, and the effect of B varies at levels of A. How you say
it is a matter of preference (and your theory).
• In each case, the interaction is the whole pattern. No
part of the graph shows the interaction. It can only be
seen in the entire pattern (here, all 4 data points).

Two Way ANOVA


9
Interaction of variables
 In order to test the hypothesis about an interaction,
you must use a factorial design.

 The designs shown on the previous slide (2 X 2s) are


the simplest possible factorial designs.

 We frequently use 3 and 4 variable designs, but


beware: it’s very difficult to interpret an interaction
among more than 4 variables!

Two Way ANOVA


10
Two-way ANOVA - Computation
Two variables, A &
B
Raw Scores (Xi)
A1 A2 A3
B1 B2 B1 B2 B1 B2

1 4 1 2 8 19
2 5 3 4 10 26
3 6 5 6 12 30
2 X 3 = 6 treatments

Two Way ANOVA


Cell Totals (Tij) and marginal totals (Ti & Tj)

Cell totals are in green

A1 A2 A3 Tj
B1 6 9 30 45
B2 15 12 75 102
B Totals
are in red

Ti 21 21 105 147
Totals for the levels of A are in blue

Two Way ANOVA


Two-Way ANOVA – Computational 12
formulas
CM = (ΣXi)2/N = (147)2 = 1200.5
18

ΣX2 = 12 + 22 + … + 302 = 2427

SSTotal = ΣX2 – CM
Notice that these are the
original data from Slide 10
SSE = ΣX2 – Σ(Tij)2
nij
Two Way ANOVA
Two-Way ANOVA – Computational 13
formulas
Σ(Ti)2/ni = (21)2 + (21)2 + (105)2 = 1984.5
6 6 6

SSA = Σ(Ti)2 – CM
ni

SSA is the sum of squared deviations


for Variable A

Two Way ANOVA


Two-Way ANOVA – Computational 14
formulas
Σ(Tj)2/ni = 452 + 1022 = 1381
9 9

SSB = Σ(Tj)2 – CM
nj

SSB is the sum of squared deviations for


Variable B. It is NOT the sum of squares for
Blocks – this is not a block design!

Two Way ANOVA


Two-Way ANOVA – Computational 15
formulas
Σ(Tij)2/nij = 62 + 152 + … + 302 + 752 = 2337
3 3 3 3

SSAB = Σ(Tij)2 – Σ(Tj)2 – Σ(Ti)2 + (ΣX)2


nij nj ni n

SSAB is the sum of squared deviations for the


interaction of A and B

Two Way ANOVA


CM
We now compute:
SSA = 1984.5 – 1200.5 = 784
SSB = 1381 – 1200.5 = 180.5
SSTotal = 2427 – 1200.5 = 1226.5
SSE = 2427 – 2337 = 90
SSAB = 2337 – 1381 – 1984.5 + 1200.5
= 172

Two Way ANOVA


Source df SS MS F
A a-1 = 2 784 392 52.27
B b-1 = 1 180.5 180.5 24.07
AB (a-1)(b-1) = 2 172 86 11.47
Error n-ab = 12 90 7.5
Total n-1 = 17 1226.5

Two Way ANOVA


Two-way ANOVA – hypothesis test 18

for A
H0: No difference among means for levels of A
HA: At least two A means differ significantly

Test statistic: F = MSA


MSE

Rej. region: Fobt < F(2, 12, .05) = 3.89

Decision: Reject H0 – variable A has an effect.


Two Way ANOVA
Two-way ANOVA – hypothesis test 19

for B
H0: No difference among means for levels of B
HA: At least two B means differ significantly

Test statistic: F = MSB


MSE

Rej. region: Fobt < F(1, 12, .05) = 4.75

Decision: Reject H0 – variable B has an effect.


Two Way ANOVA
Two-way ANOVA – hypothesis for 20

AB
H0: A & B do not interact to affect mean response
HA: A & B do interact to affect mean response

Test statistic: F = MSAB


MSE

Rej. region: Fobt < F(2, 12, .05) = 3.89

Decision: Reject H0 – A & B do interact...


Two Way ANOVA
21
Two way ANOVA Example 1
1. An experiment investigates the effects of two
treatments, illumination level and type size of reading
speed. Two levels of illumination, 15 foot-candles
and 30 foot-candles, are used. Three levels of type
size are used: 6-point, 12-point, and 18-point type.
Test the independent and joint effects of these
treatments on reading speed (  .05).

Two Way ANOVA


22
Two-way ANOVA Example 1
Reading speed (ave. words per minute)
6 point 12 point 18 point
15 fc 30 fc 15 fc 30 fc 15 fc 30 fc
378 415 454 439 432 426
408 396 394 467 411 428
357 451 452 477 466 464
353 455 396 410 411 412
414 398 419 417 460 475

Two Way ANOVA


23
Example 1 – hypothesis test for A (illumination)

 H0: No difference among means for levels of A


 HA: At least two A means differ significantly

 Test statistic: F = MSA


 MSE

 Rej. region: Fobt < F(1, 24, .05) = 4.26

Two Way ANOVA


24
Example 1 – hypothesis test for B (type size)

 H0: No difference among means for levels of B


 HA: At least two B means differ significantly

 Test statistic: F = MSB


 MSE

 Rej. region: Fobt < F(2, 24, .05) = 3.40

Two Way ANOVA


25
Example 1 – hypothesis test for AB interaction

 H0: A & B do not interact to affect means


 HA: A & B do interact to affect means

 Test statistic: F = MSAB


 MSE

 Rej. region: Fobt < F(2, 24, .05) = 3.40

Two Way ANOVA


26
Two-way Anova – Example 1
Compute:

CM = (12735)2 = 5406007.5
30

SSA = 62052 + 65302 – CM = 3520.833


15

Two Way ANOVA


27
Two-way Anova – Example 1
SSB = 40252 + 43252 + 43852 – CM
10
= 7440.0

Σ(Tij)2 = 19102 + 21152 + … + 21802 + 22052


nij 5 5 5 5

= 5380634.2
Two Way ANOVA
28
Two-way Anova – Example 1
SSAB = 5380634.2 – 5409528.33 – 5413447.5 + 5406007.5
= 1646.667

SSTotal = ΣX2 – CM = 5437581.0 – 5406007.5


= 31573.5

SSE = SSTotal – SSA – SSB – SSAB = 18966.0

Two Way ANOVA


29
Two-way Anova – Example 1
Source df SS MS F

A 1 3520.83 3520.83 4.46*


B 2 7440.00 3720.00 4.71*
AB 2 1646.67 823.33 1.04
Error 24 18966.0 790.25
Total 29 31573.5

* Reject H0.
Two Way ANOVA
30
Two-way Anova – Example 2
 A researcher is interested in comparing the
effectiveness of 3 different methods of teaching
reading, and also in whether the effectiveness
might vary as a function of the reading ability of
the students. Fifteen students with high reading
ability and fifteen students with low reading ability
were divided into three equal-sized group and each
group was taught by one of these methods. Listed
on the next slide are the reading performance
scores for the various groups at school year-end.

Two Way ANOVA


31
Two-way Anova – Example 2
Teaching Method
Ability A B C

High X 37.6 32.4 33.2


s2 2.8 9.3 11.7

Low X 20.0 18.4 17.6


s2 10.0 4.3 4.3

Two Way ANOVA


32
Two-way Anova – Example 2
 (a) Do the appropriate analysis to answer the
questions posed by the researcher (all αs = .05)

 (b) The London School Board is currently using


Method B and, prior to this experiment, had been
thinking of changing to Method A because they
believed that A would be better. At α = .01,
determine whether this belief is supported by these
data.

Two Way ANOVA


33
Example 2 – hypothesis test for A
 H0: No difference among means for levels of A
 HA: At least two A means differ significantly

 Test statistic: F = MSA


 MSE

 Rejection region: Fobt < F(2, 24, .05) = 3.40

Two Way ANOVA


34
Example 2 – hypothesis test for B
 H0: No difference among means for levels of B
 HA: At least two B means differ significantly

 Test statistic: F = MSB


 MSE

 Rejection region: Fobt < F(1, 24, .05) = 4.26

Two Way ANOVA


Example 2 – hypothesis test for 35

interaction
 H0: A and B do not interact to affect treatment
means
 HA: A and B do interact to affect treatment means

 Test statistic: F = MSAB


MSE

 Rejection region: Fobt < F(2, 24, .05) = 3.40


Two Way ANOVA
36
Two-way ANOVA – Example 2
SSE = 4 (2.8 + 9.3 + 11.7 + 10.0 + 4.3 + 4.3)
= 4 (42.4)
= 169.6

CM = (Σ X)2 = (796)2
n 30

= 21120.533

Two Way ANOVA


37
Two-way ANOVA – Example 2
SSMethod = 2382 + 2542 + 2542 - CM
10

= 211976 – 21120.533
10
= 21197.6 – 21120.533
= 77.066

Two Way ANOVA


38
Two-way ANOVA – Example 2
SSAbility = 5162 + 2802 - CM
15

= 344656 – 21120.533
15
= 22977.066 – 21120.533
= 1856.533

Two Way ANOVA


39
Two-way ANOVA – Example 2
For the interaction sum of squares, we begin with the
value

ΣT2ij = 1382 + 1622 + 1662 + …882


nij 5
= 115352
5
= 23070.4

Two Way ANOVA


40
Two-way ANOVA – Example 2
Now, we can compute SSMA:

23070.4 – 21197.6 – 22977.066 + 21120.533

= 16.267

Two Way ANOVA


41
Two-way ANOVA – Example 2
Source df SS MS F
Method 2 77.066 38.533 5.45*
Ability 1 1856.533 1856.533 262.72*
MxA 2 16.267 8.134 1.15
Error 24 169.6 7.067
Total 29

Reject HO for Method and for Ability, not for


interaction.
Two Way ANOVA
42
Two-way ANOVA – Example 2b
HO: μA – μB = 0
HA: μA – μB > 0

Test statistic: t = (XA – XB) – 0

√ ( MSEn 1 +
1 n 1 2
)

tcrit = t(24, .01) = 2.492


Two Way ANOVA
43
Two-way ANOVA – Example 2b
tobt = 28.8 – 25.4

√ (
7.067 1 + 1
10 10
)
= 3.4
1.189

= 2.86 - Reject HO. A is better than B.


Two Way ANOVA

You might also like