February 24

ST 516
Experimental Statistics for Engineers II
Two-Level Factors: The 2k Factorial Design
When several factors may affect a response, often each has just two
levels; e.g.:
comparing two methods for one step in a process;
presence or absence of some ingredient;
low and high settings of a quantitative factor.
1 / 13
The 2k Factorial Design
Introduction
ST 516
Experimental Statistics for Engineers II
k factors, each with 2 levels, give 2k treatment combinations.
The 2k (full, or complete) factorial design uses all 2k treatments.
It requires the fewest runs of any factorial design for k factors.
Often used at an early stage: factor screening experiments.
2 / 13
The 2k Factorial Design
Introduction
ST 516
Experimental Statistics for Engineers II
The 22 Design
Notation
Factors are usually A, B, etc.
The two levels of each are usually denoted “+” and “-”.
E.g. 22 :
Factor
A B
+
+
3 / 13
+
+
Treatment
Combination
A low,
A high,
A low,
A high,
B
B
B
B
low
low
high
high
Treatment Total of
Label
Responses
(1)
a
b
ab
The 2k Factorial Design
The 22 Design
(1)
a
b
ab
ST 516
Experimental Statistics for Engineers II
Hand calculation of effects
Simple effect of A at low level of B is difference between average
responses: na − (1)
, where n = number of replicates.
n
Simple effect of A at high level of B is difference between average
responses: ab
− bn .
n
Main effect of A (also denoted A) is the average of these:
A=
4 / 13
1
[ab + a − b − (1)]
2n
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
Similarly main effect of B is
B=
1
[ab + b − a − (1)]
2n
The interaction effect AB is one half of the difference between:
the simple effect of A at the high level of B; and
the simple effect of A at the low level of B:
1
AB = [ab + (1) − a − b]
2n
AB is also (one half of) the difference between the effects of B at
the two levels of A.
5 / 13
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
Example: 22 with 3 replications
Factors:
A = reactant concentration, levels 15% and 25%;
B = catalyst, levels 1lb and 2lb.
Response: yield.
6 / 13
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
Data: (yield.txt)
A
+
+
+
+
+
+
B
+
+
+
+
+
+
Rep
I
I
I
I
II
II
II
II
III
III
III
III
Yield
28
36
18
31
25
32
19
30
27
32
23
29
Note
The runs are listed in the “standard” order; in a CRD, they would be
carried out in a random order.
7 / 13
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
R Analysis of Variance
yield <- read.table("data/yield.txt", header = TRUE)
par(mfrow = c(1, 2))
plot(Yield ~ A * B, yield)
par(mfrow = c(1, 1))
with(yield, interaction.plot(A, B, Yield))
summary(aov(Yield ~ A * B, yield))
plot(aov(Yield ~ A * B, yield)); # the usual suspects
Output
Df Sum Sq Mean Sq
A
1 208.333 208.333
B
1 75.000 75.000
A:B
1
8.333
8.333
Residuals
8 31.333
3.917
--Signif. codes: 0 *** 0.001 **
8 / 13
F value
Pr(>F)
53.1915 8.444e-05 ***
19.1489 0.002362 **
2.1277 0.182776
0.01 * 0.05 . 0.1
The 2k Factorial Design
1
The 22 Design
ST 516
Experimental Statistics for Engineers II
Effects
Fit the regression equation, with versions of the factors coded as −1
for low levels of each, and +1 for high levels:
coded <- function(x) ifelse(x == x[1], -1, 1)
summary(lm(Yield ~ coded(A) * coded(B), yield))
9 / 13
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
Output
Call:
lm(formula = Yield ~ coded(A) * coded(B), data = yield)
Residuals:
Min
1Q Median
-2.000 -1.333 -0.500
3Q
1.083
Max
3.000
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)
27.5000
0.5713 48.135 3.84e-11 ***
coded(A)
4.1667
0.5713
7.293 8.44e-05 ***
coded(B)
-2.5000
0.5713 -4.376 0.00236 **
coded(A):coded(B)
0.8333
0.5713
1.459 0.18278
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1
1
Residual standard error: 1.979 on 8 degrees of freedom
Multiple R-Squared: 0.903,
Adjusted R-squared: 0.8666
F-statistic: 24.82 on 3 and 8 DF, p-value: 0.0002093
10 / 13
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
Note
A coefficient in a regression equation is the change in the response
when the corresponding variable changes by +1.
As A or B changes from its low level to its high level, the coded
variable changes by 1 − (−1) = +2, so the change in the response is
twice the regression coefficient.
So the effects and interaction(s) are twice the values in the
“Estimate” column.
These regression coefficients are often called effects and interactions,
even though they differ from the definitions given earlier.
11 / 13
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
Hand calculation of effects and interactions
Yates’s algorithm:
Sums
Intermediate Step
(1)
a
b
ab
(1) + a
b + ab
−(1) + a
−b + ab
Effects
(1) + a + b + ab
−(1) + a − b − ab
−(1) − a + b + ab
(1) − a − b + ab
=
=
=
=
4nµ̂
2nA
2nB
2nAB
Eight additions and subtractions instead of twelve! (More advantage
for large k.)
12 / 13
The 2k Factorial Design
The 22 Design
ST 516
Experimental Statistics for Engineers II
Response surface
When both A and B are quantitative, the regression equation can be
used to predict the expected response at other values of the factors:
yield <- within(yield, {cA = coded(A); cB = coded(B)})
yieldLm <- lm(Yield ~ cA * cB, data = yield)
ngrid <- 20
Agrid <- Bgrid <- seq(from = -1, to = 1, length = ngrid)
yhat <- predict(yieldLm, expand.grid(cA = Agrid, cB = Bgrid))
yhat <- matrix(yhat, length(Agrid), length(Bgrid))
persp(Agrid, Bgrid, yhat, theta = -40, phi = 30)
# in real values:
persp(20 + 5 * Agrid, 1.5 + 0.5 * Bgrid, yhat, theta = -40, phi = 30,
ticktype = "d", xlab = "Reactant Concentration", ylab = "Catalyst")
13 / 13
The 2k Factorial Design
The 22 Design