In a process development study on yield, four factors were studied, each at two levels: time (A), concentration (B), pressure (C), and temperature (D).
First we start with the data input from the table given to us in the
question:
library(DoE.base)
## Loading required package: grid
## Loading required package: conf.design
## Registered S3 method overwritten by 'DoE.base':
## method from
## factorize.factor conf.design
##
## Attaching package: 'DoE.base'
## The following objects are masked from 'package:stats':
##
## aov, lm
## The following object is masked from 'package:graphics':
##
## plot.design
## The following object is masked from 'package:base':
##
## lengths
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,20,17,25,15,25,10,24,13,24,19,21,17,23)
dat<-data.frame(A,B,C,D,obs)
For calculating the halfnormal plotting :
mod<-lm(obs~A*B*C*D,data = dat)
coef(mod)
## (Intercept) A B C D A:B
## 18.500 4.000 0.250 1.750 0.375 0.250
## A:C B:C A:D B:D C:D A:B:C
## -0.750 -0.500 0.125 0.125 -0.625 0.500
## A:B:D A:C:D B:C:D A:B:C:D
## -0.125 -1.375 0.125 0.375
halfnormal(mod)
##
## Significant effects (alpha=0.05, Lenth method):
## [1] A C A:C:D
We observe that the significant factors are A, C and A:C:D, therefore the interaction should be between A, C, D, AC, AD.
Hypothesis :
Null : \(\alpha_i=0\)
Alternative: \(\alpha_i\not=0\)
Null: \(\beta_j=0\)
Alternative: \(\beta_j\not=0\)
Null: \(\gamma_k=0\)
Alternative: \(\gamma_k\not=0\)
Null: \(\lambda_l=0\)
Alternative: \(\lambda_l\not=0\)
model<-aov(obs~A+C+D+A*C+A*D)
model
## Call:
## aov.default(formula = obs ~ A + C + D + A * C + A * D)
##
## Terms:
## A C D A:C A:D Residuals
## Sum of Squares 256.00 49.00 2.25 9.00 0.25 49.50
## Deg. of Freedom 1 1 1 1 1 10
##
## Residual standard error: 2.22486
## Estimated effects are balanced
We can observe the degrees of freedom above.
interaction.plot(A, D, obs)
interaction.plot(A, C, obs)
We can conclude from this that the interaction do not take place but are really close and therefore the significant point i.e. A, C, D show what effects are there with respect to the observations.