Two independent variables
• Often, we wish to study 2 (or more) factors in a 
single experiment 
– Compare two or more treatment protocols 
– Compare scores of people who are young, middle-aged, 
and elderly 
• The baseline experiment will therefore have two 
factors as Independent Variables 
– Treatment type 
– Age Group
 Factorial (Two or more way) ANOVA 
• One dependent variable 
 interval or ratio with a normal distribution 
• Two independent variables 
 nominal (define groups), and independent of each other 
• Three hypothesis tests: 
 Test effect of each independent variable controlling for 
the effects of the other independent variable 
 One: H0: Treatment type has no impact on Outcome 
 Two: H0: Age Group has no impact on Outcome 
 Three: Test interaction effect for combinations of categories 
H0: Treatment and Age Group interact in affecting Outcome
 First stage 
• Identical to independent samples ANOVA 
• Compute SSTotal, SSBetween treatments and 
SSWithin treatments 
 Second stage 
• Partition the SSBetween treatments into three 
separate components, differences attributable 
to Factor A, to Factor B, and to the AxB 
interaction
 The validity of the ANOVA presented in 
this chapter depends on three 
assumptions common to other hypothesis 
tests 
1. The observations within each sample must 
be independent of each other 
2. The populations from which the samples are 
selected must be normally distributed 
3. The populations from which the samples are 
selected must have equal variances 
(homogeneity of variance)
Total Variability 
Between 
Treatments 
Factor 
A 
Factor B Interaction 
Within 
Treatments
G 
N 
SS X total 
2 
2   
2 2 
G 
N 
T 
   
n 
SS between treatments 
 withintreatments inside each treatment SS SS
 Factorial designs 
• Consider more than one factor 
• Joint impact of factors is considered. 
 Three hypotheses tested by three F-ratios 
• Each tested with same basic F-ratio structure 
variance (differenc es) between treatments 
variance (differenc es) expected with no treatment effect 
F 
• Factor 1 (independent variable, e.g. type of crop) 
• Always nominal or ordinal (it defines distinct groups) 
• Factor 2 (independent variable, e.g., fertilizer) 
• Always nominal or ordinal (it defines distinct groups) 
• Outcome (dependent variable, e.g. yield) 
• Always interval or ratio 
• Mean Outcomes of the 
groups defined by Factor 1 
and Factor 2 are being 
compared.
 Mean differences among levels of one factor 
• Differences are tested for statistical significance 
• Each factor is evaluated independently of the 
other factor(s) in the study 
  
 
A A 
1 2 
1 2 
: 
: 
0 
1 
A A 
H 
H 
  
 
  
 
B B 
1 2 
1 2 
: 
: 
0 
1 
B B 
H 
H 
  

 Not the same as experimental control. 
 Statistical control: we look for the effect of 
one independent variable within each group of 
the other dependent variable. 
 This removes the impact of the other 
independent variable. 
 Sometimes a variable which showed no 
significant effect in a Oneway ANOVA becomes 
significant if another effect is controlled.
 The mean differences between individuals 
treatment conditions, or cells, are different 
from what would be predicted from the 
overall main effects of the factors 
 H0: There is no interaction between 
Factors A and B 
 H1: There is an interaction between 
Factors A and B
• First: 
• Does Factor 1 have any 
impact on the Outcome? 
• Null: The groups defined by 
Factor 1 will have the same 
Mean Outcome. 
• Second: 
• Does Factor 2 have any impact on the Outcome? 
• Null: The groups defined by Factor 2 will have the 
same Mean Outcome. 
• Third: 
• Do Factor 1 and Factor 2 interact in influencing 
Outcome? 
• Null: No combination of Factor 1 and Factor 2 
produces unusually high or unusually low mean 
Outcome scores.
The equations come later!
From one-way to two-way designs: 
• Often, we wish to study 2 (or more) factors in a 
single experiment 
– Compare a new and standard style of noise filter (inside 
a muffler) on a car 
– The size of the car might also be an important factor in 
noise level. 
• The baseline experiment will therefore have two 
factors as Independent Variables 
– Type of noise filter (Octel vs Standard) 
– Size of car (Small, Midsize, Large)
Standard Filter Octel Filter 
Type of Noise Filter 
860 
850 
840 
830 
820 
810 
800 
790 
780 
770 
760 
Noise Level Reading 
Group Statistics 
18 815.56 32.217 
18 804.72 25.637 
Type of Noise Fil ter 
Standard Fi l ter 
Octel Fi l ter 
Noise Level Reading 
N Mean Std. Deviation 
 First Variable: Filter Type 
• Nominal – Dichotomy 
• Dependent variable is 
noise level (ratio level) 
 Test: Two-Sample t 
• Compare means (above) 
• View boxplot (at right) 
• t (34)=1.116, p = .272 
 RETAIN H0 
 Type of filter does not cause a 
significant difference in noise.
N Mean Std. Dev'n 
12 824.17 7.638 
12 833.75 13.505 
12 772.50 10.335 
36 810.14 29.216 
Smal l 
Mid-Size 
Large 
Total 
 Second Variable: Car Size 
• Nominal – 3 groups 
• Dep.Var: noise level (ratio) 
 Test: Oneway ANOVA 
• Compare means (above) 
• View boxplot (at left) 
• F (2,33) =112.44, p < .0005 
 REJECT H0 
 Size of car is related to a significant 
difference in noise. 
Small Mid-Size Large 
Size of Car 
860 
840 
820 
800 
780 
760 
Noise Level Reading
ANOVA is significant, so we need Post-hoc Tests. 
Groups: Same Size so Test: Tukey HSD 
- Small vs Large = Sig. 
- Midsize vs Large = Sig. 
- Small vs Midsize = n.s. 
Multiple Comparisons 
Dependent Variable: Noise Level Reading 
Tukey HSD 
-9.583 4.394 .089 
51.667* 4.394 .000 
9.583 4.394 .089 
61.250* 4.394 .000 
-51.667* 4.394 .000 
-61.250* 4.394 .000 
(J) Size of Car 
Mid-Size 
Large 
Smal l 
Large 
Smal l 
Mid-Size 
(I) Size of Car 
Smal l 
Mid-Size 
Large 
Mean 
Di fference 
(I-J) Std. Error Sig. 
The mean di fference is significant *. at the .05 level.
 Filters – Octel vs Standard 
• Independent sample t-test 
• No significant differences 
 Size of Car – Small, Midsize, Large 
• ANOVA 
• Significant differences 
• Large cars are significantly more quiet 
 BUT – is it possible that the Octel filter might 
work better with just one of the types of 
cars?
 Is car size related to noise level, if 
effect of filter type is controlled? 
 Is filter type related to noise level, if 
effect of size of car is controlled? 
 Is there a combination of Size of Car and 
Noise Filter Type that is especially loud, or 
especially soft? 
• called an INTERACTION effect. 
 Multiple comparison tests
Small Mid-Size Large 
Size of Car 
860 
840 
820 
800 
780 
760 
Noise Level Reading (Decibels) 
Type of Noise Filter 
Standard Filter 
Octel Filter
 Factorial (Two or more way) ANOVA 
• One dependent variable 
 interval or ratio 
 normal distribution 
• Two independent variables 
 nominal (define groups) 
 independent of each other 
• Test effect of each I.V. controlling for the effects 
of the other I.V. 
• Test interaction effect for combinations of 
categories
Tests of Between-Subjects Effects 
Dependent Variable: Noise Level Reading (Decibels) 
Type III Sum 
of Squares df Mean Square F Sig. 
23655612.5a 6 3942602.083 60269.076 .000 
26051.389 2 13025.694 199.119 .000 
1056.250 1 1056.250 16.146 .000 
804.167 2 402.083 6.146 .006 
1962.500 30 65.417 
23657575.0 36 
Source 
Model 
size 
type 
size * type 
Error 
Total 
R Squared = 1.000 (Adjusted a. R Squared = 1.000) 
 SIZE effect is still significant 
 TYPE effect is significant when size is controlled 
 INTERACTION effect is significant 
• There is a combination which shows more than the combined 
impact of SIZE and TYPE
Means of each combination of Size & Type 
INTERACTION: Whenever lines not parallel
Manufacturers of the new Octel noise filter claim that it 
reduces noise levels in cars of all sizes. In a Two-Way 
ANOVA, this claim proved to be true. The Size of Car 
effect was significant (F(2,36) = 199.119, p < .001). When 
the impact of size was controlled, the Filter Type effect 
was also significant (F(1,36) = 16.146, p < .001), with the 
Octel Filter having lower noise levels than standard filters. 
The Interaction effect was also significant (F(2,30) = 
6.146, p = .006). For Small cars, the noise difference 
between filter types was 3.33; for Large cars it was 5.000, 
but Midsize cars with the Octel filter averaged 24.166 
points lower on the Noise Level scale. 
A complete report would include the Mean and SD of each cell where a 
significant difference occurred, either in a table or in narrative. It 
would include effect size (η2) for significant effects.
 A table or graph of group means 
 A report of the three hypothesis tests: 
• One for Factor A 
• One for Factor B 
• One for the interaction of A with B 
 Asterisks often used to report hypothesis test results 
* = significant with alpha = .05 
** = significant with alpha = .01 
*** = significant with alpha = .001 
 If there are more than two factors, there will be more 
hypothesis tests for factors, and more interactions.
Total Variability 
Between 
Treatments 
Factor 
A 
Factor B Interaction 
Within 
Treatments
 Three distinct tests 
• Main effect of Factor A 
• Main effect of Factor B 
• Interaction of A and B 
 A separate F test is conducted for each
Notation describes procedure 
Tables usually used to present 
the results 
Group means (cell) 
Row means 
Column means 
Each factor is operationalized by one 
or more variables (measures) 
Images from Trochim’s Research Methods Knowledge Base at 
http://www.socialresearchmethods.net/kb/index.php
 Plot the means of each group (defined as a 
combination of Factor 1 and Factor 2) 
 If all the null hypotheses are true, all the points 
will have about the same Mean Outcome level.
 The two row means 
are the same 
 The two column 
means are the 
same 
 All groups have the 
same mean score 
 Neither factor had 
any effect 
Images from Trochim’s Research Methods Knowledge Base at 
http://www.socialresearchmethods.net/kb/index.php
 Row means: the same 
 Column means: differ 
 No score especially high 
or especially low 
 Row means: differ 
 Column means: the same 
 No score especially high 
or especially low 
Images from Trochim’s Research Methods Knowledge Base at 
http://www.socialresearchmethods.net/kb/index.php
 The mean differences between individuals 
treatment conditions, or cells, are different 
from what would be predicted from the 
overall main effects of the factors 
 H0: There is no interaction between 
Factors A and B 
 H1: There is an interaction between 
Factors A and B
 Row means differ 
 Column means differ 
 One group is different 
 Others are the same 
 Row means the same 
 Column means the same 
 Graph shows that pattern 
in one factor depends on 
the 
status of the other Images from Trochim’s Research Methods Knowledge Base at 
http://www.socialresearchmethods.net/kb/index.php
 Dependence of factors 
• The effect of one factor depends on the level 
or value of the other 
 Non-parallel lines (cross or converge) in a 
graph 
• Indicate interaction is occurring 
 Typically called the A x B interaction
Total Variability 
Between 
Treatments 
Factor 
A 
Factor B Interaction 
Within 
Treatments
We will compute problems by hand to gain 
understanding, but not on a test
G 
N 
SS X total 
2 
2   
2 2 
G 
N 
T 
   
n 
SS between treatments 
 withintreatments inside each treatment SS SS
Total Variability 
Between 
Treatments 
Factor 
A 
Factor B Interaction 
Within 
Treatments
dftotal = N – 1 
dfwithin treatments = Σdfinside each treatment 
dfbetween treatments = k – 1 
dfA = number of rows – 1 
dfB = number of columns– 1 
dfAxB = dfbetween treatments – dfA – dfB
B 
SS 
SS 
MS    
A df 
within treatments 
SS 
within treatments 
A 
MS  
within treatments df 
AxB 
AxB 
AxB 
B 
B 
A 
SS 
MS 
df 
MS 
df 
AxB 
within 
MS 
MS 
F    
A AxB 
MS 
B 
within 
B 
A 
within 
MS 
F 
MS 
F 
MS
 η2, is computed as the percentage of 
variability not explained by other factors. 
A 
SS 
A SS SS 
A within treatments 
A 
total B AxB 
SS 
SS SS SS 
 
 
  
 2  
B 
SS 
B SS SS 
B within treatments 
B 
total A AxB 
SS 
SS SS SS 
 
 
  
 2  
AxB 
SS 
AxB SS SS 
AxB within treatments 
AxB 
total A B 
SS 
SS SS SS 
 
 
  
 2 
Two independent variables

Two-Way ANOVA Overview & SPSS interpretation

  • 1.
  • 2.
    • Often, wewish to study 2 (or more) factors in a single experiment – Compare two or more treatment protocols – Compare scores of people who are young, middle-aged, and elderly • The baseline experiment will therefore have two factors as Independent Variables – Treatment type – Age Group
  • 3.
     Factorial (Twoor more way) ANOVA • One dependent variable  interval or ratio with a normal distribution • Two independent variables  nominal (define groups), and independent of each other • Three hypothesis tests:  Test effect of each independent variable controlling for the effects of the other independent variable  One: H0: Treatment type has no impact on Outcome  Two: H0: Age Group has no impact on Outcome  Three: Test interaction effect for combinations of categories H0: Treatment and Age Group interact in affecting Outcome
  • 4.
     First stage • Identical to independent samples ANOVA • Compute SSTotal, SSBetween treatments and SSWithin treatments  Second stage • Partition the SSBetween treatments into three separate components, differences attributable to Factor A, to Factor B, and to the AxB interaction
  • 6.
     The validityof the ANOVA presented in this chapter depends on three assumptions common to other hypothesis tests 1. The observations within each sample must be independent of each other 2. The populations from which the samples are selected must be normally distributed 3. The populations from which the samples are selected must have equal variances (homogeneity of variance)
  • 7.
    Total Variability Between Treatments Factor A Factor B Interaction Within Treatments
  • 8.
    G N SSX total 2 2   2 2 G N T    n SS between treatments  withintreatments inside each treatment SS SS
  • 10.
     Factorial designs • Consider more than one factor • Joint impact of factors is considered.  Three hypotheses tested by three F-ratios • Each tested with same basic F-ratio structure variance (differenc es) between treatments variance (differenc es) expected with no treatment effect F 
  • 11.
    • Factor 1(independent variable, e.g. type of crop) • Always nominal or ordinal (it defines distinct groups) • Factor 2 (independent variable, e.g., fertilizer) • Always nominal or ordinal (it defines distinct groups) • Outcome (dependent variable, e.g. yield) • Always interval or ratio • Mean Outcomes of the groups defined by Factor 1 and Factor 2 are being compared.
  • 12.
     Mean differencesamong levels of one factor • Differences are tested for statistical significance • Each factor is evaluated independently of the other factor(s) in the study    A A 1 2 1 2 : : 0 1 A A H H       B B 1 2 1 2 : : 0 1 B B H H   
  • 13.
     Not thesame as experimental control.  Statistical control: we look for the effect of one independent variable within each group of the other dependent variable.  This removes the impact of the other independent variable.  Sometimes a variable which showed no significant effect in a Oneway ANOVA becomes significant if another effect is controlled.
  • 14.
     The meandifferences between individuals treatment conditions, or cells, are different from what would be predicted from the overall main effects of the factors  H0: There is no interaction between Factors A and B  H1: There is an interaction between Factors A and B
  • 15.
    • First: •Does Factor 1 have any impact on the Outcome? • Null: The groups defined by Factor 1 will have the same Mean Outcome. • Second: • Does Factor 2 have any impact on the Outcome? • Null: The groups defined by Factor 2 will have the same Mean Outcome. • Third: • Do Factor 1 and Factor 2 interact in influencing Outcome? • Null: No combination of Factor 1 and Factor 2 produces unusually high or unusually low mean Outcome scores.
  • 16.
  • 17.
    From one-way totwo-way designs: • Often, we wish to study 2 (or more) factors in a single experiment – Compare a new and standard style of noise filter (inside a muffler) on a car – The size of the car might also be an important factor in noise level. • The baseline experiment will therefore have two factors as Independent Variables – Type of noise filter (Octel vs Standard) – Size of car (Small, Midsize, Large)
  • 18.
    Standard Filter OctelFilter Type of Noise Filter 860 850 840 830 820 810 800 790 780 770 760 Noise Level Reading Group Statistics 18 815.56 32.217 18 804.72 25.637 Type of Noise Fil ter Standard Fi l ter Octel Fi l ter Noise Level Reading N Mean Std. Deviation  First Variable: Filter Type • Nominal – Dichotomy • Dependent variable is noise level (ratio level)  Test: Two-Sample t • Compare means (above) • View boxplot (at right) • t (34)=1.116, p = .272  RETAIN H0  Type of filter does not cause a significant difference in noise.
  • 19.
    N Mean Std.Dev'n 12 824.17 7.638 12 833.75 13.505 12 772.50 10.335 36 810.14 29.216 Smal l Mid-Size Large Total  Second Variable: Car Size • Nominal – 3 groups • Dep.Var: noise level (ratio)  Test: Oneway ANOVA • Compare means (above) • View boxplot (at left) • F (2,33) =112.44, p < .0005  REJECT H0  Size of car is related to a significant difference in noise. Small Mid-Size Large Size of Car 860 840 820 800 780 760 Noise Level Reading
  • 20.
    ANOVA is significant,so we need Post-hoc Tests. Groups: Same Size so Test: Tukey HSD - Small vs Large = Sig. - Midsize vs Large = Sig. - Small vs Midsize = n.s. Multiple Comparisons Dependent Variable: Noise Level Reading Tukey HSD -9.583 4.394 .089 51.667* 4.394 .000 9.583 4.394 .089 61.250* 4.394 .000 -51.667* 4.394 .000 -61.250* 4.394 .000 (J) Size of Car Mid-Size Large Smal l Large Smal l Mid-Size (I) Size of Car Smal l Mid-Size Large Mean Di fference (I-J) Std. Error Sig. The mean di fference is significant *. at the .05 level.
  • 21.
     Filters –Octel vs Standard • Independent sample t-test • No significant differences  Size of Car – Small, Midsize, Large • ANOVA • Significant differences • Large cars are significantly more quiet  BUT – is it possible that the Octel filter might work better with just one of the types of cars?
  • 22.
     Is carsize related to noise level, if effect of filter type is controlled?  Is filter type related to noise level, if effect of size of car is controlled?  Is there a combination of Size of Car and Noise Filter Type that is especially loud, or especially soft? • called an INTERACTION effect.  Multiple comparison tests
  • 23.
    Small Mid-Size Large Size of Car 860 840 820 800 780 760 Noise Level Reading (Decibels) Type of Noise Filter Standard Filter Octel Filter
  • 24.
     Factorial (Twoor more way) ANOVA • One dependent variable  interval or ratio  normal distribution • Two independent variables  nominal (define groups)  independent of each other • Test effect of each I.V. controlling for the effects of the other I.V. • Test interaction effect for combinations of categories
  • 25.
    Tests of Between-SubjectsEffects Dependent Variable: Noise Level Reading (Decibels) Type III Sum of Squares df Mean Square F Sig. 23655612.5a 6 3942602.083 60269.076 .000 26051.389 2 13025.694 199.119 .000 1056.250 1 1056.250 16.146 .000 804.167 2 402.083 6.146 .006 1962.500 30 65.417 23657575.0 36 Source Model size type size * type Error Total R Squared = 1.000 (Adjusted a. R Squared = 1.000)  SIZE effect is still significant  TYPE effect is significant when size is controlled  INTERACTION effect is significant • There is a combination which shows more than the combined impact of SIZE and TYPE
  • 26.
    Means of eachcombination of Size & Type INTERACTION: Whenever lines not parallel
  • 27.
    Manufacturers of thenew Octel noise filter claim that it reduces noise levels in cars of all sizes. In a Two-Way ANOVA, this claim proved to be true. The Size of Car effect was significant (F(2,36) = 199.119, p < .001). When the impact of size was controlled, the Filter Type effect was also significant (F(1,36) = 16.146, p < .001), with the Octel Filter having lower noise levels than standard filters. The Interaction effect was also significant (F(2,30) = 6.146, p = .006). For Small cars, the noise difference between filter types was 3.33; for Large cars it was 5.000, but Midsize cars with the Octel filter averaged 24.166 points lower on the Noise Level scale. A complete report would include the Mean and SD of each cell where a significant difference occurred, either in a table or in narrative. It would include effect size (η2) for significant effects.
  • 28.
     A tableor graph of group means  A report of the three hypothesis tests: • One for Factor A • One for Factor B • One for the interaction of A with B  Asterisks often used to report hypothesis test results * = significant with alpha = .05 ** = significant with alpha = .01 *** = significant with alpha = .001  If there are more than two factors, there will be more hypothesis tests for factors, and more interactions.
  • 29.
    Total Variability Between Treatments Factor A Factor B Interaction Within Treatments
  • 30.
     Three distincttests • Main effect of Factor A • Main effect of Factor B • Interaction of A and B  A separate F test is conducted for each
  • 31.
    Notation describes procedure Tables usually used to present the results Group means (cell) Row means Column means Each factor is operationalized by one or more variables (measures) Images from Trochim’s Research Methods Knowledge Base at http://www.socialresearchmethods.net/kb/index.php
  • 32.
     Plot themeans of each group (defined as a combination of Factor 1 and Factor 2)  If all the null hypotheses are true, all the points will have about the same Mean Outcome level.
  • 33.
     The tworow means are the same  The two column means are the same  All groups have the same mean score  Neither factor had any effect Images from Trochim’s Research Methods Knowledge Base at http://www.socialresearchmethods.net/kb/index.php
  • 34.
     Row means:the same  Column means: differ  No score especially high or especially low  Row means: differ  Column means: the same  No score especially high or especially low Images from Trochim’s Research Methods Knowledge Base at http://www.socialresearchmethods.net/kb/index.php
  • 35.
     The meandifferences between individuals treatment conditions, or cells, are different from what would be predicted from the overall main effects of the factors  H0: There is no interaction between Factors A and B  H1: There is an interaction between Factors A and B
  • 36.
     Row meansdiffer  Column means differ  One group is different  Others are the same  Row means the same  Column means the same  Graph shows that pattern in one factor depends on the status of the other Images from Trochim’s Research Methods Knowledge Base at http://www.socialresearchmethods.net/kb/index.php
  • 37.
     Dependence offactors • The effect of one factor depends on the level or value of the other  Non-parallel lines (cross or converge) in a graph • Indicate interaction is occurring  Typically called the A x B interaction
  • 38.
    Total Variability Between Treatments Factor A Factor B Interaction Within Treatments
  • 39.
    We will computeproblems by hand to gain understanding, but not on a test
  • 40.
    G N SSX total 2 2   2 2 G N T    n SS between treatments  withintreatments inside each treatment SS SS
  • 41.
    Total Variability Between Treatments Factor A Factor B Interaction Within Treatments
  • 42.
    dftotal = N– 1 dfwithin treatments = Σdfinside each treatment dfbetween treatments = k – 1 dfA = number of rows – 1 dfB = number of columns– 1 dfAxB = dfbetween treatments – dfA – dfB
  • 43.
    B SS SS MS    A df within treatments SS within treatments A MS  within treatments df AxB AxB AxB B B A SS MS df MS df AxB within MS MS F    A AxB MS B within B A within MS F MS F MS
  • 44.
     η2, iscomputed as the percentage of variability not explained by other factors. A SS A SS SS A within treatments A total B AxB SS SS SS SS      2  B SS B SS SS B within treatments B total A AxB SS SS SS SS      2  AxB SS AxB SS SS AxB within treatments AxB total A B SS SS SS SS      2 
  • 45.