Getting the data

response <- c(12,18,13,16,17,15,20,15,10,25,13,24,19,21,17,23)
a <- c(-1,1)
b <- c(-1,-1,1,1)
c <- c(-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)

A <- c(rep(a,8))
B <- c(rep(b,4))
C <- c(rep(c,2))
D <- c(rep(d,1))

dat1 <- cbind(A,B,C,D,response)

dat <- as.data.frame(dat1)
dat
##     A  B  C  D response
## 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

Q1) a) Display the halfnormal plot for this data and determine which factors appear to be significant.

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
model <- lm(response~A*B*C*D,data = dat)
halfnormal(model)
## 
## Significant effects (alpha=0.05, Lenth method):
## [1] A   A:C A:D D

We can see from above that significant factors in model are A,D,AD and AC .As these are fall far away from the normal line .

As AD and AC are also significant hence following are factors that we will have to consider

A, C , D, AC , AD

Q1) b) Pull terms that do not appear to be significant into error and test for the significance of the other effects at the 0.05 level of significance.

Following will be all hypothesis for two interaction and 3 main effects

Null Hypothesis : \(\alpha\gamma_{ik} = 0\)

Alternative Hypothesis : \(\alpha\gamma_{ik}\) \(\neq\) 0

Null Hypothesis : \(\alpha\lambda_{il} = 0\)

Alternative Hypothesis : \(\alpha\lambda_{il}\) \(\neq\) 0

Null Hypothesis : \(\alpha_i = 0\)

Alternative Hypothesis : \(\alpha_i\) \(\neq\) 0

Null Hypothesis : \(\gamma_k\) = 0

Alternative Hypothesis : \(\gamma_k\) \(\neq\) 0

Null Hypothesis : \(\lambda_l\) = 0

Alternative Hypothesis : \(\lambda_l\) \(\neq\) 0

model2 <- aov(response~A+C+D+A*C+A*D,data = dat)
summary(model2)
##             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

We can see from above analysis that ,

Pvalue of AD interaction , 9.19e-05 < 0.05 , hence we conclude that we reject the Null Hypothesis and we say that interaction is present

Pvalue of AC interaction ,5.58e-05 < 0.05 , hence we conclude that we reject the Null Hypothesis and we say that interaction is present

As we said that interaction is present , hence following are the interaction plot for both AD and AC

Plot for AD

interaction.plot(A,D,response)

Plot for AC

interaction.plot(A,C,response)

Source COde

response <- c(12,18,13,16,17,15,20,15,10,25,13,24,19,21,17,23)
a <- c(-1,1)
b <- c(-1,-1,1,1)
c <- c(-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)

A <- c(rep(a,8))
B <- c(rep(b,4))
C <- c(rep(c,2))
D <- c(rep(d,1))

dat1 <- cbind(A,B,C,D,response)

dat <- as.data.frame(dat1)
dat
library(DoE.base)
model <- lm(response~A*B*C*D,data = dat)
halfnormal(model)
model2 <- aov(response~A+C+D+A*C+A*D,data = dat)
summary(model2)
interaction.plot(A,D,response)
interaction.plot(A,C,response)