Factorial Experiments & Interaction
A factorial experiment studies combinations of two or more design factors. It asks how each factor changes the response and whether its effect depends on another factor.
This extends One-Way ANOVA: a second factor can be a scientific treatment factor, rather than merely a nuisance variable to remove.
| Design | Treatment combinations | Main question |
|---|---|---|
| Two factors with and levels | What are the effects of A, B, and their interaction? | |
| Three factors with levels | Does a two-factor interaction depend on the third factor? | |
| factors, each with two levels | Which factors and interactions are active over the chosen ranges? |
With independent replicates per combination, multiply the number of combinations by to obtain the total run count. All raw numerical data used below are illustrative.
Why Vary Factors Together?¶
Suppose A is a process setting and B is a temperature setting. Changing A only at low B tells us its effect at low B. It cannot show whether A behaves differently at high B.
A factorial design includes every combination, allowing us to estimate both main effects and interactions. Each run contributes to several comparisons. The cost is that the run count grows as the product of the numbers of levels.
Choose factors and ranges with a scientific purpose. A low/high difference that is too small may be practically uninformative; a very wide range can make a simple model inappropriate. Randomize execution order and use independent experimental units.
Main Effects, Simple Effects & Interaction¶
| Quantity | Meaning |
|---|---|
| Simple effect of A | Change in mean response across A levels at a particular level of B. |
| Main effect of A | A comparison averaged over B levels, using the stated weighting. |
| Interaction | The simple effect of A changes with B; equivalently, B’s effect changes with A. |
For a balanced two-by-two design, let denote the mean at A level and B level . The simple effects of increasing A are
No interaction means . In an interaction plot, parallel population-mean lines indicate additivity. Sample lines need not be perfectly parallel even when the population model is additive.
Nonparallel lines need not cross to indicate interaction. A crossover can make an average main effect near zero even when the factor matters greatly within each condition. A plot suggests patterns; inferential uncertainty still matters.
Replicated Two-Factor Model¶
For A levels , B levels , and independent replicates ,
The usual constraints are
These constraints make the parameterization identifiable. The cell mean is
| Sample mean | Average over |
|---|---|
| Replicates in cell . | |
| All B levels and replicates at A level . | |
| All A levels and replicates at B level . | |
| All observations. |
For this balanced design,
Thus and . The interaction is the cell mean’s departure from what the additive main-effects model predicts.
Two-Factor ANOVA¶
For equal replication, variation splits into four orthogonal components:
| Source | df | Mean square | Test |
|---|---|---|---|
| A | |||
| B | |||
| AB | |||
| Error | |||
| Total |
Each test uses its row’s df in the numerator and the error df in the denominator, with right-tail rejection. The hypotheses are all A effects zero, all B effects zero, and all interaction effects zero, respectively. With interactions present, main-effect hypotheses concern marginal averages, not absence of every simple effect.
These simple SS formulas rely on balance. For unequal replication or missing cells, fit the appropriate linear model and specify the desired comparisons and weighting; different adjusted ANOVA hypotheses need not coincide.
Interpreting & Checking the Model¶
Inspect cell means and interaction plots. Begin interpretation with the highest-order interaction retained in the model.
Describe relevant simple effects when averages hide important differences.
Use planned contrasts or adjusted comparisons when several conclusions are intended jointly.
Check residual normality, spread across cells, outliers, and patterns over run order. Independence comes from the assignment and measurement design.
Report effects in response units, uncertainty, and the combinations actually studied.
Model hierarchy: retain the main effects A and B when retaining AB, even if one marginal test is nonsignificant. A nonsignificant interaction is not proof of additivity, especially with little replication.
Reference-group coding, sum-to-zero coding, and a separate parameter for each cell describe the same full cell-means model. Fitted values and residuals agree; coefficients have different interpretations. In reference coding, the intercept can be a baseline cell mean rather than the grand mean.
What Changes Without Replication?¶
With one observation per cell, . The full interaction model fits every cell exactly and leaves zero pure-error df. Interaction can be described from cell values, but it cannot be tested against a separately estimated within-cell error variance from those data alone.
If additivity is scientifically defensible, fit
The fitted value is . The remaining df can serve as residual error under the no-interaction assumption. Any actual interaction is then mixed into that residual.
| One observation per cell | What can be done? |
|---|---|
| Fit all cell means / full interaction | Estimate cell means; no internal pure-error estimate. |
| Fit an additive model | Test main effects conditionally on additivity and the error assumptions. |
| Obtain genuine replication or external error information | Supply information needed to separate interaction from noise. |
Do not declare an interaction absent simply because a design cannot test it.
Quantitative Factors: Polynomial Components¶
For three equally spaced numerical levels, use linear coefficients and quadratic coefficients . Each factor’s two df split into one linear and one quadratic component.
For A, with observations contributing to each marginal mean,
For an interaction component, take an outer product of contrast coefficients:
For example, A-linear × B-quadratic uses
The four interaction components , , , and partition the four interaction df in the balanced design. Each can be tested as a one-df contrast using the common MSE; adjust for multiplicity when making joint claims.
Polynomial contrasts require quantitative levels. The displayed coefficients assume equal spacing and balanced replication; arbitrary category labels do not have a linear or quadratic trend.
When Replicate Groups Are Blocks¶
If each complete factorial replicate was run in a different batch or week, the replicate index may represent a nuisance block. With complete blocks, one observation per treatment combination in each block, use
For a factorial in two complete blocks, residual df is 8, compared with 9 when the two replicates are treated as unstructured replication. The treatment SS remain unchanged in this balanced orthogonal layout; MSE changes.
This model assumes treatment-block interactions are negligible. Without replication within each treatment-block cell, general treatment-block interactions cannot be separated from pure error. Design the blocking and randomization before collecting data.
More Than Two Factors¶
With three design factors, the full model includes A, B, C, AB, AC, BC, and ABC. An ABC interaction means that the AB interaction changes across C levels.
| Term | df |
|---|---|
| A, B, C | , , |
| AB, AC, BC | , , |
| ABC | |
| Error with replicates per cell |
The model’s non-intercept df sum to . With , all df are consumed: more factors do not remove the need for replication or justified error assumptions.