Given, experiment is 2^2 design with two factors namely time and culture medium.
Here, k=2 and n=6
Model Equation
Y{ijk}= \(\mu\)+\(\alpha_{i}\)+\(\beta_{j}\)+\(\alpha\beta_{ij}\)+\(\epsilon_{ijk}\)
Where
\(\alpha_i\) is Main Effects of Factor A
\(\beta_j\) is Main Effects of Factor B
\(\alpha\beta_{ij}\) is Interaction effects of Factors A and Factors B
Hypothesis to be tested
Null Hypothesis(Ho): \(\alpha_i=0\) For all i
Alternative Hypothesis(Ha): \(\alpha_i\neq0\) For some i
Null Hypothesis(Ho): \(\beta_j=0\) For all i
Alternative Hypothesis(Ha): \(\beta_j\neq0\) For some i
Null Hypothesis(H0):\(\alpha\beta_{ij}=0\) For all ij
Alternative Hypothesis(Ha):\(\alpha\beta_{ij}\neq0\) For some ij
we will test first highest order interaction effects hypothesis
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.1 (2020-08-26 16:20:06 UTC) successfully loaded. See ?R.methodsS3 for help.
observations<-c(21,22,25,26,23,28,24,25,20,26,29,27,37,39,31,34,38,38,29,33,35,36,30,35)
cmedium<-c(rep(1,2),rep(2,2),rep(1,2),rep(2,2),rep(1,2),rep(2,2),rep(1,2),rep(2,2),rep(1,2),rep(2,2),rep(1,2),rep(2,2))
t<-c(rep(12,12),rep(18,12))
cmedium<-as.fixed(cmedium)
t<-as.fixed(t)
df<-data.frame(observations,cmedium,t)
model<-aov(observations~cmedium+t+cmedium*t, data = df)
GAD::gad(model)
## Analysis of Variance Table
##
## Response: observations
## Df Sum Sq Mean Sq F value Pr(>F)
## cmedium 1 9.38 9.38 1.8352 0.1906172
## t 1 590.04 590.04 115.5057 9.291e-10 ***
## cmedium:t 1 92.04 92.04 18.0179 0.0003969 ***
## Residual 20 102.17 5.11
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
interaction.plot(t,cmedium,observations, type = "l",main ="Interraction Plot",col='darkred')
plot(model)
From the results of gad test, the p-value of interaction effect is 0.0003969, which is lesser than the \(\alpha\)=0.05,hence we conclude that we reject the null hypothesis.We also conclude that there is significance interaction between present between two factors which can be seen from Interaction plot.
Since we have rejected the null hypothesis,then we must stop exploration on the associated factors
From the residual plot we can conclude that data is normally distributed except few outliners, but variances are widely spread and hence are not constant. Hence we can conclude that model is not adequate
Hypothesis to be tested
Null Hypothesis(Ho): \(\alpha_i=0\) For all i
Alternative Hypothesis(Ha): \(\alpha_i\neq0\) For some i
Null Hypothesis(Ho): \(\beta_j=0\) For all i
Alternative Hypothesis(Ha): \(\beta_j\neq0\) For some i
Null Hypothesis(H0):\(\alpha\beta_{ij}=0\) For all ij
Alternative Hypothesis(Ha):\(\alpha\beta_{ij}\neq0\) For some ij
we will test first highest order interaction effects hypothesis
**To calculate factor effects, we know according to formula, Effect= 2(Contrast)/((2^k)*n)**
Where, k= Number of factors and n= Number of replicates
Here, k=2 and n=4
a<-c(13.880,13.860,14.032,13.914)
b<-c(14.821,14.757,14.853,14.878)
ab<-c(14.888,14.921,14.415,14.932)
one<-c(14.037,16.165,13.972,13.907)
add_a<-sum(a)
add_b<-sum(b)
add_ab<-sum(ab)
add_one<-sum(one)
facteffe_a<-(2*(add_a+add_ab-add_b-add_one))/(2^2*4)
facteffe_b<-(2*(add_b+add_ab-add_a-add_one))/(2^2*4)
facteffe_ab<-(2*(add_a+add_b-add_ab-add_one))/(2^2*4)
facteffe_a
## [1] -0.3185
facteffe_b
## [1] 0.58725
facteffe_ab
## [1] -0.28025
The factor effect are as follows
Factor Effect of A= -0.3185
Factor Effect of B= 0.58725
Factor Effect of AB= -0.28025
Now, we will conduct analysis of variance using anova
thick<-c(14.037,16.165,13.972,13.907,13.880,13.860,14.032,13.914,14.821,14.757,14.843,14.878,14.888,14.921,14.415,14.932)
factA<-c(rep(-1,4),rep(1,4),rep(-1,4),rep(1,4))
factB<-c(rep(-1,4),rep(-1,4),rep(1,4),rep(1,4))
df<-data.frame(thick,factA,factB)
df
## thick factA factB
## 1 14.037 -1 -1
## 2 16.165 -1 -1
## 3 13.972 -1 -1
## 4 13.907 -1 -1
## 5 13.880 1 -1
## 6 13.860 1 -1
## 7 14.032 1 -1
## 8 13.914 1 -1
## 9 14.821 -1 1
## 10 14.757 -1 1
## 11 14.843 -1 1
## 12 14.878 -1 1
## 13 14.888 1 1
## 14 14.921 1 1
## 15 14.415 1 1
## 16 14.932 1 1
model<-aov(thick~factA+factB+factA*factB,data = df)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## factA 1 0.403 0.4026 1.262 0.2833
## factB 1 1.374 1.3736 4.305 0.0602 .
## factA:factB 1 0.317 0.3170 0.994 0.3386
## Residuals 12 3.828 0.3190
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the results of anova test,the p-value of interaction between Factor A and Factor B is 0.3386 which is higher than \(\alpha\) =0.05. Hence we conclude that we failed to reject the null hypothesis. We also conclude that there is no significant interaction between the two factors
Now we will perform anova test neglecting the non significant interaction effects of factor A and factor B
model1<-aov(thick~factA+factB,data = df)
summary(model1)
## Df Sum Sq Mean Sq F value Pr(>F)
## factA 1 0.403 0.4026 1.263 0.2815
## factB 1 1.374 1.3736 4.308 0.0584 .
## Residuals 13 4.145 0.3189
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
coef(model)
## (Intercept) factA factB factA:factB
## 14.513875 -0.158625 0.293000 0.140750
plot(model)
## hat values (leverages) are all = 0.25
## and there are no factor predictors; no plot no. 5
From the results of anova, the p-value for Factor A(Flow rate) and Factor B (Deposition Time) is 0.2815 and 0.0584 respectively which is greater than the \(\alpha\)=0.05.Hence we conclude that we failed to reject the null hypothesis
The regression equation can be written as
Y=14.513875−0.158625(factA)+0.293(factB)+0.14075(AB)+Error
From the residual plots and normal plot we can conclude that observation 2 deviates from the normal line and also in the residual vs fitted plot
From the normal plot we can conclude that there are few outliners present in the observations which deviates from the normality. Also, variances are not constant and are widely spread
To deal with the outliners we may replace the particular observation with the average of the observations from that respective cell
we will test first highest order interaction effects hypothesis
Null Hypothesis(H0):\(\alpha\beta\gamma\delta_{ijkl}=0\) For all ijkl
Alternative Hypothesis(Ha):\(\alpha\beta\gamma\delta_{ijkl}\neq0\) For some ijkl
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
dist<-c(10,18,14,12.5,19,16,18.5,0,16.5,4.5,17.5,20.5,17.5,33,4,6,1,14.5,12,14,5,0,10,34,11,25.5,21.5,0,0,0,18.5,19.5,16,15,11,5,20.5,18,20,29.5,19,10,6.5,18.5,7.5,6,0,10,0,16.5,4.5,0,23.5,8,8,8,4.5,18,14.5,10,0,17.5,6,19.5,18,16,5.5,10,7,36,15,16,8.5,0,0.5,9,3,41.5,39,6.5,3.5,7,8.5,36,8,4.5,6.5,10,13,41,14,21.5,10.5,6.5,0,15.5,24,16,0,0,0,4.5,1,4,6.5,18,5,7,10,32.5,18.5,8)
lofp<-c(rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7),rep(-1,7),rep(1,7))
tofp<- c(rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7))
bofp<-c(rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7))
sofp<-c(rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(-1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7),rep(1,7))
df<-data.frame(dist,lofp,tofp,bofp,sofp)
df
## dist lofp tofp bofp sofp
## 1 10.0 -1 -1 -1 -1
## 2 18.0 -1 -1 -1 -1
## 3 14.0 -1 -1 -1 -1
## 4 12.5 -1 -1 -1 -1
## 5 19.0 -1 -1 -1 -1
## 6 16.0 -1 -1 -1 -1
## 7 18.5 -1 -1 -1 -1
## 8 0.0 1 -1 -1 -1
## 9 16.5 1 -1 -1 -1
## 10 4.5 1 -1 -1 -1
## 11 17.5 1 -1 -1 -1
## 12 20.5 1 -1 -1 -1
## 13 17.5 1 -1 -1 -1
## 14 33.0 1 -1 -1 -1
## 15 4.0 -1 1 -1 -1
## 16 6.0 -1 1 -1 -1
## 17 1.0 -1 1 -1 -1
## 18 14.5 -1 1 -1 -1
## 19 12.0 -1 1 -1 -1
## 20 14.0 -1 1 -1 -1
## 21 5.0 -1 1 -1 -1
## 22 0.0 1 1 -1 -1
## 23 10.0 1 1 -1 -1
## 24 34.0 1 1 -1 -1
## 25 11.0 1 1 -1 -1
## 26 25.5 1 1 -1 -1
## 27 21.5 1 1 -1 -1
## 28 0.0 1 1 -1 -1
## 29 0.0 -1 -1 1 -1
## 30 0.0 -1 -1 1 -1
## 31 18.5 -1 -1 1 -1
## 32 19.5 -1 -1 1 -1
## 33 16.0 -1 -1 1 -1
## 34 15.0 -1 -1 1 -1
## 35 11.0 -1 -1 1 -1
## 36 5.0 1 -1 1 -1
## 37 20.5 1 -1 1 -1
## 38 18.0 1 -1 1 -1
## 39 20.0 1 -1 1 -1
## 40 29.5 1 -1 1 -1
## 41 19.0 1 -1 1 -1
## 42 10.0 1 -1 1 -1
## 43 6.5 -1 1 1 -1
## 44 18.5 -1 1 1 -1
## 45 7.5 -1 1 1 -1
## 46 6.0 -1 1 1 -1
## 47 0.0 -1 1 1 -1
## 48 10.0 -1 1 1 -1
## 49 0.0 -1 1 1 -1
## 50 16.5 1 1 1 -1
## 51 4.5 1 1 1 -1
## 52 0.0 1 1 1 -1
## 53 23.5 1 1 1 -1
## 54 8.0 1 1 1 -1
## 55 8.0 1 1 1 -1
## 56 8.0 1 1 1 -1
## 57 4.5 -1 -1 -1 1
## 58 18.0 -1 -1 -1 1
## 59 14.5 -1 -1 -1 1
## 60 10.0 -1 -1 -1 1
## 61 0.0 -1 -1 -1 1
## 62 17.5 -1 -1 -1 1
## 63 6.0 -1 -1 -1 1
## 64 19.5 1 -1 -1 1
## 65 18.0 1 -1 -1 1
## 66 16.0 1 -1 -1 1
## 67 5.5 1 -1 -1 1
## 68 10.0 1 -1 -1 1
## 69 7.0 1 -1 -1 1
## 70 36.0 1 -1 -1 1
## 71 15.0 -1 1 -1 1
## 72 16.0 -1 1 -1 1
## 73 8.5 -1 1 -1 1
## 74 0.0 -1 1 -1 1
## 75 0.5 -1 1 -1 1
## 76 9.0 -1 1 -1 1
## 77 3.0 -1 1 -1 1
## 78 41.5 1 1 -1 1
## 79 39.0 1 1 -1 1
## 80 6.5 1 1 -1 1
## 81 3.5 1 1 -1 1
## 82 7.0 1 1 -1 1
## 83 8.5 1 1 -1 1
## 84 36.0 1 1 -1 1
## 85 8.0 -1 -1 1 1
## 86 4.5 -1 -1 1 1
## 87 6.5 -1 -1 1 1
## 88 10.0 -1 -1 1 1
## 89 13.0 -1 -1 1 1
## 90 41.0 -1 -1 1 1
## 91 14.0 -1 -1 1 1
## 92 21.5 1 -1 1 1
## 93 10.5 1 -1 1 1
## 94 6.5 1 -1 1 1
## 95 0.0 1 -1 1 1
## 96 15.5 1 -1 1 1
## 97 24.0 1 -1 1 1
## 98 16.0 1 -1 1 1
## 99 0.0 -1 1 1 1
## 100 0.0 -1 1 1 1
## 101 0.0 -1 1 1 1
## 102 4.5 -1 1 1 1
## 103 1.0 -1 1 1 1
## 104 4.0 -1 1 1 1
## 105 6.5 -1 1 1 1
## 106 18.0 1 1 1 1
## 107 5.0 1 1 1 1
## 108 7.0 1 1 1 1
## 109 10.0 1 1 1 1
## 110 32.5 1 1 1 1
## 111 18.5 1 1 1 1
## 112 8.0 1 1 1 1
model<-lm(dist~lofp*tofp*bofp*sofp, data = df)
halfnormal(model)
## Warning in halfnormal.lm(model): halfnormal not recommended for models with more
## residual df than model df
##
## Significant effects (alpha=0.05, Lenth method):
## [1] lofp e95 e28 e44 e49 tofp e84 e32 e78
model<-aov(dist~lofp*tofp*bofp*sofp, data = df)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## lofp 1 917 917.1 10.588 0.00157 **
## tofp 1 388 388.1 4.481 0.03686 *
## bofp 1 145 145.1 1.676 0.19862
## sofp 1 1 1.4 0.016 0.89928
## lofp:tofp 1 219 218.7 2.525 0.11538
## lofp:bofp 1 12 11.9 0.137 0.71178
## tofp:bofp 1 115 115.0 1.328 0.25205
## lofp:sofp 1 94 93.8 1.083 0.30066
## tofp:sofp 1 56 56.4 0.651 0.42159
## bofp:sofp 1 2 1.6 0.019 0.89127
## lofp:tofp:bofp 1 7 7.3 0.084 0.77294
## lofp:tofp:sofp 1 113 113.0 1.305 0.25623
## lofp:bofp:sofp 1 39 39.5 0.456 0.50121
## tofp:bofp:sofp 1 34 33.8 0.390 0.53386
## lofp:tofp:bofp:sofp 1 96 95.6 1.104 0.29599
## Residuals 96 8316 86.6
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)
## hat values (leverages) are all = 0.1428571
## and there are no factor predictors; no plot no. 5
`From the results of anova, the p-value highest level of intraction that is lofp:tofp:bofp:sofp is 0.29599, which is greater than the \(\alpha\)=0.05.Hence we conclude that we failed to reject the null hypothesis
Also, the p-value of lofp and tofp is 0.00157 and 0.03686 respectively, which is lesser than \(\alpha\)=0.05, hence we conclude that we reject the null hypothesis and Length of put and type of put has significant effects on the putting performance.
From the normal plot we can conclude that there are few outliners present in the observations which deviates from the normality. Also, variances are not constant and are widely spread. Hence we conclude that model is not adequate
In the question, we have 2^4 factorial design. Hence the experiment has 2 levels of each factor and 4 number of factors without replications
library(DoE.base)
resistivity<-c(1.92,11.28,1.09,5.75,2.13,9.53,1.03,5.35,1.60,11.73,1.16,4.68,2.16,9.11,1.07,5.30)
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))
dat<-cbind(A,B,C,D,resistivity)
df<-as.data.frame(dat)
df
## A B C D resistivity
## 1 -1 -1 -1 -1 1.92
## 2 1 -1 -1 -1 11.28
## 3 -1 1 -1 -1 1.09
## 4 1 1 -1 -1 5.75
## 5 -1 -1 1 -1 2.13
## 6 1 -1 1 -1 9.53
## 7 -1 1 1 -1 1.03
## 8 1 1 1 -1 5.35
## 9 -1 -1 -1 1 1.60
## 10 1 -1 -1 1 11.73
## 11 -1 1 -1 1 1.16
## 12 1 1 -1 1 4.68
## 13 -1 -1 1 1 2.16
## 14 1 -1 1 1 9.11
## 15 -1 1 1 1 1.07
## 16 1 1 1 1 5.30
model<-lm(resistivity~A*B*C*D,data=df)
coef(model)
## (Intercept) A B C D A:B
## 4.680625 3.160625 -1.501875 -0.220625 -0.079375 -1.069375
## A:C B:C A:D B:D C:D A:B:C
## -0.298125 0.229375 -0.056875 -0.046875 0.029375 0.344375
## A:B:D A:C:D B:C:D A:B:C:D
## -0.096875 -0.010625 0.094375 0.141875
halfnormal(model)
##
## Significant effects (alpha=0.05, Lenth method):
## [1] A B A:B A:B:C
new_A<-as.factor(A)
new_B<-as.factor(B)
df1<-data.frame(resistivity,new_A,new_B)
df1
## resistivity new_A new_B
## 1 1.92 -1 -1
## 2 11.28 1 -1
## 3 1.09 -1 1
## 4 5.75 1 1
## 5 2.13 -1 -1
## 6 9.53 1 -1
## 7 1.03 -1 1
## 8 5.35 1 1
## 9 1.60 -1 -1
## 10 11.73 1 -1
## 11 1.16 -1 1
## 12 4.68 1 1
## 13 2.16 -1 -1
## 14 9.11 1 -1
## 15 1.07 -1 1
## 16 5.30 1 1
model1<-aov(resistivity~new_A*new_B,data = df1)
summary(model1)
## Df Sum Sq Mean Sq F value Pr(>F)
## new_A 1 159.83 159.83 333.09 4.05e-10 ***
## new_B 1 36.09 36.09 75.21 1.63e-06 ***
## new_A:new_B 1 18.30 18.30 38.13 4.76e-05 ***
## Residuals 12 5.76 0.48
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model1)
newdata<-log(resistivity)
df2<-data.frame(newdata,A,B,C,D)
df2
## newdata A B C D
## 1 0.65232519 -1 -1 -1 -1
## 2 2.42303125 1 -1 -1 -1
## 3 0.08617770 -1 1 -1 -1
## 4 1.74919985 1 1 -1 -1
## 5 0.75612198 -1 -1 1 -1
## 6 2.25444472 1 -1 1 -1
## 7 0.02955880 -1 1 1 -1
## 8 1.67709656 1 1 1 -1
## 9 0.47000363 -1 -1 -1 1
## 10 2.46214966 1 -1 -1 1
## 11 0.14842001 -1 1 -1 1
## 12 1.54329811 1 1 -1 1
## 13 0.77010822 -1 -1 1 1
## 14 2.20937271 1 -1 1 1
## 15 0.06765865 -1 1 1 1
## 16 1.66770682 1 1 1 1
model2<-lm(newdata~A*B*C*D,data = df2)
coef(model2)
## (Intercept) A B C D A:B
## 1.185417116 0.812870345 -0.314277554 -0.006408558 -0.018077390 -0.024684570
## A:C B:C A:D B:D C:D A:B:C
## -0.039723700 -0.004225796 -0.009578245 0.003708723 0.017780432 0.063434408
## A:B:D A:C:D B:C:D A:B:C:D
## -0.029875960 -0.003740235 0.003765760 0.031322043
halfnormal(model2)
##
## Significant effects (alpha=0.05, Lenth method):
## [1] A B A:B:C
new_A<-as.factor(A)
new_B<-as.factor(B)
df2<-data.frame(newdata,new_A,new_B)
df2
## newdata new_A new_B
## 1 0.65232519 -1 -1
## 2 2.42303125 1 -1
## 3 0.08617770 -1 1
## 4 1.74919985 1 1
## 5 0.75612198 -1 -1
## 6 2.25444472 1 -1
## 7 0.02955880 -1 1
## 8 1.67709656 1 1
## 9 0.47000363 -1 -1
## 10 2.46214966 1 -1
## 11 0.14842001 -1 1
## 12 1.54329811 1 1
## 13 0.77010822 -1 -1
## 14 2.20937271 1 -1
## 15 0.06765865 -1 1
## 16 1.66770682 1 1
model3<-aov(newdata~new_A*new_B,data = df2)
plot(model3)
df3<-data.frame(newdata,A,B)
df3
## newdata A B
## 1 0.65232519 -1 -1
## 2 2.42303125 1 -1
## 3 0.08617770 -1 1
## 4 1.74919985 1 1
## 5 0.75612198 -1 -1
## 6 2.25444472 1 -1
## 7 0.02955880 -1 1
## 8 1.67709656 1 1
## 9 0.47000363 -1 -1
## 10 2.46214966 1 -1
## 11 0.14842001 -1 1
## 12 1.54329811 1 1
## 13 0.77010822 -1 -1
## 14 2.20937271 1 -1
## 15 0.06765865 -1 1
## 16 1.66770682 1 1
model4<-lm(newdata~A+B,data = df3)
coef(model4)
## (Intercept) A B
## 1.1854171 0.8128703 -0.3142776
The factor effects are as follows
(Intercept) A B C D A:B A:C
4.680625 3.160625 -1.501875 -0.220625 -0.079375 -1.069375 -0.298125
B:C A:D B:D C:D A:B:C A:B:D A:C:D
0.229375 -0.056875 -0.046875 0.029375 0.344375 -0.096875 -0.010625
B:C:D A:B:C:D
0.094375 0.141875
From the halfnormal probability plot we can conclude that the factors A,B interaction AB are significatnt as these factors were deviating from the normality. We didnt considered ABC because it was almost normal Tentative model is
Resistivity= 4.680625 + 3.160625A -1.501875B -1.069375AB + \(\epsilon_{ijk}\)
From the anova test we can conclude that the factors A,B interaction AB are significatnt as these factors has p-value lesser than 0.05, hence we reject the null hypothesis
From the normal probability plot we can conclude that data is fairly normal as more observations are deviating from the normal line. Also, from residual plot we conclude that as variances are widely spread model is not adequate
From the halfnormal probability plot we can conclude that the factors A,B interaction AB are significatnt as these factors were deviating from the normality. We didnt considered ABC because it was almost normal
(Intercept) A B C D A:B
1.185417116 0.812870345 -0.314277554 -0.006408558 -0.018077390 -0.024684570
A:C B:C A:D B:D C:D A:B:C
-0.039723700 -0.004225796 -0.009578245 0.003708723 0.017780432 0.063434408
A:B:D A:C:D B:C:D A:B:C:D
-0.029875960 -0.003740235 0.003765760 0.031322043
Log(Resistivity) = 1.185417116 + 0.812870345A -0.314277554B + \(\epsilon_{ijk}\)
From the residual plots of model 3 we can conclude that variances are stabilized after log transformation without violating a normailty. Hence we can say that transformation was useful
model in terms of the coded variables that can be used to predict the resistivity.
log(resistivity) = 1.1854171 + 0.8128703 A - 0.3142776 B + \(\epsilon_{ijk}\)
In the question, we have 2^5 factorial design. Hence the experiment has 2 levels of each factor and 5 number of factors without replications
y<-c(8.11,5.56,5.77,5.82,9.17,7.8,3.23,5.69,8.82,14.23,9.2,8.94,8.68,11.49,6.25,9.12,7.93,5,7.47,12,9.86,3.65,6.4,11.61,12.43,17.55,8.87,25.38,13.06,18.85,11.78,26.05)
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)
e<-c(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
A<-c(rep(a,16))
B<-c(rep(b,8))
C<-c(rep(c,4))
D<-c(rep(d,2))
E<-c(rep(e,1))
dat<-cbind(A,B,C,D,E,y)
df<-as.data.frame(dat)
df
## A B C D E y
## 1 -1 -1 -1 -1 -1 8.11
## 2 1 -1 -1 -1 -1 5.56
## 3 -1 1 -1 -1 -1 5.77
## 4 1 1 -1 -1 -1 5.82
## 5 -1 -1 1 -1 -1 9.17
## 6 1 -1 1 -1 -1 7.80
## 7 -1 1 1 -1 -1 3.23
## 8 1 1 1 -1 -1 5.69
## 9 -1 -1 -1 1 -1 8.82
## 10 1 -1 -1 1 -1 14.23
## 11 -1 1 -1 1 -1 9.20
## 12 1 1 -1 1 -1 8.94
## 13 -1 -1 1 1 -1 8.68
## 14 1 -1 1 1 -1 11.49
## 15 -1 1 1 1 -1 6.25
## 16 1 1 1 1 -1 9.12
## 17 -1 -1 -1 -1 1 7.93
## 18 1 -1 -1 -1 1 5.00
## 19 -1 1 -1 -1 1 7.47
## 20 1 1 -1 -1 1 12.00
## 21 -1 -1 1 -1 1 9.86
## 22 1 -1 1 -1 1 3.65
## 23 -1 1 1 -1 1 6.40
## 24 1 1 1 -1 1 11.61
## 25 -1 -1 -1 1 1 12.43
## 26 1 -1 -1 1 1 17.55
## 27 -1 1 -1 1 1 8.87
## 28 1 1 -1 1 1 25.38
## 29 -1 -1 1 1 1 13.06
## 30 1 -1 1 1 1 18.85
## 31 -1 1 1 1 1 11.78
## 32 1 1 1 1 1 26.05
library(DoE.base)
model<-lm(y~A*B*C*D*E,data = df)
coef(model)
## (Intercept) A B C D E
## 10.1803125 1.6159375 0.0434375 -0.0121875 2.9884375 2.1878125
## A:B A:C B:C A:D B:D C:D
## 1.2365625 -0.0015625 -0.1953125 1.6665625 -0.0134375 0.0034375
## A:E B:E C:E D:E A:B:C A:B:D
## 1.0271875 1.2834375 0.3015625 1.3896875 0.2503125 -0.3453125
## A:C:D B:C:D A:B:E A:C:E B:C:E A:D:E
## -0.0634375 0.3053125 1.1853125 -0.2590625 0.1709375 0.9015625
## B:D:E C:D:E A:B:C:D A:B:C:E A:B:D:E A:C:D:E
## -0.0396875 0.3959375 -0.0740625 -0.1846875 0.4071875 0.1278125
## B:C:D:E A:B:C:D:E
## -0.0746875 -0.3553125
halfnormal(model)
##
## Significant effects (alpha=0.05, Lenth method):
## [1] D E A:D A D:E B:E A:B A:B:E A:E A:D:E
From the half normal plot we can conclude that significant effects are ADE,AE,ABE,AB,BE,DE,A,AD,E,D.
Now lets find the residuals and examine the model adequacy of the experiment
A<-as.fixed(A)
B<-as.fixed(B)
D<-as.fixed(D)
E<-as.fixed(E)
df5<-data.frame(A,B,D,y)
df5
## A B D y
## 1 -1 -1 -1 8.11
## 2 1 -1 -1 5.56
## 3 -1 1 -1 5.77
## 4 1 1 -1 5.82
## 5 -1 -1 -1 9.17
## 6 1 -1 -1 7.80
## 7 -1 1 -1 3.23
## 8 1 1 -1 5.69
## 9 -1 -1 1 8.82
## 10 1 -1 1 14.23
## 11 -1 1 1 9.20
## 12 1 1 1 8.94
## 13 -1 -1 1 8.68
## 14 1 -1 1 11.49
## 15 -1 1 1 6.25
## 16 1 1 1 9.12
## 17 -1 -1 -1 7.93
## 18 1 -1 -1 5.00
## 19 -1 1 -1 7.47
## 20 1 1 -1 12.00
## 21 -1 -1 -1 9.86
## 22 1 -1 -1 3.65
## 23 -1 1 -1 6.40
## 24 1 1 -1 11.61
## 25 -1 -1 1 12.43
## 26 1 -1 1 17.55
## 27 -1 1 1 8.87
## 28 1 1 1 25.38
## 29 -1 -1 1 13.06
## 30 1 -1 1 18.85
## 31 -1 1 1 11.78
## 32 1 1 1 26.05
modeln<-aov(y~A+B+D+E+A*B+D*E+A*D+A*E+B*E+A*B*E+A*D*E,data=df5)
plot(modeln)
From the normal probability plot we can conclude that data is fairly normal as more observations are deviating from the normal line. Also, from residual plot we conclude that as variances are widely spread model is not adequate
From the halfnormal plot factor c is not significant, hence we will drop factor c
A<-as.fixed(A)
B<-as.fixed(B)
D<-as.fixed(D)
E<-as.fixed(E)
df6<-data.frame(A,B,D,y)
df6
## A B D y
## 1 -1 -1 -1 8.11
## 2 1 -1 -1 5.56
## 3 -1 1 -1 5.77
## 4 1 1 -1 5.82
## 5 -1 -1 -1 9.17
## 6 1 -1 -1 7.80
## 7 -1 1 -1 3.23
## 8 1 1 -1 5.69
## 9 -1 -1 1 8.82
## 10 1 -1 1 14.23
## 11 -1 1 1 9.20
## 12 1 1 1 8.94
## 13 -1 -1 1 8.68
## 14 1 -1 1 11.49
## 15 -1 1 1 6.25
## 16 1 1 1 9.12
## 17 -1 -1 -1 7.93
## 18 1 -1 -1 5.00
## 19 -1 1 -1 7.47
## 20 1 1 -1 12.00
## 21 -1 -1 -1 9.86
## 22 1 -1 -1 3.65
## 23 -1 1 -1 6.40
## 24 1 1 -1 11.61
## 25 -1 -1 1 12.43
## 26 1 -1 1 17.55
## 27 -1 1 1 8.87
## 28 1 1 1 25.38
## 29 -1 -1 1 13.06
## 30 1 -1 1 18.85
## 31 -1 1 1 11.78
## 32 1 1 1 26.05
modeln1<-aov(y~A*B*D*E,data=df6)
GAD::gad(modeln1)
## Analysis of Variance Table
##
## Response: y
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 83.560 83.560 57.2328 1.136e-06 ***
## B 1 0.060 0.060 0.0414 0.8414184
## D 1 285.784 285.784 195.7422 2.161e-10 ***
## E 1 153.169 153.169 104.9099 1.966e-08 ***
## A:B 1 48.931 48.931 33.5142 2.767e-05 ***
## A:D 1 88.878 88.878 60.8751 7.661e-07 ***
## B:D 1 0.006 0.006 0.0040 0.9506177
## A:E 1 33.764 33.764 23.1257 0.0001928 ***
## B:E 1 52.711 52.711 36.1032 1.822e-05 ***
## D:E 1 61.799 61.799 42.3283 7.243e-06 ***
## A:B:D 1 3.816 3.816 2.6135 0.1255014
## A:B:E 1 44.959 44.959 30.7937 4.402e-05 ***
## A:D:E 1 26.010 26.010 17.8151 0.0006496 ***
## B:D:E 1 0.050 0.050 0.0345 0.8549347
## A:B:D:E 1 5.306 5.306 3.6340 0.0747350 .
## Residual 16 23.360 1.460
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the result the p-value of higher order interaction is 0.0747350 which is greater than the 0.05, hence we failed to reject the null hypothesis which confirm our result in part a
The greatest reading of y are 26.05 and 25.38.
Factor A,B,D and E are significant factors hence, the settings of the active factors that maximize the predicted response will be
FactorA = +1, FactorB = +1, FactorD = +1, Factor E= +1