This document provides an overview of two-way analysis of variance (ANOVA). It explains that two-way ANOVA involves two categorical independent variables and one continuous dependent variable. The document outlines the objectives of two-way ANOVA, which are to analyze interactions between the two factors, and evaluate the effects of each factor. It then provides examples of how to set up and perform two-way ANOVA calculations and interpretations.
2. Chapter 12: Analysis of Variance
12.1 One-Way ANOVA
12.2 Two-Way ANOVA
2
Objectives:
1. Analyze a two-way ANOVA design
2. Draw interaction plots
3. Perform the Tukey test
Good lecture Videos to watch: ANOVA
Concept: https://www.youtube.com/watch?v=ITf4vHhyGpc
Hand Calculation: https://www.youtube.com/watch?v=WUjsSB7E-ko
Visual Explanation: https://www.youtube.com/watch?v=JgMFhKi6f6Y
3. 3
12.2 Two - Way ANOVA
Two-Way ANOVA:
This analysis requires two categorical (Qualitative) (Nominal)variables, or factors, and are considered
independent variables.
The number of factors defines the name of the ANOVA analysis:
One-way ANOVA uses one factor.
Two-way ANOVA has two.
Each factor has a limited (finite) number of possible values or levels.
Example:
Gender is a categorical factor with two levels: Male & Female.
Dependent (Response) Variable (Outcome):
It is a continuous variable whose different combinations of values for the two categorical variables divide
the continuous data into groups.
Two-way ANOVA determines whether the mean differences between these groups are statistically significant.
It, also, determines whether the interaction effect between the two factors is statistically significant. In that case, it is
extremely important to interpret them properly.
Two factors fixed at different levels:
Factor A with n levels & Factor B has m levels
Design: n Γ m factorial design.
4. 4
12.2 Two - Way ANOVA
Objective:
With sample data categorized with two factors (a row variable and a column variable),
use two-way analysis of variance to conduct the following three tests:
1. Test for an effect from an interaction between the row factor and the column factor.
2. Test for an effect from the row factor.
3. Test for an effect from the column factor.
Interaction :
There is an interaction between two factors if the effect of one of the factors changes for
different categories of the other factor.
Key Concept:
The method of two-way analysis of variance is used with data divided into categories
according to two factors. The method of this section requires that we first test for an
interaction between the two factors; then we test for an effect from the row factor, and
we test for an effect from the column factor.
5. 5
12.2 Two - Way ANOVA
Requirements:
1. Normality For each cell, the sample values come from a population with a
distribution that is approximately normal.
2. Variation The populations have the same variance ΟΒ² (or standard deviation Ο).
3. Sampling The samples are simple random samples of quantitative data.
4. Independence The samples are independent of each other.
5. Two-Way The sample values are categorized two ways.
6. Balanced Design All of the cells have the same number of sample values.
6. Interaction Effect: An interaction effect is suggested when line
segments are far from being parallel.
No Interaction Effect: If the line segments are approximately
parallel, it appears that the different categories of a variable
have the same effect for the different categories of the other
variable, so there does not appear to be an interaction effect.
6
12.2 Two - Way ANOVA
Step 2: Row/Column Effects:
If there is an interaction effect, stop. (If there is an interaction between factors, we
shouldnβt consider the effects of either factor without considering those of the other.)
If there is no interaction effect, we can test the hypothesis tests for the row factor
effect and column factor effect.
Step 1: Interaction Effect:
Test the null hypothesis that there is no interaction between the two factors.
Test statistic: πΉ =
ππ (πΌππ‘πππππ‘πππ)
ππ (πΈππππ)
7. Procedure for Two-Way Analysis of Variance
7
Step 1: Interaction Effect:
Test the null hypothesis that there is no interaction
between the two factors.
Test statistic: πΉ =
ππ (πΌππ‘πππππ‘πππ)
ππ (πΈππππ)
Step 2: Row/Column Effects:
If there is an interaction effect, stop. (If there is an interaction
between factors, we shouldnβt consider the effects of either factor
without considering those of the other.)
If we conclude that there is no interaction effect, then we should
proceed with the following two hypothesis tests.
8. Pulse Rates with Two Factors: Age Bracket and Gender
Blank Female Male
18-29 104 82 80 78 80 84 82 66 70 78 72 64 72 64 64 70 72 64 54 52
30-49 66 74 96 86 98 88 82 72 80 80 80 90 58 74 96 72 58 66 80 92
50-80 94 72 82 86 72 90 64 72 72 100 54 102 52 52 62 82 82 60 52 74
The table shown is an example of pulse rates (beats per minute) categorized with two factors:
1. Age Bracket (years): One factor is age bracket (18β29, 30β49, 50β80).
2. Gender: The second factor is gender (female, male).
Given the pulse rates from the earlier table, use two-way analysis of variance to test for an interaction
effect, an effect from the row factor of age bracket, and an effect from the column factor of gender. Use
a 0.05 significance level.
8
Calculate the mean for each cell and construct a
graph. The individual cell means are shown in
the table below. Those means vary from a low of
64.8 to a high of 82.2, so they vary considerably.
blank Female Male
18-29 80.4 64.8
30-49 82.2 76.6
50-80 80.4 67.2
Example 1:
9. 9
Example 1: Continued
Requirement Check:
1. For each cell, the sample values appear to be from a population with a distribution that is
approximately normal, as indicated by normal quantile plots.
2. The variances of the cells (100.3, 51.7, 103.5, 183.2, 138.5, 293.5) differ considerably, but the test
is robust against departures from equal variances.
3. The samples are simple random samples of subjects. Requirement Check
4. The samples are independent of each other; the subjects are not matched in any way.
5. The sample values are categorized in two ways (age bracket and gender).
6. All of the cells have the same number (ten) of sample values.
The requirements are satisfied.
Step 1:
H0: There is no interaction between the two factors
H1: There is interaction between the two factors
ππ: πΉ =
ππ (πΌππ‘πππππ‘πππ)
ππ (πΈππππ)
=
136.2667
145.11111
= 0.9391
Interpretation:
P-value = 0.3973 > 0.05
Fail to reject the null hypothesis
There is no interaction effect.
10. 10
Example 1: Continued
Step 2: Row/Column Effects:
Since there is no interaction effect, we test for effects from the row and
column factors. Here is their null hypotheses:
H0: There are no effects from the row factor (age bracket).
H0: There are no effects from the column factor (gender).
ππ: πΉ =
ππ (π΄ππ πππππππ‘)
ππ (πΈππππ)
=
263.46667
145.11111
= 1.8156
ππ: πΉ =
ππ (ππππππ)
ππ (πΈππππ)
=
1972.2667
145.1111
= 13.5914
Interpretation: P-value = 0.1725 > 0.05
Fail to reject the null hypothesis
There are no effects from the row factor (age bracket); pulse rates are not affected by the age bracket.
Interpretation: P-value = 0.0005 < 0.05
Reject the null hypothesis
There are effects from the column factor (gender); pulse rates are affected by the gender.
Final Interpretation: According to this sample data, we conclude that pulse rates seem to be affected
by gender, but not by age bracket and not by an interaction between age bracket and gender.