You are on page 1of 7

TWO-WAY ANOVA

Contents

1. Why Is This Important? 2

2. Example: College Drinking 2

3. Big Ideas 4

4. Summary 7

(source: http://www.wadsworth.com/psychology_d/templates/student_resources/workshops/stats_wrk.html)
Why Is This Important?
Big hint - If you haven't read our One-Way ANOVA workshop - do that first! You may
be asked to help analyze data from a study that includes more than one independent
grouping variable. Data analysis can get complicated because these designs allow you to look at
each independent variable separately or in combination. To do this type of analysis, you need
measurement data and to calculate means and standard deviations for each group in the design.
What are the questions we ask in this analysis strategy?

How do you determine what factors are significant when you have two independent variables?
• Two F-ratios, one for each factor will tell us this!
Do the factors act in combination? Does the effect of one factor depend on the value of the
second factor?
• Computing an F-ratio for the Interaction will tell us this! Interaction is the
keyword - remember it for later.

Example: College Drinking


You have two independent variables, which define your groups.
• Let’s call one variable Factor A and the other Factor B.
• Factor A has three groups or three “levels.”
• Factor B has two groups or two “levels.”
This gives you a matrix of six groups.

• You can get means for A1, A2, or A3 (forgetting about B group membership).
Use these for the Main Effect of A.
• You can get means for B1 and B2 (forgetting about A group membership).
Use these for the Main Effect of B.
• You can get 6 means for the 3 x 2 combinations.
Use these for the Interaction of A and B.
You are concerned with college drinking behavior. You think it is related to your year in school.
You collect data from 1st year, Sophomores, and Juniors.

For this example, I don't care about Seniors. Thus, Year will be factor A with 3 levels = A1, A2, A3
You think it is also related to gender. Thus, Gender will be factor B with 2 levels = B1, B2
You calculate the means.

What questions can we answer?


• Do the Years differ? This is the Main Effect of Year - Factor A!
• Do the Genders differ? This is the Main Effect of Gender - Factor B!
• Does the pattern of the differences between years depend on Gender? This is the
Interaction of Year by Gender - the AB interaction!

Look at the following graphic:

Which of the panels do you think represents an interaction?

Panels 5 & 6

Detailed explanations of each panel are presented below.


• There is a line connecting each level of the means for A1, A2, and A3. If we did not
consider Gender, then this line would be the main effect of A. In Panel 1, the means
differ so there would be a main effect of A. This is not the case in Panel 2.
• In Panel 3, all the B1s are higher than B2. Thus, there is a main effect of B. Note that A
has no effect for B1 or B2. So there is no effect of A or an AB interaction. The latter is
because A has no differential effect dependent on B.
• In Panel 4, A has an effect such that as Year increases drinking increases. Gender (B) has
an effect as the B1 line is higher than the B2 line. Big Point Alert - The B1 line is
parallel to B2 line. Year effects each Gender in the same fashion. There is No
Interaction!
• In Panel 5, A has an effect such that as drinking increases with age for all groups. B has
an effect, as the B1 line is higher than the B2 line. Big Point Alert - The B1 line is
Steeper than the B2 line. Thus, the year can have a different effect dependent on your
gender. The lines are not parallel. This is an Interaction.
• In Panel 6 the slopes are opposite. This is a cute one. If you compute the average for B1
vs. B2, forgetting about Year, then there is no effect of gender. If you average the Years
forgetting about Gender, the years don't differ. You would get No main effects. There
is only an Interaction. That's why we check it first.

Big Ideas
The analysis is based on the following linear model:

We will calculate F-ratios for each of these:


• FA
• FB
• FAB
The Idea of These F-ratios
A. Significant F for Main Effect of A means there are some differences between the A
groups (A1, A2, or A3 - Years). Remember that the Genders are combined. An nonsignificant
F means that we did not find any differences between the years with Gender combined.
ALERT - we need to look at the Interaction - It ain't over yet!

B. Significant F for Main Effect of B means there are some differences between the B
groups (B1 vs. B2 - Gender). Remember that the Years are combined. An nonsignificant F
means that we did not find any differences between the Genders with Years combined.
ALERT - we need to look at the Interaction - It ain't over yet!

AB - The interaction is significant!! What this means is that if you now look at the effects of
A for a level of B and compare it to the effects of A for another level of B, they may differ.

In English, the effect of year on Drinking would be different for each Gender. Maybe Males
increase their drink more over the 3 years than Females. Maybe Males decrease drinking and
females increase. In any case, there can be differences between the years but these differences
vary by gender.

Hint & Reminder


Always check the interaction first when you do a two-way ANOVA.

Partitioning Variance in a Two-Way Design:

So what F-ratio do we calculate?


When we have data, we can calculate using fancy formulas (see your
books) the following terms:
• MS A, MS B, MS AB, & MS Within Groups
• MS A estimates σ2α
• MS B estimates σ2 β
• MS AB estimates σ2αβ
• MS Within-Groups estimates σ2ε
Focus on the MS AB and F AB! Because they tell you if there is an
interaction!

You usually use a computer program to calculate the Mean Squares and the F-ratios.
The F-ratios must be bigger than 1.0 for significance. In fact, they must not only be bigger
than 1.0, it must be bigger than the F-table value for significance.

The larger your sample size the smaller the F-ratio you need (still has to be bigger than 1.0).
The smaller your sample, the larger F has to be - even much greater than the region of 1.0.

DANGER - DANGER - WARNING!!


Don't Say All the Means Are Different Because F-ratios are Significant.
WRONG!

You will need to do comparisons. Check the One-way ANOVA workshop for the rationale of
doing this. It is very similar for Two-way ANOVAs.

Variances can be turned into Proportions (Effect Size) Here's the deal - if you know the
total variance - you can determine what percent of the total variance is related to the Mean
squares for each term in your analysis (A, B, AB) variance as compared to the Within-
Groups Variance. Many folks like a coefficient called Omega2 the best.

The Bottom Line


If you have two independent variables, your goal is to see if each variable has an effect and
whether they interact to give different effects for one variable dependent on the level of the
other.
• Check the FAB ratio first.
• Look at the Graphs!
• Do comparisons to find out what groups are significantly different.
• Calculate an effect size measure such as Omega Square to see how much variance A, B,
and AB explain.

Partitioning Information - One can have 2-way, 3-way, 4-way, and N-way designs. The idea is
all the same. In a 2-way design (AB) - you wondered if the effect of A depended on B. In a 3-way
design, you have ABC and you can ask about whether the AB interaction depends on the level of
C (or AC on B or BC on A). What this means is that for a level of C, the AB graphs are
different. Here are some pictures.
Summary

• Two-way ANOVAs are used when we have more than one independent variable in our
study.
• Two-way and more complex ANOVAs can test individual (main) effects or combined
(interaction) effects.
• Interaction, or combined, effects test whether the pattern observed for one variable (e.g.,
year in college) differs by the second variable (e.g., male versus female).
• Always check the interaction first; we do not interpret main/individual effects if there is
an interaction present in the data.
• We use multiple F ratios in two-way ANOVA. Each examines a between group
effect/error.
• Effect sizes (η2 or ω2) can also be calculated for two-way ANOVA.

You might also like