Two-way ANOVA, short for two-way analysis of variances and also called two-factorial ANOVA, is a statistical method that is applied to investigate the effect of two categorical independent variables on one dependent variable. Those independent variables are also called factors . In the course of the analysis, three different effects are of interest :
- Main effect of factor A on the dependent variable
- Main effect of factor B on the dependent variable
- Interaction effect of factors A and B
Differences compared to one-way ANOVA
Just like the one-way ANOVA, a two-way ANOVA investigates differences in group means . The main difference lies in the number of independent variables or factors used. While the effect of only one factor on the dependent variable is analyzed for the one-way ANOVA, two-way ANOVA investigates the effects and interaction of two factors . Thus, both row mean differences and column mean differences are investigated. However, the main question of interest is equal to that of the one-way ANOVA :
- "Why does any given score in our data deviate from the mean of all the data?"
Two-way ANOVA design
For conducting a two-factorial ANOVA one can use either a balanced or unbalanced design. An identical number of observations for each group would be called balanced, while a different number of subjects per group is called unbalanced. However, the main problem of unbalanced designs is that the estimates of main effects might be distorted and therefore might have to be adjusted .
With a levels of factor A and b levels of factor B, the resulting data layout has a number of a x b cells, also called treatments. The following table shows a general data layout for two-way ANOVA analyses :
|Level 1||Level 2||Level 3||Level ...|
|Factor B||Level 2||-||-||-||-|
Two-way ANOVA model
In the following, the model of a two-way ANOVA is shown :
xijk = μ + αi + βj + (αβ)ij + εijk
μ = overall mean
αi = effect factor A, level i
βj = effect factor B, level j
(αβ)ij = interaction effect, levels i,j
εijk = error
Two-way ANOVA hypotheses
When applying a two-way ANOVA, the following three sets of hypotheses are tested :
Main effect of factor A
H0: αi = 0 for all i, meaning there is no difference in means between the groups
H1: Not all αi = 0
Main effect of factor B
H0: βj = 0 for all j, meaning there is no difference in means between the groups
H1: Not all βj = 0
Interaction between A and B
H0: (αβ)ij = 0 for all i and j, meaning there is two-way interaction between levels of the two factors
H1: Not all (αβ)ij = 0
In the course of performing a two-way ANOVA, the third hypothesis concerning the interaction effect is investigated first, as the interpretation of results varies depending on whether an interaction can be found or not .
Two-way ANOVA assumptions
There are three assumptions that must be satisfied in order to be able to use an analysis of variances in general :
- Normality: the investigated groups need to be normally distributed
- Independence: the investigated groups need to be independent from each other
- Homogeneity: the investigated groups need to have equal variances
Those assumptions thus also need to be satisfied to be able to perform a two-way ANOVA.
- Harring & Johnson 2018, p. 1734
- Denis 2021, p. 147
- Harring & Johnson 2018, p.1736
- Harring & Johnson 2018 p. 1734
- Denis 2021, p. 148
- Harring & Johnson 2018, p. 1736
- Aczel-Sounderpandian 2009, pp. 381, 392
- Aczel−Sounderpandian 2009, p. 382
- Aczel−Sounderpandian 2009, pp. 382-383
- Aczel−Sounderpandian 2009, p. 383
- Aczel−Sounderpandian 2009, p. 351
|Two-way ANOVA — recommended articles|
|Mann-Whitney U test — Descriptive statistics — Parametric analysis — Adjusted mean — Random error — Cluster analysis — Attribute control chart — Multiple regression analysis — Three-Way ANOVA|
- Pujar, P. M., Kenchannavar, H. H., Kulkarni, R. M. & Kulkarni, U. P. (2019). Real-time water quality monitoring through Internet of Things and ANOVA-based analysis: a case study on river Krishna. "Applied Water Science", 10, 1-16.
- Wilcox, R. (2022). One-way and two-way anova: Inferences about a robust, heteroscedastic measure of effect size. "Methodology", 18(1), 58-73.
- Yigit, S. & Mendes, M. (2018). Which Effect Size Measure is Appropriate for One-Way and Two-Way ANOVA Models? - A Monte Carlo Simulation Study. "REVSTAT-Statistical Journal", 16(3), 295-313.
Author: Leonie Pöter