Professional Documents
Culture Documents
Jesper Rydén
Matematiska institutionen, Uppsala universitet
jesper@math.uu.se
Two factors A and B, each run at two levels (“low” and “high”).
Completely randomized experiment — the order in which the runs
are made is random.
A B Treatment combination
(1) − − A low, B low
(a) + − A high, B low
(b) − + A low, B high
(ab) + + A high, B high
Example of 22 design
Example: Chemical process, response variable is yield.
Factor A: reactant concentration (15 or 25 percent).
Factor B: amount of catalyst (1 pound or 2 pounds).
The experiment is replicated n = 3 times, in all 12 runs.
Example: R code and ANOVA table
y = c(28,36,18,31,25,32,19,30,27,32,23,29)
Conc = rep(c(-1,1),6)
Am = rep(c(-1,-1,1,1),3)
mod22 = lm(y ~ Conc + Am + Conc*Am)
anova(mod22)
Response: y
Df Sum Sq Mean Sq F value Pr(>F)
Conc 1 208.333 208.333 53.1915 8.444e-05 ***
Am 1 75.000 75.000 19.1489 0.002362 **
Conc:Am 1 8.333 8.333 2.1277 0.182776
Residuals 8 31.333 3.917
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
R output, fitted model
summary(mod22)
Call:
lm(formula = y ~ Conc + Am + Conc * Am)
Residuals:
Min 1Q Median 3Q Max
-2.000 -1.333 -0.500 1.083 3.000
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 27.5000 0.5713 48.135 3.84e-11 ***
Conc 4.1667 0.5713 7.293 8.44e-05 ***
Am -2.5000 0.5713 -4.376 0.00236 **
Conc:Am 0.8333 0.5713 1.459 0.18278
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Matrices in a 22 design
Regression model for a general two-factor design:
y = β0 + β1 x1 + β2 x2 + β12 x1 x2
Let x1 denote factor A, x1 = −1 if low level, x1 = 1 otherwise.
Let x2 denote factor B, x2 = −1 if low level, x2 = 1 otherwise.
The matrix XT X is given as
2
2 n 0 0 0
2
0 2 n 0 0
XT X =
0 0 22 n 0
0 0 0 22 n
where n is the number of observations per treatment combination.
Its inverse:
1/22 n
0 0 0
0 1/22 n 0 0
(XT X)−1 =
0 2
0 1/2 n 0
0 0 0 1/22 n
Matrices in a 22 design
y = β0 + β1 x1 + β2 x2 + β12 x1 x2 .
For Lab. 1, the mean of the four observations is 27.25, for Lab. 2,
the corresponding mean is 33.50. If the eight observations are
regarded as one sample, its standard deviation is 8.879.
(a) Formulate a statistical model.
(b) Estimate main effects and interaction effects. Which effects
are statistically significant?
Example. An abbreviated experiment
Consider a 23 factorial experiment with the factors A, B and C
with response variable y (lifetime). However, there were
experimental difficulties when making the runs; the total
experiment was halted after only 4 runs.
Treatment Response
combination
a 43
b 35
c 44
abc 39
(a) Write down the table with signs for contrasts for the
performed experiment.
(b) Comment on the contrasts in your table. Are the contrasts
orthogonal? Are main effects orthogonal to each other?
This abbreviated experiment is called a fractional factorial.