Two-way ANOVA allows us to understand the effects of two factors and their interactions.
Two factors A and B are **crossed** if there is at least one observation in every factor level combination.
Factor B is **nested** within factor A when each level of B occurs within only one level of A. All combinations of levels are not represented.
A two-way ANOVA is **balanced** if each factor level combination contains the same number of replications. Otherwise, the two-way ANOVA is **unbalanced**.
**Replication** in the two-way ANOVA is the repeated observation under the same combination of factor levels.
A **full-factorial design** is a study design that includes all possible combinations of the levels of the factors at least once. A $J^p$ factorial design is one that consists of $p$ factors each with $J$ levels or groups.
As with one-way ANVOA, two-way ANOVA has two equivalent formulations: the means model and the effects model.
Suppose that we have a factor $\tau_i$ occurring at $j = 1, \dots, J$ levels and another factor $\alpha_k$, occurring at $k = 1, \dots, K$ levels with $i = 1, \dots, n_{jk}$ observations per level.
The means model states
$Y_{ijk} = \mu_jk + \epsilon_{ijk}$
The effects model states
$Y_{ijk} = \mu + \tau_j + \alpha_k + \epsilon_{ijk}$
where $\tau_j$ and $\alpha_k$ are the differences between the grand mean $u$ and the mean for factor $\tau$ and $\alpha$ at levels $j, k$ respectively. Also, the assumptions that the error is independent, normal $\epsilon_{ijk} \overset{iid}{\sim} N(0, \sigma^2)$, and homoscedastic apply. For the effects model to be identifiable, $\sum \tau_j = \sum \alpha_k = 0$.