Analysis of Variance (ANOVA) Developing Study Skills and Research Methods (HL20107) Dr James Betts
Mar 28, 2015
Analysis of Variance (ANOVA)
Developing Study Skills and Research Methods (HL20107)
Dr James Betts
Lecture Outline:
•Multiple Comparisons and Type I Errors
•1-way ANOVA for Unpaired data
•1-way ANOVA for Paired Data
•Factorial Research Designs.
Tim
e to
Fat
igu
e (m
in)
0
20
40
60
80
100
120
140
PlaceboGlucose
Chryssanthopoulos et al. (1994)
MalesFemales
Tim
e to
Fat
igu
e (m
in)
0
20
40
60
80
100
120 PlaceboLGIHGIGlucose
Thomas et al. (1991)
*
*P <0.05 vs. Placebo, HGI & Glucose
PlaceboLucozade
Tim
e to
Fat
igu
e (m
in)
0
20
40
60
80
100
120 PlaceboLGIHGIGlucose
Thomas et al. (1991)
*
*P <0.05 vs. Placebo, HGI & Glucose
PlaceboLucozadeGatoradePowerade
PlaceboLucozadeGatoradePowerade
Tim
e to
Fat
igu
e (m
in)
0
20
40
60
80
100
120 PlaceboLGIHGIGlucose
Thomas et al. (1991)
*
*P <0.05 vs. Placebo, HGI & Glucose
PlaceboLucozadeGatoradePowerade
PlaceboLucozadeGatoradePowerade
What is Analysis of Variance?• ANOVA is an inferential test designed for use with 3 or
more data sets
• t-tests are just a form of ANOVA for 2 groups
• ANOVA only interested in establishing the existence of a statistical differences, not their direction (last slide)
• Based upon an F value (R. A. Fisher) which reflects the ratio between systematic and random/error variance…
Total Variance between means
SystematicVariance
ErrorVariance
Dependent Variable
Extraneous/Confounding
(Error) Variables
Independent Variable
Group AGroup BGroup C
Group BGroup C
Group A
Procedure for computing 1-way ANOVA for independent samples
• Step 1: Complete the tablei.e.
-square each raw score
-total the raw scores for each group
-total the squared scores for each group.
Procedure for computing 1-way ANOVA for independent samples
• Step 2: Calculate the Grand Total correction factor
GT =
=
(X)2
N
(XA+XB+XC)2
N
Procedure for computing 1-way ANOVA for independent samples
• Step 3: Compute total Sum of Squares
SStotal= X2 - GT
= (XA2+XB
2+XC2) - GT
Procedure for computing 1-way ANOVA for independent samples
• Step 4: Compute between groups Sum of Squares
SSbet= - GT
= + + - GT
(X)2
n
(XA)2
nA
(XB)2
nB
(XC)2
nC
Procedure for computing 1-way ANOVA for independent samples
• Step 5: Compute within groups Sum of Squares
SSwit= SStotal - SSbet
Procedure for computing 1-way ANOVA for independent samples
• Step 6: Determine the d.f. for each sum of squares
dftotal= (N - 1)
dfbet= (k - 1)
dfwit= (N - k)
SystematicVariance
(between means)
ErrorVariance
(within means)
Procedure for computing 1-way ANOVA for independent samples
• Step 7/8: Estimate the Variances & Compute F
=
=
SSbet
dfbet
SSwit
dfwit
Procedure for computing 1-way ANOVA for independent samples
• Step 9: Consult F distribution table -d1 is your df for the numerator (i.e. systematic variance)
-d2 is your df for the denominator (i.e. error variance)
ANOVA
VAR00001
.152 2 .076 .147 .865
4.635 9 .515
4.787 11
Between Groups
Within Groups
Total
Sum ofSquares df Mean Square F Sig.
Independent 1-way ANOVA: SPSS Output
Group BGroup C
Group ATrial 2Trial 3
Trial 1
Procedure for computing 1-way ANOVA for paired samples
• Step 1: Complete the tablei.e.
-square each raw score
-total the raw scores for each trial & subject
-total the squared scores for each trial & subject.
Procedure for computing 1-way ANOVA for paired samples
• Step 2: Calculate the Grand Total correction factor
GT =
=
= = 54.6
(X)2
N
(X1+X2+X3)2
N
(8+8.5+9.1)2
12…so GT just as
with unpaired data
Procedure for computing 1-way ANOVA for paired samples
• Step 3: Compute total Sum of Squares
SStotal= X2 - GT
= (X12+X2
2+X32) - GT
Procedure for computing 1-way ANOVA for paired samples
• Step 4: Compute between trials Sum of Squares
SSbetT= - GT
= + + - GT
(XT)2
nT
(X1)2
n1
(X2)2
n2
(X3)2
n3
Procedure for computing 1-way ANOVA for paired samples
• Step 5: Compute between subjects Sum of Squares
SSbetS= - GT
= + + + - GT
(XS)2
nT
(XT)2
nT
(XD)2
nD
(XH)2
nH
(XJ)2
nJ
Procedure for computing 1-way ANOVA for paired samples
• Step 6: Compute interaction Sum of Squares
SSint= SStotal - (SSbetT + SSbetS)
Procedure for computing 1-way ANOVA for paired samples
• Step 7: Determine the d.f. for each sum of squares
dftotal= (N - 1)
dfbetT= (k - 1)
dfbetS= (r - 1)
dfint= (r-1)(k-1) = dfbetT x dfbetS
• Step 8/9: Estimate the Variances & Compute F values
=
=
=
SystematicVariance
(between trials IV)
ErrorVariance
Procedure for computing 1-way ANOVA for paired samples
SSbetT
dfbetT
SSint
dfint
SSbetS
dfbetS
Systematic Variance
(between subjects)
Procedure for computing 1-way ANOVA for paired samples
• Step 10: Consult F distribution table as before
Tests of Within-Subjects Effects
Measure: MEASURE_1
.152 2 .076 .840 .477
.152 1.183 .128 .840 .439
.152 1.505 .101 .840 .457
.152 1.000 .152 .840 .427
.542 6 .090
.542 3.550 .153
.542 4.514 .120
.542 3.000 .181
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-bound
Sourcefactor1
Error(factor1)
Type III Sumof Squares df Mean Square F Sig.
Paired 1-way ANOVA: SPSS Output
• Next week we will continue to work through some examples of 2-way ANOVA (i.e. factorial designs)
• However, you will come across 2-way ANOVA in this week’s lab class so there are a few terms & concepts that you should be aware of in advance...
Introduction to 2-way ANOVA
Factorial Designs: Technical Terms• Factor
• Levels
• Main Effect
• Interaction Effect
Factorial Designs: Multiple IV’s• Hypothesis:
– The HR response to exercise is mediated by gender
• We now have three questions to answer:
1)
2)
3)
Post Run 1 Pre Run 2 Post Run 2
Mu
scle
Gly
cogen
(mm
ol
glu
cosy
l u
nit
s. k
g d
m-1)
0
50
100
150
200
250
300
350
CHO CHO-PRO
Factorial Designs: Interpretation210
180
150
120
90
60
30
0
Hea
rt R
ate
(bea
tsm
in-1)
Resting Exercise
Main Effect of Exercise
Not significant
Main Effect of Gender
Not significant
Exercise*Gender Interaction
Not significant
Post Run 1 Pre Run 2 Post Run 2
Mu
scle
Gly
cogen
(mm
ol
glu
cosy
l u
nit
s. k
g d
m-1)
0
50
100
150
200
250
300
350
CHO CHO-PRO
Factorial Designs: Interpretation210
180
150
120
90
60
30
0
Hea
rt R
ate
(bea
tsm
in-1)
Resting Exercise
Main Effect of Exercise
Significant
Main Effect of Gender
Not significant
Exercise*Gender Interaction
Not significant
Post Run 1 Pre Run 2 Post Run 2
Mu
scle
Gly
cogen
(mm
ol
glu
cosy
l u
nit
s. k
g d
m-1)
0
50
100
150
200
250
300
350
CHO CHO-PRO
Factorial Designs: Interpretation210
180
150
120
90
60
30
0
Hea
rt R
ate
(bea
tsm
in-1)
Resting Exercise
Main Effect of Exercise
Not significant
Main Effect of Gender
Significant
Exercise*Gender Interaction
Not significant
Post Run 1 Pre Run 2 Post Run 2
Mu
scle
Gly
cogen
(mm
ol
glu
cosy
l u
nit
s. k
g d
m-1)
0
50
100
150
200
250
300
350
CHO CHO-PRO
Factorial Designs: Interpretation210
180
150
120
90
60
30
0
Hea
rt R
ate
(bea
tsm
in-1)
Resting Exercise
Main Effect of Exercise
Not significant
Main Effect of Gender
Not Significant
Exercise*Gender Interaction
Significant
Post Run 1 Pre Run 2 Post Run 2
Mu
scle
Gly
cogen
(mm
ol
glu
cosy
l u
nit
s. k
g d
m-1)
0
50
100
150
200
250
300
350
CHO CHO-PRO
Factorial Designs: Interpretation210
180
150
120
90
60
30
0
Hea
rt R
ate
(bea
tsm
in-1)
Resting Exercise
Main Effect of Exercise
Main Effect of Gender
Exercise*Gender Interaction
?
Post Run 1 Pre Run 2 Post Run 2
Mu
scle
Gly
cogen
(mm
ol
glu
cosy
l u
nit
s. k
g d
m-1)
0
50
100
150
200
250
300
350
CHO CHO-PRO
Factorial Designs: Interpretation210
180
150
120
90
60
30
0
Hea
rt R
ate
(bea
tsm
in-1)
Resting Exercise
Main Effect of Exercise
Main Effect of Gender
Exercise*Gender Interaction
?
SystematicVariance
(resting vs exercise)
ErrorVariance
(between subjects)
Systematic Variance
(male vs female)
Systematic Variance
(Interaction)
2-way mixed model ANOVA: Partitioning
= variance between means due to
= variance between means due to
= variance between means due to
= uncontrolled factors and within group differences for males vs females.
ErrorVariance
(within subjects)= uncontrolled factors plus random changes within individuals for rest vs exercise
SystematicVariance
(resting vs exercise)
Systematic Variance
(male vs female)Systematic
Variance(Interaction)
ErrorVariance
(within subjects)
2-way mixed model ANOVA
So for a fully unpaired design
– e.g. males vs females
&
rest group vs exercise group
…between subject variance (i.e. SD) has a negative impact upon all contrasts
ErrorVariance
(between subjects)
SystematicVariance
(resting vs exercise)
Systematic Variance
(am vs pm)Systematic
Variance(Interaction)
Error Variance
(within subjectsexercise)
2-way mixed model ANOVA
…but for a fully paired design
– e.g. morning vs evening
&
rest vs exercise
…between subject variance (i.e. SD) can be removed
from all contrasts.
Error Variance
(within subjectstime)Error Variance
(within subjectsinteract)
Refer back to this ‘partitioning’ in your lab class