Four factors at two levels each (time A, concentration B, pressure C, temperature D), one replicate of a 2^4 design (16 runs). The runs are entered in standard order (Run Number); the actual run order only describes the randomization and is not used in the model.
A <- c(-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1)
B <- c(-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1)
C <- c(-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1,1,1,1,1)
D <- c(-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1)
obs <- c(12,18,13,16,17,15,20,15,10,25,13,24,19,21,17,23)
dat <- data.frame(A,B,C,D,obs)
dat
## A B C D obs
## 1 -1 -1 -1 -1 12
## 2 1 -1 -1 -1 18
## 3 -1 1 -1 -1 13
## 4 1 1 -1 -1 16
## 5 -1 -1 1 -1 17
## 6 1 -1 1 -1 15
## 7 -1 1 1 -1 20
## 8 1 1 1 -1 15
## 9 -1 -1 -1 1 10
## 10 1 -1 -1 1 25
## 11 -1 1 -1 1 13
## 12 1 1 -1 1 24
## 13 -1 -1 1 1 19
## 14 1 -1 1 1 21
## 15 -1 1 1 1 17
## 16 1 1 1 1 23
Since the design is unreplicated, the full model uses all 15 degrees of freedom and there is no degree of freedom left for error, so the F tests cannot be done. The half normal plot is used instead.
mod <- lm(obs ~ A*B*C*D, data = dat)
coef(mod)
## (Intercept) A B C D
## 1.737500e+01 2.250000e+00 2.500000e-01 1.000000e+00 1.625000e+00
## A:B A:C B:C A:D B:D
## -3.750000e-01 -2.125000e+00 1.250000e-01 2.000000e+00 -6.595890e-16
## C:D A:B:C A:B:D A:C:D B:C:D
## -2.984437e-16 5.000000e-01 3.750000e-01 -1.250000e-01 -3.750000e-01
## A:B:C:D
## 5.000000e-01
halfnormal(mod)
##
## Significant effects (alpha=0.05, Lenth method):
## [1] A A:C A:D D
Each coefficient is half of the corresponding effect (effect = 2 x coefficient). Effects that are not significant behave like random error and fall on a straight line near the origin. The effects that fall away from the line are the significant ones. The plot (Lenth method, alpha = 0.05) labels A, A:C, A:D and D as significant, with these effects (the plot shows the absolute coefficients, which are half of the effects):
| Effect | Estimate |
|---|---|
| A | 4.50 |
| AC | -4.25 |
| AD | 4.00 |
| D | 3.25 |
A, D, AC and AD clearly stand out from the line. All the other effects (B and every interaction that involves B, plus CD, ABC, ACD and ABCD) lie on the line near the origin and look like random error. Factor B does not appear to be significant.
Factor C (effect 2.00) lies on the line, but it is part of the significant interaction AC, so it stays in the model (if an interaction is kept, the main effects of both factors are kept).
The terms that do not appear to be significant (B, AB, BC, BD, CD, ABC, ABD, ACD, BCD, ABCD) are left out of the model, so their sums of squares and degrees of freedom are pooled into the error. The model keeps A, C, D, AC and AD:
mod2 <- aov(obs ~ A + C + D + A:C + A:D, data = dat)
summary(mod2)
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 81.00 81.00 49.846 3.46e-05 ***
## C 1 16.00 16.00 9.846 0.010549 *
## D 1 42.25 42.25 26.000 0.000465 ***
## A:C 1 72.25 72.25 44.462 5.58e-05 ***
## A:D 1 64.00 64.00 39.385 9.19e-05 ***
## Residuals 10 16.25 1.62
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The error now has 10 degrees of freedom (the 10 terms pulled into error) and MSE = 1.625.
Conclusion: at the 0.05 level, all the terms kept in the model are significant:
| Term | p-value |
|---|---|
| A (time) | 0.00003 |
| C (pressure) | 0.0106 |
| D (temperature) | 0.00046 |
| A:C | 0.00006 |
| A:D | 0.00009 |
Time (A), pressure (C) and temperature (D) affect the yield, and A interacts with both C and D, so the effect of time depends on the pressure and on the temperature, and these factors should be interpreted together. Concentration (B) does not affect the yield.