Hypothesis we are testing

Null Hypothesis(Ho): αi=0 For all i

Alternative Hypothesis(Ha): αi≠0 For some i

Null Hypothesis(Ho): σ2β=0

Alternative Hypothesis(Ha): σ2β≠0

Null Hypothesis(Ho): σ2αβ=0

Alternative Hypothesis(Ha): αβij≠0

Probelm 6.8

time <- c(rep(12,12),rep(18,12))
culmedium <- c(rep(c(1,1,2,2),6))
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)
time<-as.factor(time)
culmedium<-as.factor(culmedium)
model<-aov(observations~time*culmedium)
summary(model)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## time            1  590.0   590.0 115.506 9.29e-10 ***
## culmedium       1    9.4     9.4   1.835 0.190617    
## time:culmedium  1   92.0    92.0  18.018 0.000397 ***
## Residuals      20  102.2     5.1                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)

From the results we can see that the time seems to be significant and interraction between time and medium is also significant. So here we can say that medium has an effect on model.

For model adequecy we can say that, the model is adequate as the variences are equal and data seems to be normal.

Problem 6.12

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(rep(-1,4),rep(1,4),rep(-1,4),rep(1,4)))
B <- (c(rep(-1,4),rep(-1,4),rep(1,4),rep(1,4)))
R <- c(rep(seq(1,4),4))
obs<-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)
m1<-aov(obs~A*B)
coef(m1)
## (Intercept)           A           B         A:B 
##   14.513875   -0.158625    0.293000    0.140750
fA<-as.factor(A)
fB<-as.factor(B)
data.frame(fA,fB,obs)
##    fA fB    obs
## 1  -1 -1 14.037
## 2  -1 -1 16.165
## 3  -1 -1 13.972
## 4  -1 -1 13.907
## 5   1 -1 13.880
## 6   1 -1 13.860
## 7   1 -1 14.032
## 8   1 -1 13.914
## 9  -1  1 14.821
## 10 -1  1 14.757
## 11 -1  1 14.843
## 12 -1  1 14.878
## 13  1  1 14.888
## 14  1  1 14.921
## 15  1  1 14.415
## 16  1  1 14.932
model1<-aov(obs~fA*fB)
coef(model1)
## (Intercept)         fA1         fB1     fA1:fB1 
##    14.52025    -0.59875     0.30450     0.56300
summary(model1)
##             Df Sum Sq Mean Sq F value Pr(>F)  
## fA           1  0.403  0.4026   1.262 0.2833  
## fB           1  1.374  1.3736   4.305 0.0602 .
## fA:fB        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
plot(model1)

a)

m1<-aov(obs~A*B)
coef(m1)
## (Intercept)           A           B         A:B 
##   14.513875   -0.158625    0.293000    0.140750

b) From the analysis we can say that every factor has p value greater than 0.05 so we can say they are not significant.

c) From part a we can write regression equation, Thickness= −0.158625A+0.293000B+0.140750AB

d) From the plots we can see that point 2 falls outside the groupings in the normal probability plot and the plot of residual versus predicted.

e)We can replace the observation with the average of the observations from that experimental cell.

Problem 6.21

replicates<-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.0,19.5,18,16,5.5,10.0,7.0,36.0,15.0,16,8.5,0,0.5,9,3.0,41.5,39.0,6.5,3.5,7.0,8.5,36.0,8.0,4.5,6.5,10,13,41,14,21.5,10.5,6.5,0,15.5,24.0,16,0,0,0,4.5,1,4,6.5,18,5,7,10,32.5,18.5,8)
length <- rep(c(-1,1,-1,1),28)
type <- rep(c(-1,-1,1,1),28)
brk <- rep(c(-1,-1,-1,-1,1,1,1,1),14)
slope <- c(rep(-1,8),rep(1,8))
slope <- rep(slope,7)
model7 <- aov(replicates~length*type*brk*slope)
summary(model7)
##                       Df Sum Sq Mean Sq F value Pr(>F)  
## length                 1    399   399.4   4.003 0.0482 *
## type                   1     52    52.3   0.524 0.4710  
## brk                    1     12    11.9   0.119 0.7306  
## slope                  1     32    31.6   0.317 0.5748  
## length:type            1    109   109.0   1.093 0.2985  
## length:brk             1      2     2.4   0.024 0.8763  
## type:brk               1     42    41.9   0.420 0.5185  
## length:slope           1     26    25.6   0.256 0.6139  
## type:slope             1      1     1.4   0.014 0.9061  
## brk:slope              1     20    20.1   0.202 0.6542  
## length:type:brk        1      9     8.9   0.089 0.7664  
## length:type:slope      1    152   152.1   1.524 0.2200  
## length:brk:slope       1     42    41.9   0.420 0.5185  
## type:brk:slope         1     13    12.6   0.126 0.7236  
## length:type:brk:slope  1     65    65.3   0.654 0.4206  
## Residuals             96   9578    99.8                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

a)Here we can say that as p-values of lenth of putt and type of putt are smaller than 0.05 they can be considered as significant.

b)The plot appears to be norml but has unequal variance, so we can say that the model is not adequate.

Probelm 6.36

A <- rep(c(-1,1),8)
B <- rep(c(-1,-1,1,1),4)
C <- c(rep(-1,4),rep(1,4),rep(-1,4),rep(1,4))
D <- c(rep(-1,8),rep(1,8))
resitivity <- 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)


dat<-data.frame(A,B,C,D,resitivity)
model2<-aov(resitivity~A*B*C*D,data = dat)
halfnormal(model2)
## 
## Significant effects (alpha=0.05, Lenth method):
## [1] A     B     A:B   A:B:C

model3<-lm(resitivity~A*B)
coef(model3)
## (Intercept)           A           B         A:B 
##    4.680625    3.160625   -1.501875   -1.069375

a)

halfnormal(model2)
## 
## Significant effects (alpha=0.05, Lenth method):
## [1] A     B     A:B   A:B:C

coef(model3)
## (Intercept)           A           B         A:B 
##    4.680625    3.160625   -1.501875   -1.069375

From this we can say that A,A:B,B are significant.

Estimated model:4.680625+3.160625A−1.501875B−1.069375AB

b)

FA<-as.factor(A)
FB<-as.factor(B)
model4<-aov(resitivity~FA*FB)
plot(model4)

From the plots we can say that varience is not eqaul and data is not normal, so we can say that the model is not adequate.

c)

q<-log(resitivity)
halfnormal(aov(q~A*B*C*D))
## 
## Significant effects (alpha=0.05, Lenth method):
## [1] A     B     A:B:C

plot(aov(resitivity~FA*FB))

### After doing trasformation by using log we can say that, by analysing the plots we can say that the transformation that we did was benificial.

d)

halfnormal(aov(q~A*B*C*D))
## 
## Significant effects (alpha=0.05, Lenth method):
## [1] A     B     A:B:C

coef(aov(q~A*B))
## (Intercept)           A           B         A:B 
##  1.18541712  0.81287034 -0.31427755 -0.02468457

Here we can see that now just A and B that are significant.

We can write our new model equation as 1.18541712+0.81287034A−0.31427755B

Problem 6.39

library(DoE.base)
A <- rep(c(-1,1),16)
B <- rep(c(-1,-1,1,1),8)
C <- rep(c(rep(-1,4),rep(1,4)),4)
D <- rep(c(rep(-1,8),rep(1,8)),2)
E <- c(rep(-1,16),rep(1,16))
dat1<-data.frame(A,B,C,D,E)
obs1<-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)
model4<-aov(obs1~A*B*C*D*E,data = dat1)
halfnormal(model4)
## 
## 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

a) From the plots we can say that all the factors seems to be significant.

b)

FA1 <- as.factor(A)
FB1 <- as.factor(B)
FD1 <- as.factor(D)
FE1 <- as.factor(E)


plot(aov(obs1~FA1*FB1*FD1*FE1))

From the plots we can say that are there are no indications of model inadequacy.

c)

summary(aov(obs1~A*B*E*D))
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## A            1  83.56   83.56  57.233 1.14e-06 ***
## B            1   0.06    0.06   0.041 0.841418    
## E            1 153.17  153.17 104.910 1.97e-08 ***
## D            1 285.78  285.78 195.742 2.16e-10 ***
## A:B          1  48.93   48.93  33.514 2.77e-05 ***
## A:E          1  33.76   33.76  23.126 0.000193 ***
## B:E          1  52.71   52.71  36.103 1.82e-05 ***
## A:D          1  88.88   88.88  60.875 7.66e-07 ***
## B:D          1   0.01    0.01   0.004 0.950618    
## E:D          1  61.80   61.80  42.328 7.24e-06 ***
## A:B:E        1  44.96   44.96  30.794 4.40e-05 ***
## A:B:D        1   3.82    3.82   2.613 0.125501    
## A:E:D        1  26.01   26.01  17.815 0.000650 ***
## B:E:D        1   0.05    0.05   0.035 0.854935    
## A:B:E:D      1   5.31    5.31   3.634 0.074735 .  
## Residuals   16  23.36    1.46                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

From the ANOVA table we can see our significant factors are: A, E, D, A:B, A:E, B:E, A:D, E:D, A:B:E, and A:E:D at 0.05 significance level.

d)

coef(aov(obs1~A*B*E*D))
## (Intercept)           A           B           E           D         A:B 
##  10.1803125   1.6159375   0.0434375   2.1878125   2.9884375   1.2365625 
##         A:E         B:E         A:D         B:D         E:D       A:B:E 
##   1.0271875   1.2834375   1.6665625  -0.0134375   1.3896875   1.1853125 
##       A:B:D       A:E:D       B:E:D     A:B:E:D 
##  -0.3453125   0.9015625  -0.0396875   0.4071875

To maximize the predicted response we need to set factors at high level that is set at +1 level and c at zero.