Title: The Two-way Anova
1The 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
influence each other. - We need to test for the independent and combined
effects of multiple variables.
2The Two-way Anova
- Definitions
- Main effect
- effect of one treatment variable considered in
isolation (ignoring other variables in the study) - Interaction
- when the effect of one variable is different
across levels of one or more other variables
3Interaction 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
4Interaction of variables
- I vs III Effect of B at level A1 of variable A
- II vs IV Effect of B at A2
- I vs II Effect of A at B1
- III vs IV Effect of A at B2
- Two variables A B interact if the effect of A
varies at levels of B (equivalently, if the
effect of B varies at levels of A).
5B1 B2
B1 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 showing all 4 data points.
6Interaction 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 its almost impossible to interpret an
interaction among more than 4 variables!
7Two-way Anova - Computation
- 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
8Cell Totals (Tij) and marginal totals (Ti
Tj) A1 A2 A3 Tj B1 6 9 30
45 B2 15 12 75 102 Ti 21 21 105 147
9SXi2 12 22 302 2427 (SXi)2/N
(147)2/18 1200.5 S(Ti)2/ni (21)2 (21)2
(105)2 1984.5 6 6 6 S(Tj)2/ni
452 1022 1381 9 9 S(Tij)2/nij
62 152 302 752 2337 3
3 3 3
10SSA S(Ti)2 CM ni SSB S(Tj)2 CM
nj SSTotal SX2 CM SSE SX2 S(Tij)2
nij SSAB S(Tij)2 S(Tj)2 S(Ti)2
(SX)2 nij nj ni N
11We 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
12Source 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
13Two-way anova 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
- Rej. region Fobt lt F(2, 12, .05) 3.89
- Decision Reject H0 variable A has an effect.
14Two-way anova 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
- Rej. region Fobt lt F(1, 12, .05) 4.75
- Decision Reject H0 variable B has an effect.
15Two-way anova hypothesis for AB
- H0 A B do not interact to affect mean response
- HA A B do interact to affect mean response
- Test statistic F MS(AB)
- MSE
- Rej. region Fobt lt F(2, 12, .05) 3.89
- Decision Reject H0 A B do interact...
16Example 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 lt F(1, 24, .05) 4.26
17Example 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 lt F(2, 24, .05) 3.40
18Example 2 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 MS(AB)
- MSE
- Rej. region Fobt lt F(2, 24, .05) 3.40
19Two-way Anova Example 1
- Compute
- CM (12375)2 5406007.5
- 30
- SSA 62052 65302 CM 3520.833
- 15
20Two-way Anova Example 1
- SSB 40252 43252 43852 CM
- 10
- 7440.0
- S(Tij)2 19102 21152 21362 22052
- nij 5 5 5 5
- 5380634.2
21Two-way Anova Example 1
- SSAB 5380634.2 5409528.33 5413447.5
5406007.5 - 1646.667
- SSTotal SX2 CM 5437581111.0 5406007.5
- 311111573.5
- SSE SSTotal SSA SSB SSAB 18966.0
22Two-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.
23Two-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.
24Two-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
25Two-way Anova Example 2
- (a) Do the appropriate analysis to answer the
questions posed by the researcher (all as .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 a .01,
determine whether this belief is supported by
these data.
26Example 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
- Rej. region Fobt lt F(2, 12, .05) 3.89
- Decision Reject H0 variable A has an effect.
27Two-way Anova Example 1