Estimate main effects and interactions from a 2^k factorial experiment and interpret them.
Why this matters
The intuitive way to study several factors is one factor at a time (OFAT): hold everything fixed, vary temperature, pick the best; then vary pressure, pick the best; and so on. It is slow, and worse, it can miss the best settings completely when factors interact. Factorial designs vary all factors together in a planned pattern. With the same number of runs they estimate every main effect more precisely than OFAT and they reveal interactions. The 2^k factorial, with every factor at two levels, is the backbone of industrial experimentation, process development and screening studies.
The 2^k design
Each of k factors gets a low and a high level, coded −1 and +1. Run every combination: 2^k runs. For three factors, temperature (A), pressure (B) and catalyst type (C), that is 8 runs. In standard (Yates) order, A alternates fastest:
run A B C yield
1 -1 -1 -1 60
2 +1 -1 -1 72
3 -1 +1 -1 54
4 +1 +1 -1 68
5 -1 -1 +1 52
6 +1 -1 +1 83
7 -1 +1 +1 45
8 +1 +1 +1 80
Standard order is for writing the design down. You run it in a randomised order, as in lesson 4.
Estimating effects
The main effect of a factor is the average response at its high level minus the average at its low level:
A effect = mean(runs 2,4,6,8) - mean(runs 1,3,5,7)
= (72 + 68 + 83 + 80)/4 - (60 + 54 + 52 + 45)/4 = 75.75 - 52.75 = 23.0
Every run is used for every effect. That is where the efficiency comes from.
For an interaction, multiply the coded columns. The AC column is A × C, and the AC effect is the mean response where AC = +1 minus the mean where AC = −1:
AC signs: +1 -1 +1 -1 -1 +1 -1 +1
AC effect = (60 + 54 + 83 + 80)/4 - (72 + 68 + 52 + 45)/4 = 69.25 - 59.25 = 10.0
The full set for this example:
A = 23.0 B = -5.0 C = 1.5 AB = 1.5 AC = 10.0 BC = 0.0 ABC = 0.5
Interpreting an interaction
AC = 10 means the effect of temperature depends on the catalyst. Split by catalyst:
catalyst C = -1: temperature effect = mean(72, 68) - mean(60, 54) = 70 - 57 = 13
catalyst C = +1: temperature effect = mean(83, 80) - mean(52, 45) = 81.5 - 48.5 = 33
The AC effect is half the difference: (33 − 13)/2 = 10. In an interaction plot (temperature on the x-axis, one line per catalyst) the lines are not parallel. The main effect of C is small (1.5), but saying "catalyst does not matter" would be wrong: catalyst +1 is worse at low temperature and much better at high temperature. When an interaction is large, interpret the factors together, not separately.
OFAT can easily miss this. If the team had first compared the two catalysts at the low temperature and low pressure, catalyst +1 would have looked worse (52 against 60) and been dropped, and the best combination in the design (high temperature with catalyst +1, 83) would never have been run.
Which effects are real?
With a single replicate there is no pure-error estimate, so you cannot run an ordinary ANOVA. Options:
- Replicate the design (16 runs for two replicates) and use ANOVA or regression with the usual error term.
- Add centre points (runs at the middle of every factor): they give a pure-error estimate and a test for curvature.
- Use a normal probability (Daniel) plot or half-normal plot of the effects. Most effects in a real process are near zero (effect sparsity), so they fall on a straight line; real effects stand out. Lenth's method turns that into a formal test.
- Assume high-order interactions (ABC) are negligible and pool them into error.
In regression form, a 2^k analysis is simply y ~ A * B * C with coded −1/+1 predictors. Each regression coefficient is half the effect (because the coded range from −1 to +1 is 2 units):
import statsmodels.formula.api as smf
model = smf.ols("yld ~ A * B * C", data=df).fit() # A, B, C coded -1/+1
print(2 * model.params) # effects
With 8 runs and 8 parameters this model fits perfectly, which is why you need replicates, centre points or a pooled error term for inference.
Fractional factorials
With 7 factors a full factorial needs 128 runs. A fractional factorial runs a planned subset, for example 2^(7−4) = 8 runs, at the cost of aliasing: some effects cannot be separated from others. The resolution tells you how bad the aliasing is. In a resolution III design, main effects are aliased with two-factor interactions; in resolution IV, main effects are clear of two-factor interactions; in resolution V, two-factor interactions are clear of each other. Screening experiments often start with a resolution III or IV fraction, then "fold over" or augment the design to untangle what matters.
Common mistakes
- Running in standard order instead of randomising.
- Choosing levels too close together, so effects are lost in noise. Make the range as wide as is safe and practical.
- Interpreting main effects when a large interaction is present.
- Ignoring curvature. A two-level design only sees straight lines. Centre points tell you whether the optimum may lie inside the region, which leads to the response-surface methods in module 3.
Quick recap
- A 2^k factorial runs every combination of k two-level factors.
- Effect = mean at +1 minus mean at −1, using contrast columns; interactions use products of columns.
- Interactions mean "it depends": interpret factors together.
- Without replication, judge effects with a normal plot, centre points or pooled interactions.
Try it
In the Do tab you will build contrast columns for a 2³ design and compute all seven effects for the yield data above.