In a process development study on yield, four factors were studied, each at two levels: time (A), concentration (B), pressure (C), and temperature (D).
Loading the data into R
library(DoE.base)
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)
Using DoE package and finding the factors that appear to be significant
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 -1.027824e-16
## C:D A:B:C A:B:D A:C:D B:C:D
## -1.595946e-16 5.000000e-01 3.750000e-01 -1.250000e-01 -3.750000e-01
## A:B:C:D
## 5.000000e-01
halfnormal(mod)
Based on the above plot, we can observe that the significant factors are A, D, A:D & A:C (On this last term, We have to keep the āCā term because its embedded.)
The significant factors are A, D, A:D & A:C (On this last term, We have to keep the āCā term because its embedded.) to analyze the interaction. Therefore the interaction should be between A, C, D, A:D & A:C.
pullmod<- aov(obs~A+C+D+A*D+A*C,data = dat)
summary(pullmod)
## 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:D 1 64.00 64.00 39.385 9.19e-05 ***
## A:C 1 72.25 72.25 44.462 5.58e-05 ***
## Residuals 10 16.25 1.62
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ANOVA analysis tell us that factors A,C,D,AC & AD are all significant at a 95% confidence interval
#A
library(DoE.base)
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)
mod<-lm(obs~A*B*C*D,data=dat)
coef(mod)
halfnormal(mod)
#B
pullmod<- aov(obs~A+C+D+A*D+A*C,data = dat)
summary(pullmod)