Wolfram Alpha:

```Two-Way ANOVA
-------------

In a two-way ANOVA there is one dependent variable and multiple
independent variables.  The two-way ANOVA can not only determine
the main effect of contributions of each IV but also identifies
if there is a significant interaction effect between them.

Linear Model
-------------

yijk = μ + αi + βj + γij + eijk

Where,

μ = grand mean value
αi = main effect for ith row.
βj = main effect for jth column.
γij = interaction effect for ith row and jth column

SPSS:  Analyze>General Linear Model>Univariate

Test statistic:  F test.

H0: no interaction effects
H0: γij = 0, all i and j
H0: no row effects
H0: αi = 0, all i
H0: no column effects
H0: βj = 0, all j

The 2-way ANOVA can be used to analyze factorial designs.

Factorial Design
----------------

A factorial experiment is an experiment whose design consists of
two or more factors, each with discrete possible levels and whose
experimental units take on all possible combinations of these
levels across all such factors

Consider a 2 x 4 factorial design:

1  2  3  4  <- Factor A
X  ?  ?  ?  ?
Y  ?  ?  ?  ?
Error
^
|
Factor B

The mathematics involved in analyzing the 2-way ANOVA is along
the same lines as the 1-way ANOVA.  However, the computations
involved are tedious and best handled by a statistical package
like SPSS.

df         SS             MS                    F
-----       ----    -----------------------  ---------
Factor A           c - 1       SSX     MSSX = SSX/(c - 1)       MSSX/MSSE
Factor B           r - 1       SSY     MSSY = SSY/(r - 1)       MSSY/MSSE
Fac A * Fac B  (c - 1)(r - 1)  SS(XY)  MSS(XY) =     SS(XY)     MSS(XY)/MSSE
-------------
(c - 1)(r - 1)
Error              n - cr      SSE     MSSE = SSE/(n - cr)
Total              n - 1

c = number of columns.
r = number of rows.

Eaxample:

Consider an experiment with 4 different brands of golf ball
(A, B, C, D) and 2 different clubs (driver and 5 iron).  The
average distance hit is computed for all possible combinations.

Brand
A       B       C       D
Club X      228.43  233.73  243.10  229.75
Club Y      171.30  182.68  167.18  160.50

The SPSS printout looks like:

df      SS           MS          F       p
--  -----------  -----------  ------  -------
Model          7  33659.80875   4808.54411  140.35  <0.0001

df      SS           MS          F       p
--  -----------  -----------  ------  -------
Club           1  32093.11125  32093.11125  936.75  <0.0001
Brand          3    800.73625    266.91208    7.79   0.0008
Club*Brand     3    765.96125    255.32042    7.45   0.0011
Total          7  33659.80875      ***        ***

*** Total ≠ column totals.

The model tells us that at least 2 of the means are different.
Brand and Club interact so there is no point in testing the
main effects.  Instead it is necessary to compare the treatment
means to learn the nature of the interaction.```