Two-way analysis of variance (source code)

= Two-way analysis of variance
{title2=$Y_{ij}=\alpha+r_i+g_j+\varepsilon_{ij}$}
{wiki}

An additive two-factor Gaussian model separates row and column effects. With one observation in each of $r c$ cells, constraints fixing one row and column effect leave $r+c-1$ mean parameters and $(r-1)(c-1)$ residual degrees of freedom. Balanced least squares gives fitted values equal to row mean plus column mean minus grand mean. With no cell replication, unrestricted interactions are confounded with residual error; the additive interpretation requires an assumption that those interactions are absent or negligible.