Sei sulla pagina 1di 23

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 Repeated ANOVA


between-subject ANOVA within-subject ANOVA
F-test F-test

Factors
Levels
K1 x K2 ANOVA
Two Factors
with K1 levels of one factor and
K2 level of the second factor
Two-way ANOVA 2 x 2 repeated
2 x 2 ANOVA measurement ANOVA
Factor A Factor A

Level Level Level Level


1 2 1 2
Level 1 Group Group Level 1 Subj. Subj.
Factor B 1 2 1….12 1….12
Factor B
Level Group Group Level Subj. Subj.
2 3 4 2 1….12 1….12

Mixed Design
Factor A
Within-subject Factor
Drug Placebo
Imaging
Patient Subj. Subj. Designs
Factor B
1…12 1…12
Between-subject
Factor Control Subj. Subj.
13...24 13...24
2 x 2 ANOVA 2 x 2 repeated
measurement ANOVA
Factor A
Fearful Neutral Factor A

Fearful Neutral

Main Effect B
Factor B

Implicit Group Group


1 2 Implicit Subj. Subj.

Factor B
Explicit Group Group 1….12 1….12
3 4 Explicit Subj. Subj.
1….12 1….12

Main Effect A
Interaction A X B
3 x 2 ANOVA Fearful

Fearful Neutral Happy

Implicit

Neutral
Explicit

Implicit Explicit
Contrasts
One-way between-subject
ANOVA

An individual score is specified by

X ij     j   ij

  Grand mean
 j  j  Treatment effect

 ij  X ij   j 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 Error


(SStreat) (SSerror)

SStreat / DFtreat
F
SSerror / DFerror

SStotal  SStreat  SSerror

DFtotal  DFtreat  DFerror


One-way ANOVA between subjects 1.
A i
10  15  35  20
G i G 4
1st levels betas from one voxel in amygdala n* p 20
____________________________________

4-different drug treatments (Factor A with p levels)


____________________________________
2. SStot    (x
i m
mi  G)2
1 2 3 4 df tot  n * p  1
____________________________________ (2  4) 2  (1  4) 2 ..
2 3 6 5
1 4 8 5
3 3 7 5 3. SStreat   n * ( Ai  G ) 2
3 5 4 3 i
1 0 10 2 df treat  p  1
_____________________________________
Sums(Ai) 10 15 35 20 5 * (2  4) 2  5 * (3  4) 2 ..
_____________________________________
Means(Ai) 2 3 7 4 4. SS error    (x mi  Ai ) 2
i m
_____________________________________ df error  p * (n  1)
One factor with p levels; i = 1…4 (2  2) 2  (1  2) 2 ..
M subjects with n subjects per level
Number of total observations = 20 SStreat / DFtreat
5.
F
SSerror / DFerror
One way ANOVA Multiple Regression
Do the drug treatment affect differently Do the drug treatments relate to the mean
mean activation in the amygdala ? activation in the amygdala?
____________________________________
Drug treatment (Factor A with p levels) 1st level Drug
betas treatments
____________________________________
1 2 3 4 2 1 1
____________________________________ 1 1 1
2 3 6 5 3 1 1
1 4 8 5 3 1 1
3 3 7 5 1 1 1
3 5 4 3 3 2 1
1 0 10 2 4 2 1
3 2 1
Dependent variable = 1st level betas extracted from 5 2 1
the amygdala 0 2 1
6 3 1
8 3 1
7 3 1
4 3 1
10 3 1
5 4 1
5 4 1
5 4 1
3 4 1
2 4 1

y = aX + b
One way ANOVA Multiple Regression
Do the drug treatment affect differently Do the drug treatments relate to the mean
mean activation in the amygdala ? activation in the amygdala?
____________________________________
Drug treatment (Factor A with p levels) 1st level Drug treatments
betas
____________________________________
1 2 3 4 2 1 0 0 0 1
____________________________________ 1 1 0 0 0 1
2 3 6 5 3 1 0 0 0 1
1 4 8 5 3 1 0 0 0 1
3 3 7 5 1 1 0 0 0 1
3 5 4 3 3 0 1 0 0 1
1 0 10 2 4 0 1 0 0 1
3 0 1 0 0 1
Dependent variable = 1st level betas extracted from 5 0 1 0 0 1
the amygdala 0 0 1 0 0 1
6 0 0 1 0 1
8 0 0 1 0 1
7 0 0 1 0 1
4 0 0 1 0 1
10 0 0 1 0 1
5 0 0 0 1 1
5 0 0 0 1 1
5 0 0 0 1 1
3 0 0 0 1 1
2 0 0 0 1 1

y x1 x2 x3 x4
One way ANOVA Multiple Regression
Do the drug treatment affect differently Do the drug treatments relate to the mean
mean activation in the amygdala ? activation in the amygdala?
____________________________________
Drug treatment (Factor A with p levels) 1st level Drug treatments
betas
____________________________________
1 2 3 4 2 1 0 0 0 1
____________________________________ 1 1 0 0 0 1
2 3 6 5 3 1 0 0 0 1
1 4 8 5 3 1 0 0 0 1
3 3 7 5 1 1 0 0 0 1
3 5 4 3 3 0 1 0 0 1
1 0 10 2 4 0 1 0 0 1
3 0 1 0 0 1
Dependent variable = 1st level betas extracted from 5 0 1 0 0 1
the amygdala 0 0 1 0 0 1
6 0 0 1 0 1
8 0 0 1 0 1
7 0 0 1 0 1
4 0 0 1 0 1
10 0 0 1 0 1
5 0 0 0 1 1
5 0 0 0 1 1
5 0 0 0 1 1
3 0 0 0 1 1
2 0 0 0 1 1

Y = b1x1+b2x2+b3x3+b4x4 + b0
One way ANOVA Multiple Regression
Do the drug treatment affect differently Do the drug treatments relate to the mean
mean activation in the amygdala ? activation in the amygdala?
____________________________________
Teaching Methods (Factor A with p levels)
____________________________________
1 0 0 0 1 e11
1 2 3 4
1 0 0 0 1 e21
____________________________________
1 0 0 0 1 e31
2 3 6 5
1 0 0 0 1 e41
1 4 8 5
1 0 0 0 1 e51
3 3 7 5
0 1 0 0 1 e12
3 5 4 3
0 1 0 0 1 b1 .
0 1 0 0 1 .
1 0 10 2
0 1 0 0 1 b2 .
0 1 0 0 1 .
Dependent variable = reading score
y= +
0
0
0
0
0
0
1
1
1
0
0
0
1
1
1
* b3 .
.
.
0 0 1 0 1 b4 .
0 0 1 0 1 .
0 0 0 1 1 b0 .
0 0 0 1 1 .
0 0 0 1 1 .
0 0 0 1 1 e44
0 0 0 1 1 e54

X ij     j   ij y  b1 X 1  b 2 X 2  b3 X 3  b 4 X 4  b0  e
  b 0;
j  bj
Repeated ANOVA
Repeated Measures
Single Measures

Two-sample t-test Paired-sample-t-test

ANOVA Repeated ANOVA


between-subject ANOVA within-subject ANOVA
F-test F-test
Drug 1 Drug 2 Drug 3 Placebo
Drug 1 Drug 2 Drug 3 Placebo

Subj.1 Subj.1 Subj.1 Subj.1


Group 1 Group2 Group3 Group4 Subj. 2 Subj. 2 Subj. 2 Subj. 2
Subj. 3 Subj. 3 Subj. 3 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 An individual score is specified by

X ij     j   ij X ij     i   j   ij

  Grand mean   Grand mean


 j  j   i  Subject effect
 j  Treatment
Treatment effect
effect

 ij  X ij   j Residual error (within-subject effect)

 ij  Residual error
Partitions of Sums of Squares
Total Variation (SStotal)
Total Variation (SStotal)

Within subj. Between subj


Treatment effect Error
(SSwithin) (SSbetween)
(SStreat) (SSerror) Subject effects

Treatment effect Residual


(SStreat) (SSres)

Subj. x Treat & Error

SStreat / DFtreat SStreat / DFtreat


F F
SSerror / DFerror SS residual / DFerror

SStotal  SStreat  SSerror SStotal  SSbetween  SStreat  SSresidual


DFtotal  DFtreat  DFerror DFtotal  DFbetween  DFtreatment  DFresidual
Between Subjects Within subjects
1 2 3 4
Drug 1 Drug 2 Drug3 Placebo

1 0 0 0 1 e11 1 0 0 0 1 e11 10000 1


1 0 0 0 1 e21 1 0 0 0 1 e21 01000
1 0 0 0 1 e31 1 0 0 0 1 e31 00100 2
1 0 0 0 1 e41 1 0 0 0 1 e41 00010
1 0 0 0 1 e51 1 0 0 0 1 e51 00001
3
0 1 0 0 1
b1 e12 0 1 0 0 1
b1 e12 10000
0 1 0 0 1 . 0 1 0 0 1 . 01000
0 1 0 0 1 . 0 1 0 0 1 . 00100 4
0 1 0 0 1 b2 . 0 1 0 0 1 b2 . 00010
0 1 0 0 1 . 0 1 0 0 1 . 00001 5
y= + y= + +
0
0
0
0
1
1
0
0
1
1 * b3 .
.
0
0
0
0
1
1
0
0
1
1 * b3 .
.
10000
01000
0 0 1 0 1 b4 . 0 0 1 0 1 b4 . 00100
0 0 1 0 1 . 0 0 1 0 1 . 00010
0 0 1 0 1 . 0 0 1 0 1 . 00001
0 0 0 1 1
b0 . 0 0 0 1 1
b0 . 10000
0 0 0 1 1 . 0 0 0 1 1 . 01000
0 0 0 1 1 . 0 0 0 1 1 . 00100
0 0 0 1 1 e44 0 0 0 1 1 e44 00010
0 0 0 1 1 e54 0 0 0 1 1 e54 00001

y  b1 X 1  b 2 X 2  b3 X 3  b 4 X 4  b0  e y  b1 X 1  b 2 X 2  b3 X 3  b 4 X 4  b0    e

X ij     j   ij j  j X ij     i   j   ij
Between Subjects Within subjects
1 2 3 4
Drug 1 Drug 2 Drug3 Placebo

1 0 0 0 1 1 0 0 0 1 1 0 0 0 0
1 0 0 0 1 1 0 0 0 1 0 1 0 0 0
1 0 0 0 1 1 0 0 0 1 0 0 1 0 0
1 0 0 0 1 1 0 0 0 1 0 0 0 1 0
1 0 0 0 1 1 0 0 0 1 0 0 0 0 0
0 1 0 0 1 0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 1 0 0 1 0 0 0 0 0
0 0 1 0 1 0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 1 0 1 0 0 0 0 0
0 0 0 1 1 0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 1 1 0 0 0 0 0

y  b1 X 1  b 2 X 2  b3 X 3  b 4 X 4  b0  e y  b1 X 1  b 2 X 2  b3 X 3  b 4 X 4  b0    e

X ij     j   ij j  j X ij     i   j   ij
2 x 2 Repeated Measurement ANOVA
Factor A
Level Level
1 2
Level Subj. Subj.
Factor B 1 1….12 1….12
Level Subj. Subj.
2 1….12 1….12

Pooled Error

X ijk   i      
A
j
B
k
AB
jk   ijk
Interaction between
Partitioned Error effect and subject

X ijk   i      
A
j
B
k
AB
jk   
A
ij
B
ik
AB
ijk
Within-Subjects Two-Way ANOVA
1 2 3 4
Fear-implicit neutral-implicit fear-explicit neutral-explicit

1 0 0 0 1 1 0 0 0 0
1 0 0 0 1 0 1 0 0 0
1 0 0 0 1 0 0 1 0 0
1 0 0 0 1 0 0 0 1 0
1 0 0 0 1 0 0 0 0 0
0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 0 0 0 0
0 1 0 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0

y  b1 X 1  b 2 X 2  b3 X 3  b 4 X 4  b0    e

X ij     i   j   ij
Repeated Measurement
ANOVA in SPM

Pooled errors

One way ANOVA = 1st level betas 2nd level + subjects effects

Partitioned errors

Two way ANOVA = 1st level 2nd level (T-test for 2x2 ANOVA
differential effects between F-test for 3x3 ANOVA)
levels of a factors
for main effects

differences of differential
effects for interactions
What contrast to take from 1st level?
Two way ANOVA (2*2) with repeated measured
Factor A

Fearful Neutral

Implicit
Factor B

Explicit
Fear/ Fear/ Neutral/ Neutral/
implicit explicit implicit explicit
What contrast to take from 1st level?
Two way ANOVA (3*3) with repeated measured
Factor A
semantic perception Imagery

Picture
Factor B

Words

Sounds

Potrebbero piacerti anche