Introduction to Factorial ANOVA Designs
Dec 17, 2015
Introduction to Factorial ANOVA
Designs
Factorial Anova With factorial Anova we have more than
one independent variable The terms 2-way, 3-way etc. refer to how
many IVs there are in the analysis The following will discuss 2-way design but
may extended to more complex designs. The analysis of interactions constitutes the
focal point of factorial design
Recall the one-way Anova Total variability comes from:
Differences between groups Differences within groups
S S Between groups S S with in groups
S S total
Factorial Anova With factorial designs we have additional
sources of variability to consider Main effects
Mean differences among the levels of a particular factor
Interaction Differences among cell means not attributable
to main effects When the effect of one factor is influenced by
the levels of another
Partition of Variability
Total variability
Between-treatments var. Within-treatments var.
Factor Avariability
Factor Bvariability
Interactionvariability
Example: Arousal, task difficulty and performance
Yerkes-Dodson
Descriptive Statistics
Dependent Variable: Score
1.0000 2.23607 5
1.0000 1.41421 5
4.0000 2.23607 5
2.0000 2.36039 15
9.0000 2.54951 5
3.0000 2.12132 5
6.0000 2.64575 5
6.0000 3.40168 15
5.0000 4.78423 10
2.0000 2.00000 10
5.0000 2.53859 10
4.0000 3.52332 30
Arousalhi
lo
med
Total
hi
lo
med
Total
hi
lo
med
Total
Difficultydifficult
easy
Total
Mean Std. Deviation N
Example SStotal = ∑(X – grand mean)2
SStotal = 360 Df = N – 1 = 29
SSb/t =∑n(cell means – grand mean)2
= 5(3-4)2 + … 5(1-4)2 SSb/t =240 Df= K# of cells – 1 = 5
SSw/in = ∑(X – respective cell means)2 or SStotal- SSb/t
SSw/in = 120 Df = N-K = 24
Sums of Squares Between SSDifficulty = n(row means –grand mean)2
= 15(6-4)2 + 15(2-4)2 = 120 Df = # of rows (levels) – 1 = 1
SSArousal = n(col means – grand mean)2
= 10(2-4)2 + 10(5-4)2 + 10(5-4)2 = 60 Df = # of columns (levels) – 1 = 2
SSDXA = SSb/t - SSDifficulty - SSArousal = 240 - 120 - 60 = 60 Df = dfb/t - dfDifficulty – dfArousal = 5-1-2 = 2
Or dfdiff X dfarous
Output Mean squares and F-statistics are
calculated as before
Tests of Between-Subjects Effects
Dependent Variable: Score
240.000a 5 48.000 9.600 .000 .667
120.000 1 120.000 24.000 .000 .500
60.000 2 30.000 6.000 .008 .333
60.000 2 30.000 6.000 .008 .333
120.000 24 5.000
360.000 29
SourceB/t groups
Difficulty
Arousal
Difficulty * Arousal
Error
Total
Type IIISum ofSquares df Mean Square F Sig.
Partial EtaSquared
R Squared = .667 (Adjusted R Squared = .597)a.
Initial Interpretation Significant main effects of task difficulty
and arousal level, as well as a significant interaction
Difficulty Better performance for easy items
Arousal Low worst
Interaction Easy better in general but much more so with high
arousal
Eta-squared is given as the effect size for B/t groups (SSeffect/SStotal)
Partial eta-squared is given for the remaining factors: SSeffect/(SSeffect + SSerror)
End result: significance w/ large effect sizes
Graphical display of interactions Two ways to display previous results
lo med hi
Arousal
0.00
2.00
4.00
6.00
8.00
10.00
Mea
n S
core
Difficulty
difficult
easy
easy difficult
Difficulty
0.00
2.00
4.00
6.00
8.00
10.00
Mea
n S
core
Arousal
hi
lo
med
Graphical display of interactions What are we looking for? Do the lines behave similarly (are parallel)
or not? Does the effect of one factor depend on
the level of the other factor?
No interaction Interaction
The general linear model Recall for the general one-way anova
Where: μ = grand mean = effect of Treatment A (μa – μ)
ε = within cell error
So a person’s score is a function of the grand mean, the treatment mean, and within cell error
( )ijk i k ijY
Population main effect associated with the treatment Aj (first factor): jj
Population main effect associated with treatment Bk (second factor): kk
The interaction is defined as , the joint effect of treatment levels j and k (interaction of and ) so the linear model is:
ijkjkkjijk ey )(
jk)(
Each person’s score is a function of the grand mean, the treatment means, and their interaction (plus w/in cell error).
Effects for 2-way
The general linear model The interaction is a residual:
Plugging in and leads to:
kjjkjk )(
kjjkjk)(
Partitioning of total sum of squares Squaring yields
Interaction sum of squares can be obtained as remainder
TR A B ABSS SS SS SS 2
** ***
2* * ***
2* ** * * ***
( )
( )
( )
A ii
B jj
AB ij i ji j
SS n Y Y
SS n Y Y
SS n Y Y Y Y
AB TR A BSS SS SS SS
Partitioning of total sum of squares SSA: factor A sum of squares measures the
variability of the estimated factor A level means The more variable they are, the bigger will be SSA
Likewise for SSB
SSAB is the AB interaction sum of squares and measures the variability of the estimated interactions
( )ijk i j k ijijY
0 1 2Treatment A. :
pH
0 1 2Treatment B. :
qH
0 11 12Interaction. :
pqH
Statistical Hypothesis:
Statistical Model:
GLM Factorial ANOVA
The interaction null is that the cell means do not differ significantly (from the grand mean) outside of the main effects present, i.e. that this residual effect is zero
Interpretation: sig main fx and interaction Note that with a significant interaction, the
main effects are understood only in terms of that interaction
In other words, they cannot stand alone as an explanation and must be qualified by the interaction’s interpretation
Some take issue with even talking about the main effects, but noting them initially may make the interaction easier for others to understand when you get to it
Interpretation: sig main fx and interaction However, interpretation depends on common
sense, and should adhere to theoretical considerations Plot your results in different ways
If main effects are meaningful, then it makes sense to talk about them, whether or not an interaction is statistically significant or not E.g. note that there is a gender effect but w/ interaction
we now see that it is only for level(s) X of Factor B To help you interpret results, test simple effects
Is simple effect of A significant within specific levels of B?
Is simple effect of B significant within specific levels of A?
Simple effects Analysis of the effects of one factor at one
level of the other factor Some possibilities from previous example
Arousal for easy items (or hard items) Difficulty for high arousal condition (or medium
or low)
Simple effects SSarousal for easy items = 5(3-6)2 + 5(6-6)2 + 5(9-6)2 = 90 SSarousal for difficult items = 5(1-2)2 + 5(4-2)2 + 5(1-2)2 = 30
SSdifficulty at lo = 5(3-2)2 + 5(1-2)2 = 10 SSdifficulty at med = 5(6-5)2 + 5(4-5)2 = 10 SSdifficulty at hi = 5(9-5)2 + 5(1-5)2 = 160
Simple effects Note that the simple effect represents a
partitioning of SSmain effect and SSinteraction NOT JUST THE INTERACTION!!
From Anova table: SSarousal + SSarousal by difficulty = 60 + 60 = 120
SSarousal for easy items = 90 SSarousal for difficult items = 30 90 + 30 = 120
SSdifficulty + SSarousal by difficulty = 120 + 60 = 180 SSdifficulty at lo = 10 SSdifficulty at med = 10 SSdifficulty at hi = 160 10 + 10 + 160 = 180
Pulling it off in SPSS
Paste!
Pulling it off in SPSS Add
/EMMEANS = tables(a*b)compare(a) /EMMEANS = tables(a*b)compare(b)
Pulling it off in SPSS Output
Univariate Tests
Dependent Variable: Score
30.000 2 15.000 3.000 .069 .200
120.000 24 5.000
90.000 2 45.000 9.000 .001 .429
120.000 24 5.000
Contrast
Error
Contrast
Error
Difficultydifficult
easy
Sum ofSquares df Mean Square F Sig.
Partial EtaSquared
Each F tests the simple effects of Arousal within each level combination of the other effects shown.These tests are based on the linearly independent pairwise comparisons among the estimated marginalmeans.
Univariate Tests
Dependent Variable: Score
160.000 1 160.000 32.000 .000 .571
120.000 24 5.000
10.000 1 10.000 2.000 .170 .077
120.000 24 5.000
10.000 1 10.000 2.000 .170 .077
120.000 24 5.000
Contrast
Error
Contrast
Error
Contrast
Error
Arousalhi
lo
med
Sum ofSquares df Mean Square F Sig.
Partial EtaSquared
Each F tests the simple effects of Difficulty within each level combination of the other effects shown.These tests are based on the linearly independent pairwise comparisons among the estimatedmarginal means.
Test for simple fx with no sig interaction? What if there was no significant
interaction, do I still test for simple effects?
Maybe, but more on that later A significant simple effect suggests
that at least one of the slopes across levels is significantly different than zero
However, one would not conclude that the interaction is ‘close enough’ just because there was a significant simple effect
The nonsig interaction suggests that the slope seen is not statistically different from the other(s) under consideration.
1.00 2.00
VAR00001
0
1
2
3
4
Mea
n V
AR
0000
2
VAR00003
1.00
2.00
Multiple comparisons and contrasts For main effects multiple comparisons and
contrasts can be conducted as would be normally
One would have all the same considerations for choosing a particular method of post hoc analysis or weights for contrast analysis
Multiple comparisons and contrasts With interactions post hocs can be run
comparing individual cell means The problem is that it rarely makes
theoretical sense to compare many of the pairs of means under consideration
Contrasts for interactions We may have a specific result to
look for with regard to our interaction
For example, we may think based on past research moderate arousal should result in optimal performance for difficult items
We would assign contrast weights to reflect this hypothesis
Pulling it off in SPSS
Analyze General Linear Model Univariate
Select Dependent Variable and Specify Fixed and/or Random Factor(s) (Treatment Groups and or Patient Characteristic(s), Treatment Sites, etc.)
Paste Launches Syntax Window
Add /LMATRIX command lines
AllRUN
/LMATRIX ‘<Title for 1st Contrast>’<Specify Weights for 1st Contrast>;
‘<Title for 2nd Contrast>’<Specify Weights for 2nd Contrast>;
…
‘<Title for Final Contrast>’<Specify Weights for Final Contrast>
/LMATRIX Command
For this 3 X 2 design the weights will order as follows:
A1B1 A1B2 A2B1 A2B2 A3B1 A3B2
Note for this example, SPSS is analyzing categories in alphabetical order
Arousal hi lo med Task Diff Easy
In other words Hi:Difficult Hi:Easy Lo:Difficult … Med:Easy
Test Results
Dependent Variable: Score
30.000 1 30.000 6.000 .022 .200
120.000 24 5.000
SourceContrast
Error
Sum ofSquares df Mean Square F Sig.
Partial EtaSquared
As alluded to previously it is possible to have:
Sig overall F Sig contrast Nonsig posthoc
Nonsig F Nonsig contrast
e.g. 1 & 3 VS. 2 Sig posthoc
1 vs. 2 sig1.00 2.00 3.00
VAR00001
0
1
2
3
4
5
Mea
n V
AR
0000
4
A different model ☺
If cognitive anxiety is low, then the performance effects of physiological arousal will be low; but if it is high, the effects will be large and sudden.