Professional Documents
Culture Documents
ANOVA
& Interactions
Two-way ANOVA and
interactions
• Thinking about interactions
– Types of interactions
• Calculating and interpreting 2-way
ANOVAs
Good Samaritan Study
• How do situational variables affect
helping behavior?
– Darley & Batson (1973) recruited seminary
students and told them they were to
prepare a talk on either seminary jobs or
about the story of the Good Samaritan
– They then told subjects they were either
“fine” on time (low hurry), barely on time
(medium hurry), or running late (high
hurry)
– On the way to give the talk, they encounter
a man slumped in an alleyway
• Who helps?
The Good Samaritan Study
• What type of study design is this?
The Good Samaritan Study
• What type of study design is this?
– Two manipulations (IV’s)
• Topic of talk (2 conditions: seminary jobs or
Good Samaritan story)
• Hurriedness (3 conditions: low, medium,
and high)
The Good Samaritan Study
• What type of study design is this?
– Two manipulations (IV’s)
• Topic of talk (2 conditions: seminary jobs or
Good Samaritan story)
• Hurriedness (3 conditions: low, medium,
and high)
– 2x3 factorial design
• Can use a 2x3 ANOVA
• E.g., a two-way ANOVA with
– 2 levels of first IV
– 3 levels of second IV
The Good Samaritan Study
• What might be the prediction here?
– Hurriedness affects helping behavior,
such that people are less likely to help
when in a hurry
– What about the talk topic?
The Good Samaritan Study
• What might be the prediction here?
– Hurriedness affects helping behavior,
such that people are less likely to help
when in a hurry
– What about the talk topic?
• Think about the concept of an interaction
within this example…
Study results: No interaction
Effects of Depression
Medication
• Say you examine the
effects of a medication on
depression levels in
bipolar and non-bipolar
patients…
– You give either the medicine
or a placebo (X1)
– To patients who are either
bipolar or not
Depression Results
Depression results
• There might be a main effect for
patient type (bipolar vs. non-bipolar)
…
– This might not be interesting; maybe
already knew that
Depression Results
Depression results
• There might be a main effect for
patient type (bipolar vs. non-bipolar)…
– This might not be interesting; maybe
already knew that
• There might be a main effect for drug
– Averaging across everybody, the mean for
depression is lower in the drug (vs.
placebo) condition
– But notice that could be misleading without
noticing that there is an interaction
Depression Results
Depression results
• There might be a main effect for patient
type (bipolar vs. non-bipolar)…
– This might not be interesting; maybe already
knew that
• There might be a main effect for drug
– Averaging across everybody, the mean for
depression is lower in the drug (vs. placebo)
condition
– But notice that could be misleading without
noticing that there is an interaction
• Importantly, though, the two IV’s interact
– The drug only seems effective for non-bipolar
patients
Depression results: Type of
interaction
• The graph shows that bipolar
patients were unaffected by the
drug, whereas non-bipolar patients
were less depressed when taking the
drug (vs. placebo)
– This is called an “ordinal interaction”
– One group moves more than another
group…
• Looks like a fan
Another ordinal interaction
Both groups
are going
down, but the
non-bipolar
people are
going down
more than the
bipolars
Personality type &
environments
• You have a hypothesis that different
personality types will perform
differently in different environments
– Select introverts and extroverts (IV1)
– Have them solve a task in a room that is
noisy or quiet (IV2)
– DV: number of errors made on the task
Results: Personality types and
environments
Personality type & environment
• No main effect for personality type
• No main effect for room environment
• Complete “crossover” interaction
– Introverts do better when in a quiet (vs.
noisy) room
– Extroverts do better when the room is
noisy (vs. quiet)
Results: Personality types and
environments
Personality type & environment
• Complete “crossover” interaction
– Introverts do better when in a quiet (vs.
noisy) room
– Extroverts do better when the room is
noisy (vs. quiet)
• The effect of one IV (e.g., room noise)
is completely reversed for different
levels of the other IV (personality type)
• This is called a “disordinal interaction”
– Looks like an X
Another example
• You have a hypothesis that obese
individuals tend to eat whether or not
their bodies are actually hungry (e.g.,
they do not respond to internal signals)
– Participants are normal weight or obese
(IV1)
– After not eating for several hours,
participants are either given a full meal
upon arrival or no food (IV2)
– DV: Number of crackers eaten during a
“taste test”
Crackers eaten: Results
Crackers eaten
• Obese people seem to eat about the
same number of crackers regardless
of whether they are hungry or full
– No main effect of weight-type, though,
e.g. Obese people are not always eating
more (or less) than normal weight
people
Crackers eaten: Results
Crackers eaten
• Obese people seem to eat about the
same number of crackers regardless
of whether they are hungry or full
– No main effect of weight-type, though,
e.g. Obese people are not always eating
more (or less) than normal weight
people
• There might be a main effect for
level of fullness…
Crackers eaten: Results
Crackers eaten
• Obese people seem to eat about the same
number of crackers regardless of whether they
are hungry or full
– No main effect of weight-type, though, e.g. Obese
people are not always eating more (or less) than
normal weight people
• There might be a main effect for level of
fullness…
– But the important part is the interaction
– Normal weight people eat more crackers when
hungry, but obese people don’t
• This is also a disordinal interaction
– The lines cross each other, still looks like an X
F-ratio in 2-way ANOVA
• Two-way ANOVA gives you 3 F-ratios
– One for X1 (or IV1), one for X2 (or IV2)
and one for the interaction (X1*X2)
– Structure is the same for all tests
• MS-w is in the denominator as an estimate of
the population variance
– If the interaction is not significant, you can
just look at the two “main effects”
• The F-ratio for X1 and for X2
– If the interaction is significant, you should
plot the cell means to see what’s going on
An example
MSW =
∑ s 2
k
None Low Moderate High
Men 9 10 12 6 Row
10 13 10 15 mean =
10.85
7 15 12 12
12 12 13 12
7 10 7 13
Mean 9.0 12.0 10.8 11.6
SD 2.121 2.121 2.387 3.362
Women 4 12 9 10 Row
7 13 7 13 mean =
9.25
6 15 10 4
9 10 7 9
9 13 13 5
Mean 7.0 12.6 9.2 8.2
SD 2.121 1.817 2.490 3.701
Column
means
9.9 10.0 12.3 8.0 10.05
MSW = ∑ s 2
MS-within
k
• Average of the 8 variances (each of
the 8 cells has a variance)
MSW =
1 ⎡( 2.121)
2
+ ( 2.121)
2
+ ( 2.387)
2
+ ( 3.362)
2
+ ( 2.121)
2
+ (1.817)
2⎤
⎢ ⎥
8 ⎢⎣+( 2.490) + ( 3.701)
2 2
⎥⎦
= 6.712
SS-w
• We could also calculate SS-w using
MS-w and df-w
– What’s df-w?
2
SSBet = N Tσ (means)
None Low Moderate High
Men 9 10 12 6 Row
10 13 10 15 mean =
10.85
7 15 12 12
12 12 13 12
7 10 7 13
Mean 9.0 12.0 10.8 11.6
SD 2.121 2.121 2.387 3.362
Women 4 12 9 10 Row
7 13 7 13 mean =
9.25
6 15 10 4
9 10 7 9
9 13 13 5
Mean 7.0 12.6 9.2 8.2
SD 2.121 1.817 2.490 3.701
Column
means
9.9 10.0 12.3 8.0 10.05
SS-between
• This is the total amount of variation
among the cell means (includes
main effects and interaction)
– Simplest way to find it is to find the
unbiased variance of the means (using
your calculator) & multiplying by the
total number of subjects
2
SSBet −cells = σ ( N ) = 3.4775(40) =139.1
SS df MS F p
Between 139.1 7
groups
Gender
Caffeine
Interaction
Within 214.78 32 6.712
groups
Total
Calculate the ANOVA
• 1. First find MS-w
• 2. Find SS-between
• 3. Find SS & MS for each of the two
factors (gender and caffeine group)
SS-gender
None Low Moderate High
Men 9 10 12 6 Row
10 13 10 15 mean =
10.85
7 15 12 12
12 12 13 12
7 10 7 13
Mean 9.0 12.0 10.8 11.6
SD 2.121 2.121 2.387 3.362
Women 4 12 9 10 Row
7 13 7 13 mean =
9.25
6 15 10 4
9 10 7 9
9 13 13 5
Mean 7.0 12.6 9.2 8.2
SD 2.121 1.817 2.490 3.701
Column
means
9.9 10.0 12.3 8.0 10.05
SS-gender
• The ss for gender is based on the
row means
– We can use the same method as for SS-
between, just using row means
– E.g., the variance of the means between
genders
SS-gender
• The ss for gender is based on the
row means
– We can use the same method as for SS-
between, just using row means
– E.g., the variance of the means between
genders
2
SSR = N Tσ (rowmeans)
SS-gender
• The ss for gender is based on the
row means
– We can use the same method as for SS-
between, just using row means
– E.g., the variance of the means between
genders 2
SSR = N Tσ (rowmeans) =
2
σ (10.85,9.25)(40) =
(.64)(40) = 25.6
SS-caffeine
None Low Moderate High
Men 9 10 12 6 Row
10 13 10 15 mean =
10.85
7 15 12 12
12 12 13 12
7 10 7 13
Mean 9.0 12.0 10.8 11.6
SD 2.121 2.121 2.387 3.362
Women 4 12 9 10 Row
7 13 7 13 mean =
9.25
6 15 10 4
9 10 7 9
9 13 13 5
Mean 7.0 12.6 9.2 8.2
SD 2.121 1.817 2.490 3.701
Column
means
9.9 10.0 12.3 8.0 10.05
SS-caffeine
• The means for each caffeine group
are the column means
2
SSC = N Tσ (colmeans)
SS-caffeine
• The means for each caffeine group
are the column means
2
SSC = N Tσ (colmeans) =
2
σ ( 8,12.3,10,9.9)( 40) =
( 2.3225)( 40) = 92.9
SS df MS F p
Between 139.1 7
groups
Gender 25.6
Caffeine 92.9
Interaction
Within 214.78 32 6.712
groups
Total
Degrees of freedom
• For gender, we have 2 groups
– df = 2-1 = 1
• For caffeine, we have 4 groups
– df = 4-1 = 3
Degrees of freedom & MS
• For gender, we have 2 groups
– df = 2-1 = 1
• For caffeine, we have 4 groups
– df = 4-1 = 3
• MS = SS/df
– For gender, 25.6/1 = 25.6
– For caffeine, 92.9/3 = 30.697
SS df MS F p
Between 139.1 7
groups
Gender 25.6 1 25.6
Caffeine 92.9 3 30.967
Interaction
Within 214.78 32 6.712
groups
Total
Calculate the ANOVA
• 1. First find MS-w
• 2. Find SS-between
• 3. Find SS & MS for each of the two
factors (gender and caffeine group)
• 4. Find SS & MS for the interaction
SS-interaction
• SS-between is the variance between
all the cell means
– SS-gender is the variance between row
means
– SS-caffeine is variance between column
means
– Whatever’s left is the interaction
between cell means
• SS-between = SS-gender + SS-
caffeine + SS-interaction
SS df MS F p
Between 139.1 7
groups
Gender 25.6 1 25.6
Caffeine 92.9 3 30.967
Interaction
Within 214.78 32 6.712
groups
Total
Another way:
df-interaction = df-gender * df-caffeine
SS df MS F p
Between 139.1 7
groups
Gender 25.6 1 25.6
Caffeine 92.9 3 30.967
Interaction 20.6 3 6.867
Within 214.78 32 6.712
groups
Total
MS-interaction = SS-interaction/df-interaction
20.6/3 = 6.867
Calculate the ANOVA
• 1. First find MS-w
• 2. Find SS-between
• 3. Find SS & MS for each of the two
factors (gender and caffeine group)
• 4. Find SS & MS for the interaction
• 5. Find the 3 F-ratios
SS df MS F p
Between 139.1 7
groups
Gender 25.6 1 25.6
Caffeine 92.9 3 30.967
Interaction 20.6 3 6.867
Within 214.78 32 6.712
groups
Total
€
Multiple comparisons
HSD = 3.154
• Large – moderate = 9.9 – 10.0 = -.1
• Large – small = 9.9 – 12.3 = -2.4
€
Multiple comparisons
HSD = 3.154
• Large – moderate = 9.9 – 10.0 = -.1
• Large – small = 9.9 – 12.3 = -2.4
• Large – zero = 9.9 – 8 = 1.9
€
Multiple comparisons
HSD = 3.154
• Large – moderate = 9.9 – 10.0 = -.1
• Large – small = 9.9 – 12.3 = -2.4
• Large – zero = 9.9 – 8 = 1.9
€
• Moderate – small = 10 – 12.3 = -2.3
Multiple comparisons
HSD = 3.154
• Large – moderate = 9.9 – 10.0 = -.1
• Large – small = 9.9 – 12.3 = -2.4
• Large – zero = 9.9 – 8 = 1.9
€
• Moderate – small = 10 – 12.3 = -2.3
• Moderate – zero = 10 – 8 = 2.0
Multiple comparisons
HSD = 3.154
• Large – moderate = 9.9 – 10.0 = -.1
• Large – small = 9.9 – 12.3 = -2.4
• Large – zero = 9.9 – 8 = 1.9
€
• Moderate – small = 10 – 12.3 = -2.3
• Moderate – zero = 10 – 8 = 2.0
• Small – 0 = 12.3 – 8 = 4.3 **
– This is the only one that’s significant