Analysis of Variance - University College London

Download Report

Transcript Analysis of Variance - University College London

SPSS meets SPM
All about Analysis of Variance
• Introduction and definition of terms
• One-way between-subject ANOVA: An example
• One-way repeated measurement ANOVA
• Two-way repeated measurement ANOVA:
•
Pooled and partitioned errors
• How to specify appropriate contrasts to test main effects
and interactions
SPSS
meets
SPM
Analysis of Variance
Single Measures
Repeated Measures
Two-sample t-test
Paired-sample-t-test
ANOVA
between-subject ANOVA
F-test
Repeated ANOVA
within-subject ANOVA
F-test
Factors
Levels
K1 x K2 ANOVA
Two Factors
with K1 levels of one factor and
K2 level of the second factor
2 x 2 repeated
measurement ANOVA
Two-way ANOVA
2 x 2 ANOVA
Factor A
Factor A
Level 1
Factor B
Level
2
Level
1
Level
2
Group
1
Group
2
Group
3
Group
4
Level
1
Level
2
Level 1
Subj.
1….12
Subj.
1….12
Level
2
Subj.
1….12
Subj.
1….12
Factor B
Mixed Design
Factor A
Within-subject Factor
Drug
Factor B
Between-subject
Factor
Placebo
Patient
Subj.
1…12
Subj.
1…12
Control
Subj.
13...24
Subj.
13...24
Imaging
Designs
2 x 2 repeated
measurement ANOVA
2 x 2 ANOVA
Factor A
Explicit
Group
1
Group
2
Group
3
Group
4
Factor B
Implicit
Factor A
Neutral
Main Effect B
Factor B
Fearful
Fearful
Neutral
Implicit
Subj.
1….12
Subj.
1….12
Explicit
Subj.
1….12
Subj.
1….12
Main Effect A
Interaction A X B
3 x 2 ANOVA
Fearful
Neutral
Fearful
Happy
Implicit
Neutral
Explicit
Implicit
Contrasts
Explicit
One-way between-subject
ANOVA
An individual score is specified by
X ij    j   ij
  Grand mean
 j  j  
 ij  X ij   j
Treatment effect
Residual error
General Principle of
ANOVA
FULL MODEL
X ij    j   ij
REDUCED MODEL
X ij     ij
Data represent a random variation around the grand mean
Is the full model a significantly better model
then the reduced model?
Partitions of Sums of Squares
Total Variation (SStotal)
Treatment effect
(SStreat)
F
Error
(SSerror)
SStreat / DFtreat
SSerror / DFerror
SStotal  SStreat  SSerror
DFtotal  DFtreat  DFerror
One-way ANOVA between subjects
1st levels betas from one voxel in amygdala
1.
G
A
i
G
i
n* p
10  15  35  20
4
20
____________________________________
4-different drug treatments (Factor A with p levels)
____________________________________
1
2
3
4
____________________________________
2
3
6
5
1
4
8
5
3
3
7
5
3
5
4
3
1
0
10
2
_____________________________________
Sums(Ai) 10
15
35
20
_____________________________________
Means(Ai) 2
3
7
4
2. SStot 
 (x
mi
i
m
dftot  n * p 1
3.
(2  4)2  (1  4)2 ..
SStreat   n * ( Ai  G) 2
i
dftreat  p  1
5 * (2  4)2  5 * (3  4)2 ..
4.
SSerror  
i
(x
mi
 Ai ) 2
m
dferror  p * (n 1)
_____________________________________
One factor with p levels; i = 1…4
M subjects with n subjects per level
Number of total observations = 20
 G) 2
(2  2)2  (1  2)2 ..
5.
SStreat / DFtreat
F
SSerror / DFerror
One way ANOVA
Do the drug treatment affect differently
mean activation in the amygdala ?
____________________________________
Drug treatment (Factor A with p levels)
____________________________________
1
2
3
4
____________________________________
2
3
6
5
1
4
8
5
3
3
7
5
3
5
4
3
1
0
10
2
Dependent variable = 1st level betas extracted from
the amygdala
Multiple Regression
Do the drug treatments relate to the mean
activation in the amygdala?
1st level
betas
Drug
treatments
2
1
3
3
1
3
4
3
5
0
6
8
7
4
10
5
5
5
3
2
1
1
1
1
1
2
2
2
2
2
3
3
3
3
3
4
4
4
4
4
y
= aX
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
+
b
One way ANOVA
Multiple Regression
Do the drug treatment affect differently
mean activation in the amygdala ?
____________________________________
Drug treatment (Factor A with p levels)
____________________________________
1
2
3
4
____________________________________
2
3
6
5
1
4
8
5
3
3
7
5
3
5
4
3
1
0
10
2
Dependent variable = 1st level betas extracted from
the amygdala
Do the drug treatments relate to the mean
activation in the amygdala?
1st level
betas
2
1
3
3
1
3
4
3
5
0
6
8
7
4
10
5
5
5
3
2
y
Drug treatments
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
x1 x2 x3 x4
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
One way ANOVA
Multiple Regression
Do the drug treatment affect differently
mean activation in the amygdala ?
____________________________________
Drug treatment (Factor A with p levels)
____________________________________
1
2
3
4
____________________________________
2
3
6
5
1
4
8
5
3
3
7
5
3
5
4
3
1
0
10
2
Dependent variable = 1st level betas extracted from
the amygdala
Do the drug treatments relate to the mean
activation in the amygdala?
1st level
betas
2
1
3
3
1
3
4
3
5
0
6
8
7
4
10
5
5
5
3
2
Y
Drug treatments
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
=
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
b1x1+b2x2+b3x3+b4x4 + b0
Multiple Regression
One way ANOVA
Do the drug treatment affect differently
mean activation in the amygdala ?
Do the drug treatments relate to the mean
activation in the amygdala?
____________________________________
Teaching Methods (Factor A with p levels)
____________________________________
1
2
3
4
____________________________________
2
3
6
5
1
4
8
5
3
3
7
5
3
5
4
3
1
0
10
2
y=
Dependent variable = reading score
X ij    j   ij
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
e11
e21
e31
e41
e51
e12
b1
b2
*
b3
b4
b0
+
.
.
.
.
.
.
.
.
.
.
.
.
44
54
e
e
y  b1 X 1  b2 X 2  b3 X 3  b4 X 4  b0  e
  b 0;
j  bj
Repeated ANOVA
Single Measures
Two-sample t-test
ANOVA
between-subject ANOVA
F-test
Drug 1
Drug 2
Drug 3
Placebo
Group 1
Group2
Group3
Group4
Repeated Measures
Paired-sample-t-test
Repeated ANOVA
within-subject ANOVA
F-test
Drug 1
Drug 2
Drug 3
Placebo
Subj.1
Subj. 2
Subj. 3
….
Subj.1
Subj. 2
Subj. 3
….
Subj.1
Subj. 2
Subj. 3
….
Subj.1
Subj. 2
Subj. 3
…..
Assumptions
Assumptions
• Homogeneity of Variance
• Homogeneity of Variance
• Normality
• Homogeneity of Correlations
• Independence of observations
• Normality
One-way between-subject
One-way within-subject
ANOVA
ANOVA
An individual score is specified by
X ij    j   ij
  Grand mean
 j   j   Treatment effect
 ij  X ij   j Residual error
An individual score is specified by
X ij     i   j   ij
  Grand mean
 i  Subject effect
effect
 j  Treatment
(within-subject effect)
 ij  Residual error
Partitions of Sums of Squares
Total Variation (SStotal)
Treatment effect
(SStreat)
Error
(SSerror)
Total Variation (SStotal)
Within subj.
(SSwithin)
Between subj
(SSbetween)
Subject effects
Treatment effect
(SStreat)
Residual
(SSres)
Subj. x Treat & Error
F
SStreat / DFtreat
SSerror / DFerror
SStotal  SStreat  SSerror
DFtotal  DFtreat  DFerror
F
SStreat / DFtreat
SSresidual / DFerror
SStotal  SSbetween  SStreat  SSresidual
DFtotal  DFbetween  DFtreatment  DFresidual
Between Subjects
y=
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
Within subjects
1
2
3
4
Drug 1
Drug 2
Drug3
Placebo
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
e11
e21
e31
e41
e51
e12
b1
b2
*
b3
+
b4
b0
.
.
.
.
.
.
.
.
.
.
.
.
44
54
y=
e
e
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
e11
e21
e31
e41
e51
e12
b1
b2
*
b3
b4
b0
+
.
.
.
.
.
.
.
.
.
.
.
.
44
54
e
e
+
10000
01000
00100
00010
00001
10000
01000
00100
00010
00001
10000
01000
00100
00010
00001
10000
01000
00100
00010
00001
y  b1 X 1  b2 X 2  b3 X 3  b4 X 4  b0    e
y  b1 X 1  b2 X 2  b3 X 3  b4 X 4  b0  e
X ij    j   ij
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
j  j
X ij     i   j   ij
1
2
3
4
5
Between Subjects
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
Within subjects
1
2
3
4
Drug 1
Drug 2
Drug3
Placebo
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
y  b1 X 1  b2 X 2  b3 X 3  b4 X 4  b0  e
X ij    j   ij
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
y  b1 X 1  b2 X 2  b3 X 3  b4 X 4  b0    e
j  j
X ij     i   j   ij
2 x 2 Repeated Measurement ANOVA
Factor A
Factor B
Level
1
Level
2
Level
1
Subj.
1….12
Subj.
1….12
Level
2
Subj.
1….12
Subj.
1….12
Pooled Error
X ijk   i   
A
j
B
k
AB
jk
Interaction between
effect and subject
Partitioned Error
X ijk   i   
A
j
B
k
AB
jk
  ijk
  
A
ij
B
ik
AB
ijk
Within-Subjects Two-Way ANOVA
1
2
3
4
Fear-implicit neutral-implicit fear-explicit neutral-explicit
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
y  b1 X 1  b2 X 2  b3 X 3  b4 X 4  b0    e
X ij     i   j   ij
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Repeated Measurement
ANOVA in SPM
Pooled errors
One way ANOVA = 1st level betas
2nd level + subjects effects
Partitioned errors
Two way ANOVA = 1st level
differential effects between
levels of a factors
for main effects
differences of differential
effects for interactions
2nd level (T-test for 2x2 ANOVA
F-test for 3x3 ANOVA)
What contrast to take from 1st level?
Two way ANOVA (2*2) with repeated measured
Factor A
Factor B
Fearful
Neutral
Implicit
Explicit
Fear/
implicit
Fear/
explicit
Neutral/
implicit
Neutral/
explicit
What contrast to take from 1st level?
Two way ANOVA (3*3) with repeated measured
Factor A
semantic
Factor B
Picture
Words
Sounds
perception
Imagery