Professional Documents
Culture Documents
Two Way ANOVA SCRBD
Two Way ANOVA SCRBD
VARIANCE
What is a Two-Way ANOVA?
1 2
◉ The two-way ANOVA is an extension of the one-way ANOVA test that
examines the influence of different categorical independent variables
on one dependent variable.
◉ It is used when there is more than one independent variable and
multiple observations for each independent variable.
3
Example: Researchers are studying a population of walruses. They want to
answer the question:
“Are walruses heavier in early or late mating season and does that depend
on the sex of the walrus? “
4
The Assumptions and Limitations:
• Sample independence – that each sample has been drawn independently of the
other samples.
• Variance Equality – That the variance of data in the different groups should be the
same.
5
The hypotheses of a two-way ANOVA:
6
What are the steps in solving Two-Way ANOVA?
2 7
A botanist wants to know whether or not plant growth is influenced by sunlight
exposure and watering frequency. She plants 40 seeds and lets them grow for two
months under different conditions for sunlight exposure and watering frequency. After
two months, she records the height of each plant. The results are shown below:
Sunlight Exposure
Watering Frequency None Low Medium High
Daily 4.8 5 6.4 6.3
4.4 5.2 6.2 6.4
3.2 5.6 4.7 5.6
3.9 4.3 5.5 4.8
4.4 4.8 5.8 5.8
Weekly 4.4 4.9 5.8 6
4.2 5.3 6.2 4.9
3.8 5.7 6.3 4.6
3.7 5.4 6.5 5.6
3.9 4.8 5.5 5.5
8
In Two-Way ANOVA, we must consider three possible effects on the plant growth:
a) the effects of interaction between watering frequency and sunlight exposure;
b) the effects of watering frequency;
c) the effects of sunlight exposure .
Test the null hypothesis that there is no interaction between watering frequency
and sunlight exposure.
9
Step 1: Calculate Sum of Squares for First Factor (Watering Frequency)
Calculate the sum of squares for the factor “watering frequency” by using the following
formula: Σn(Xj – X..)2 where:
n: the sample size of group j
Σ: a greek symbol that means “sum”
Xj: the mean of group j
X..: the grand mean
10
Step 2: Calculate Sum of Squares for Second Factor (Sunlight Exposure)
Repeat this calculation to find the mean height of plants with various sunlight exposures:
Mean of Low Sunlight = 5.1
Mean of Medium Sunlight = 5.89
Mean of High Sunlight = 5.55
Calculate the sum of squares for the factor “sunlight exposure” by using the following formula:
Σn(Xj – X..)2 where:
n: the sample size of group j
Σ: a greek symbol that means “sum”
Xj: the mean of group j
X..: the grand mean
11
Step 3: Calculate Sum of Squares Within (Error)
Calculate the sum of squares within by taking the sum of squared differences between each
combination of factors and the individual plant heights.
12
Step 4: Calculate Total Sum of Squares
Calculate the total sum of squares by taking the sum of the differences between each individual
plant height and the grand mean:
13
Step 6: Fill in ANOVA Table
14
Calculations:
df Watering Frequency: j-1 = 2-1 = 1
df Sunlight Exposure: k-1 = 4-1 = 3
df Interaction: (j-1)*(k-1) = 1*3 = 3
df Within: n – (j*k) = 40 – (2*4) = 32
df total: n-1 = 40-1 = 39
MS: SS/ df
F Watering Frequency: MS Watering Frequency / MS Within
F Sunlight Exposure: MS Sunlight Exposure / MS Within
F Interaction: MS Interaction / MS Within
p-value Watering Frequency: The p-value that corresponds to F value of .000921 with df
numerator = 1 and df denominator = 32
p-value Sunlight Exposure: The p-value that corresponds to F value of 23.04898 with df
numerator = 3 and df denominator = 32
p-value Interaction: The p-value that corresponds to F value of 1.241517 with df numerator = 3
and df denominator = 32
15
n= total observations,
j = number of levels for watering frequency,
k = number of levels for sunlight exposure.
The p-values that correspond to the F-value were calculated using the F Distribution Calculator
If the p-value is 0.05 or lower, the result is trumpeted as significant, but if it is higher than
0.05, the result is non-significant.
The p-value for the interaction between watering frequency and sunlight
exposure was 0.311. This is not statistically significant at α = 0.05.
The p-value for watering frequency was 0.975. This is not statistically significant
at α = 0.05.
The p-value for sunlight exposure was < 0.000. This is statistically significant at
α = 0.05.
16
These results indicate that sunlight exposure is the only factor that has a
statistically significant effect on plant height.
That is, whether a plant is watered daily or weekly, it has no impact on how
sunlight exposure affects a plant.
17
Two Way ANOVA in Excel with Replication
Step 1: Click the “Data” tab and then click “Data Analysis.” If you don’t see the Data analysis option,
install the Data Analysis Toolpak.
Step 2: Click “ANOVA two factor with replication” and then click “OK.” The two way ANOVA window will open.
Step 3: Type an Input Range into the Input Range box. For example, if your data is in cells A1 to A25, type
“A1:A25” into the Input Range box. Make sure you include all of your data, including headers and group names.
Step 4: Type a number in the “Rows per sample” box. Rows per sample is actually a bit misleading. What this is
asking you is how many individuals are in each group.
Step 5: Select an Output Range. For example, click the “new worksheet” radio button to display the data in a new
worksheet.
Step 6: Select an alpha level. In most cases, an alpha level of 0.05 (5 percent) works for most tests.
Step 7: Click “OK” to run the two way ANOVA. The data will be returned where you specified in Step 5.
Step 8: Read the results. To figure out if you are going to reject the null hypothesis or not, you’ll basically be
looking at two factors:
1. If the F-value ( f )is larger than the f critical value ( f crit )
2. If the p-value is smaller than your chosen alpha level.
18
High Low
Exercise: Protein Protein
Male 10 5
A research study was conducted to examine the 7 4
impact of eating a high protein breakfast on 9 7
adolescents' performance during a PE physical
6 4
fitness test. Half of the subjects received a high
8 5
protein breakfast and half were given a low
protein breakfast. All of the adolescents, both
Female 5 3
male and female, were given a fitness test with
high scores representing better performance. Test
4 4
scores are recorded. 6 5
3 1
2 2
19
THANKS!
20
References
◉ https://
www.technologynetworks.com/informatics/articles/one-way-vs-two-way-an
ova-definition-differences-assumptions-and-hypotheses-306553
21