08 Factorial2 PDF
08 Factorial2 PDF
08 Factorial2 PDF
Page
1. Three-way ANOVA
A three-way analysis of variance has three independent variables
o Factor A with a levels
o Factor B with b levels
o Factor C with c levels
For simplicity, we will examine the simplest three way ANOVA: 2*2*2
design
o Factor A with 2 levels
o Factor B with 2 levels
o Factor C with 2 levels
I will present the formulas in their general form, and will give an example of
a more complex design at the conclusion
High Self-Monitors
Strong Argument Weak Argument
Expert Source Attractive Source Expert Source Attractive Source
4 4 4 2 3 4 5 3
3 6 4 3 5 3 5 5
4 3 2 4 3 5 7 6
5 4 3 3 2 3 5 7
2 5 5 2 6 2 6 7
5 4 3 4 4 3 4 6
Low Self-Monitors
Strong Argument Weak Argument
Expert Source Attractive Source Expert Source Attractive Source
3 1 5 2 5 5 6 4
5 5 4 4 6 6 4 3
5 3 3 4 4 4 4 4
4 4 2 3 7 6 2 2
3 3 4 4 6 7 4 3
2 4 6 3 7 5 5 4
njkl = 12
5.5
5
Strong Expert
Strong Attractive
4.5
Weak Expert
Weak Attractive
4
3.5
3
High Self-Monitor Low Self-Monitor
Three-way interaction
5.5
Persuasiveness
5
Strong Argument
4.5
Weak Argument
4
3.5
3
Expert Attractive Expert Attractive
Self-Monitoring
High Low
Strength of Strong 3.67 3.58
Argument Weak 4.54 4.71
Strength Effect -0.87 -1.13
n jk = 24
Self-Monitoring
High Low
Source of Expert 3.83 4.58
Argument Attractive 4.38 3.71
Source Effect -0.55 0.87
n jl = 24
Strength of Argument
Strong Weak
Source of Expert 3.79 4.63
Argument Attractive 3.46 4.63
Strength Effect 0.33 0.00
nkl = 24
Meaning
Main Effects
A Comparison of marginal means of Factor A, averaging over
levels of B and C
B Comparison of marginal means of Factor B, averaging over
levels of A and C
C Comparison of marginal means of Factor C, averaging over
levels of A and B
Two-way
Interactions
A*B Examines whether the A effect is the same at every level of
B, averaging over levels of C
Equivalently, examines whether the B effect is the same at
every level of A, averaging over levels of C
A*C Examines whether the A effect is the same at every level of
C, averaging over levels of B
Equivalently, examines whether the C effect is the same at
every level of A, averaging over levels of B
B*C Examines whether the B effect is the same at every level of
C, averaging over levels of A
Equivalently, examines whether the C effect is the same at
every level of B, averaging over levels of A
Three-way
Interaction
A*B*C Examines whether the two-way A*B interaction is the same
at every level of C
Equivalently, examines whether the two-way A*C
interaction is the same at every level of B
Equivalently, examines whether the two-way B*C
interaction is the same at every level of A
Error Components:
ijk The unexplained part of the score
j = 0
j =1
k =1
k =0
l =1
l =0
( ) jk
j =1
= 0 for each level of j ( )
j =1
jl = 0 for each level of j
b c
( ) jk
k =1
= 0 for each level of k ( )
l =1
jl = 0 for each level of l
( )
k =1
kl = 0 for each level of k
c
( )
l =1
kl = 0 for each level of l
( ) jkl The effect of being in level j of Factor A, level k of Factor B, and level l of Factor C
( )
j =1
jkl = 0 for each level of j ( )
k =1
jkl = 0 for each level of k
c
( )
l =1
jkl = 0 for each level of l
SS Total
SS Total Total)
(SS Corrected
SS Between SS Within
(SS Model) (SS Error)
SS SS SS SS SS SS SS
A B C A*B A*C B*C A*B*C
o The math works out nicely (as we would expect) so that if we take the
ratio of the MS for a component of the model over the MS error, we
obtain a valid test of the model component
ANOVA
Source of Variation SS df MS F P-value
Main effects
Factor A SSA (a-1) SSA/dfa MSA/MSW
Factor B SSB (b-1) SSB/dfb MSB/MSW
Factor C SSC (c-1) SSC/dfc MSC/MSW
Two-way Interactions
A * B interaction SSAB (a-1)(b-1) SSAB/dfab MSAB/MSW
A * C interaction SSAC (a-1)(c-1) SSAC/dfac MSAC/MSW
B * C interaction SSAB (b-1)(c-1) SSBC/dfbc MSBC/MSW
Three-way Interactions
A * B * C interaction SSABC (a-1)(b-1)(c-1) SSABC/dfabc MSABC/MSW
Dependent Variable: DV
Type III Sum
Source of Squares df Mean Square F Sig.
Corrected Model 72.833a 7 10.405 7.916 .000
Intercept 1633.500 1 1633.500 1242.778 .000
MONITOR 4.167E-02 1 4.167E-02 .032 .859
STRENGTH 24.000 1 24.000 18.259 .000
SOURCE .667 1 .667 .507 .478
MONITOR * STRENGTH .375 1 .375 .285 .595
MONITOR * SOURCE 12.042 1 12.042 9.161 .003
STRENGTH * SOURCE .667 1 .667 .507 .478
MONITOR * STRENGTH
35.042 1 35.042 26.660 .000
* SOURCE
Error 115.667 88 1.314
Total 1822.000 96
Corrected Total 188.500 95
a. R Squared = .386 (Adjusted R Squared = .338)
Main Effects:
Self-monitoring: F(1, 88) = 0.03, p = .86
Strength of Argument: F(1, 88) = 18.26, p < .01
Source of Argument: F(1, 88) = 0.51, p = .48
Two-way interactions:
Monitoring*Strength: F(1, 88) = 0.29, p = .60
Monitoring*Source: F(1, 88) = 3.32, p = .02
Strength*Source: F(1, 88) = 0.51, p = .48
Three-way interactions:
Monitoring*Strength*Source: F(1, 88) = 26.66, p < .01
We can perform contrasts using the same method we developed for two-way
ANOVA
ONEWAY dv by group
/CONT = 1 1 1 1 -1 -1 -1 -1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Self-Monitoring -.1667 .93609 -.178 88 .859
ONEWAY dv by group
/CONT = 1 -1 1 -1 1 -1 1 -1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Strength -4.0000 .93609 -4.273 88 .000
ONEWAY dv by group
/CONT = 1 1 -1 -1 1 1 -1 -1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Source .6667 .93609 .712 88 .478
ONEWAY dv by group
/CONT = 1 -1 1 -1 -1 1 -1 1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Monitoring *
.5000 .93609 .534 88 .595
Strength
ONEWAY dv by group
/CONT = 1 1 -1 -1 -1 -1 1 1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Monitoring
-2.8333 .93609 -3.027 88 .003
* Source
ONEWAY dv by group
/CONT = 1 -1 -1 1 1 -1 -1 1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Strength
.6667 .93609 .712 88 .478
*Source
ONEWAY dv by group
/CONT = 1 -1 -1 1 -1 1 1 -1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV 3-way 4.8333 .93609 5.163 88 .000
o We can compute all the main effect and interaction tests with contrasts
because for a 2*2*2 design, all the tests are single degree of freedom tests.
For more complex a*b*c designs, omnibus tests with more than 1 degree
of freedom can be performed using simultaneous tests of orthogonal
contrasts.
c b a c 2jkl
Std error ( ) = MSW
l =1 k =1 j =1 n jkl
t~
t observed =
c jkl X . jkl
standard error( ) c 2jkl
MSW
n jkl
SSC
2 dfc SSC
SS = F(1,dfw) =
SSW
=
c 2jkl MSW
n dfw
jkl
q (qcrit )2
Compare tobserved to crit or Fobserved to
2 2
ONEWAY dv by group
/CONT = 1 -1 -1 1 0 0 0 0 .
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV 1 2.7500 .66191 4.155 88 .000
ONEWAY dv by group
/CONT = 0 0 0 0 1 -1 -1 1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV 1 -2.0833 .66191 -3.147 88 .002
Monitor monitor
Strength strength
Source source
monitor * source monitor * source
monitor * strength monitor * strength
strength * source
monitor * strength * source source * strength WITHIN monitor (1)
source * strength WITHIN monitor (2)
Using contrasts:
ONEWAY dv by group
/CONT = 1 -1 0 0 -1 1 0 0
/CONT = 0 0 1 -1 0 0 -1 1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Expert Source 2.6667 .66191 4.029 88 .000
Attractive Source -2.1667 .66191 -3.273 88 .002
monitor monitor
strength strength
source source
strength * source strength * source
monitor * source monitor * source
monitor * strength
monitor * strength * source monitor * strength WITHIN source (1)
monitor * strength WITHIN source (2)
* * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * *
Using contrasts:
ONEWAY dv by group
/CONT = 1 0 -1 0 -1 0 1 0
/CONT = 0 1 0 -1 0 -1 0 1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV Strong Argument 1.0000 .66191 1.511 88 .134
Weak Argument -3.8333 .66191 -5.791 88 .000
monitor monitor
strength strength
source source
strength * source strength * source
monitor * strength monitor * strength
monitor * source
monitor * strength * source monitor * source WITHIN strength (1)
monitor * source WITHIN strength (2)
* * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * *
o We should not take all three approaches; only one is necessary. The
choice you make should be the one that makes the most sense for your
theory/hypotheses
Using Contrasts:
ONEWAY dv by group
/CONT = 0 1 0 -1 0 0 0 0
/CONT = 0 0 0 0 0 -1 0 1.
Contrast Tests
Value of
Contrast Contrast Std. Error t df Sig. (2-tailed)
DV High Monitor, Weak Message -1.9167 .46804 -4.095 88 .000
Low Monitor, Weak Message -1.9167 .46804 -4.095 88 .000
* * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * *
Using GLM
UNIANOVA dv BY monitor strength source
/EMMEANS = TABLES(monitor*strength*source) COMPARE(source)
/PRINT = DESCRIPTIVE .
Univariate Tests
Dependent Variable: dv
Sum of
monitor strength Squares df Mean Square F Sig.
High Strong Contrast 4.167 1 4.167 3.170 .078
Error 115.667 88 1.314
Weak Contrast 22.042 1 22.042 16.769 .000
Error 115.667 88 1.314
Low Strong Contrast .167 1 .167 .127 .723
Error 115.667 88 1.314
Weak Contrast 22.042 1 22.042 16.769 .000
Error 115.667 88 1.314
Each F tests the simple effects of source within each level combination of the other effects shown.
These tests are based on the linearly independent pairwise comparisons among the estimated
marginal means.
Formulas for partial omega-squared and r (for contrasts only) are easily
adapted to a three-factor design:
2
Fcontrast t contrast
r= =
Fcontrast + df within 2
t contrast + df within
35.042 (1)1.314
(2A*B*C ) = = .21
35.042 + [96 1]1.314
The logic we developed for two- and three-factor ANOVA can be easily
extended to four-factor, five-factor and even higher order ANOVAs
By now you have seen how the formulas generalize so that you can compute
values for any order design
Number of
Number of Main Two-way Three-way Four-way Five-way Total Number
Factors Effects Interactions Interactions Interactions Interactions of tests
2 2 1 3
3 3 3 1 7
4 4 6 4 1 15
5 5 10 10 5 1 31
25
Behavior Aviodance Test Scores
20
15 Mild
Moderate
10 Severe
5
0
Insight
Insight
Implosion
Implosion
Desensitization
Desensitization
Female Male
Dependent Variable: DV
Type III Sum
Source of Squares df Mean Square F Sig.
Corrected Model 368.167a 17 21.657 9.356 .000
Intercept 7141.500 1 7141.500 3085.128 .000
TREAT 22.333 2 11.167 4.824 .014
PHOBIA 183.000 2 91.500 39.528 .000
GENDER 115.574 1 115.574 49.928 .000
TREAT * PHOBIA 39.333 4 9.833 4.248 .006
TREAT * GENDER .259 2 .130 .056 .946
PHOBIA * GENDER 1.815 2 .907 .392 .679
TREAT * PHOBIA *
5.852 4 1.463 .632 .643
GENDER
Error 83.333 36 2.315
Total 7593.000 54
Corrected Total 451.500 53
a. R Squared = .815 (Adjusted R Squared = .728)
o We also have main effects for treatment and for phobia, but we should
refrain from interpreting them because of the higher order interaction
Lets start with the main effect of gender. This analysis reveals the effect of
gender averaging across type of treatment and severity of phobia.
o This analysis tells us that men show less post-test phobia than women,
averaging across type of treatment and severity of phobia.
Because this test has only 1 df, no follow-up tests are necessary
Treatment of Phobia:
Treatment by Phobia Interaction
16
14
Desensitization
12 Implosion
Insight
10
8
Mild Moderate Severe
Degree of Phobia
Degree of Phobia
Mild Moderate Severe
Treatment Desens. 13.67 11.67 11.00
Implosion 15.33 12.00 8.00
Insight 12.50 10.33 9.00
* * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * *
ONEWAY dv by group
/CONT = -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0
/CONT = -1 0 1 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0
/CONT = 0 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0
/CONT = 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0
/CONT = 0 0 0 -1 0 1 0 0 0 0 0 0 -1 0 1 0 0 0
/CONT = 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0
/CONT = 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 0
/CONT = 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0 -1 0 1
/CONT = 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1
(Note: Ignore Significance levels)
Contrast Tests
Value of Sig.
Contrast Contrast Std. Error t df (2-tailed)
DV 1 -4.0000 1.75682 -2.277 36 .029
2 -5.3333 1.75682 -3.036* 36 .004
3 -1.3333 1.75682 -.759 36 .453
4 -6.6667 1.75682 -3.795* 36 .001
5 -14.6667 1.75682 -8.348* 36 .000
6 -8.0000 1.75682 -4.554* 36 .000
7 -4.3333 1.75682 -2.467 36 .019
8 -7.0000 1.75682 -3.984* 36 .000
9 -2.6667 1.75682 -1.518 36 .138
4.11
Compare tobserved to tcritical = = 2.91
2
Treatment of Phobia:
Treatment by Phobia Interaction
16
14
Mild
12 Moderate
Severe
10
8
Desensitization Implosion Insight
o However, notice how much easier these results would have been to
explain had the treatment by phobia interaction not been significant! (We
would be left with three main effects!)
o The moral of the story is that you should not just add extra factors just
to see what might happen. You want to design as concise a study as
possible while still testing your hypotheses.