6.8:

Model equation is:

\[ y_{ij} =\mu +\alpha_i +\beta_j + \alpha \beta_{ij} +\epsilon_{ijk} \]

CultureMedium <-  c(1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2)
Time <- c(rep(12,12),rep(18,12))
Values <- 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)
CM <- as.factor(CultureMedium)
Time <- as.factor(Time)
Data <- data.frame(CM,Time,Values)

Model <- aov(Values~CM*Time,data = Data)
summary(Model)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## CM           1    9.4     9.4   1.835 0.190617    
## Time         1  590.0   590.0 115.506 9.29e-10 ***
## CM:Time      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

Since the p-value of interaction is very small so we say that it is significant and reject null hypothesis and look at the interaction plot.

interaction.plot(CultureMedium,Time,Values,col = c("blue","red"))

library(ggfortify)
## Loading required package: ggplot2
library(ggplot2)
autoplot(Model)

The QQ norm plot is pretty normal but the plot of constant variation has some variation so the model might not be adequate.

6.12:

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)
Obs <- c(14.037,13.880,14.821,14.888,16.165,13.860,14.757,14.921,13.972,14.032,14.843,14.415,13.907,13.914,14.878,14.932)
A <- as.factor(A)
B <- as.factor(B)
Data <- data.frame(A,B,Obs)

(a):

One <- c(14.037,16.165,13.972,13.907)
A <- c(13.88,13.86,14.032,13.914)
B <- c(14.821,14.757,14.843,14.878)
AB <- c(14.888,14.921,14.415,14.932)

S1 <- sum(One)
SA <- sum(A)
SB <- sum(B)
SAB <- sum(AB)

EffectA <- (2*(SA+SAB-S1-SB)/(4*4))
EffectB <- (2*(SB+SAB-S1-SA)/(4*4))
EffectAB <- (2*(SA+SB-S1-SAB)/(4*4))

(b):

Model <- aov(Obs~A*B,data = Data)
summary(Model)
##             Df Sum Sq Mean Sq F value Pr(>F)  
## A            1  0.403  0.4026   1.262 0.2833  
## B            1  1.374  1.3736   4.305 0.0602 .
## A:B          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

The interaction does not seem to be significant so we can check for main effects.

Model <- aov(Obs~A+B,data = Data)
summary(Model)
##             Df Sum Sq Mean Sq F value Pr(>F)  
## A            1  0.403  0.4026   1.263 0.2815  
## B            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

Main effects are also not significant.

(c):

Model <- lm(Obs~A*B,data = Data)
coef(Model)
## (Intercept)          A1          B1       A1:B1 
##    14.52025    -0.59875     0.30450     0.56300
summary(Model)
## 
## Call:
## lm(formula = Obs ~ A * B, data = Data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.61325 -0.14431 -0.00563  0.10188  1.64475 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  14.5202     0.2824  51.414 1.93e-15 ***
## A1           -0.5987     0.3994  -1.499    0.160    
## B1            0.3045     0.3994   0.762    0.461    
## A1:B1         0.5630     0.5648   0.997    0.339    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.5648 on 12 degrees of freedom
## Multiple R-squared:  0.3535, Adjusted R-squared:  0.1918 
## F-statistic: 2.187 on 3 and 12 DF,  p-value: 0.1425

Residual equation is

\[ y_{ijk} = 14.52025-0.59874\alpha_i +0.304550\beta_j +0.5630 \alpha \beta \gamma_{ijk} +\epsilon_{ijk} \]

(d):

autoplot(Model)

From the plots, both the conditions of normality and constant variance does not seem to satisfy.

(e):

As we did earliar in the homeworks, we can do BoxCox and find the appropriate \(\lambda\) , and run the ANOVA to fix it.

6.21:

Typeofputter <- 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))
LengthofPutt <- 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))
Slopeofputt <- 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))
Breakofputt <- 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))

DistancefromCup <- 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) 

library(GAD)
Typeofputter <- as.fixed(Typeofputter)
LengthofPutt <- as.fixed(LengthofPutt)
Slopeofputt <- as.fixed(Slopeofputt)
Breakofputt <- as.fixed(Breakofputt)

Dat3 <- data.frame(LengthofPutt, Typeofputter, Breakofputt, Slopeofputt, DistancefromCup)
Model <- lm(DistancefromCup~LengthofPutt*Typeofputter*Breakofputt*Slopeofputt, data = Dat3)
coef(Model)
##                                           (Intercept) 
##                                            15.4285714 
##                                         LengthofPutt1 
##                                             0.2142857 
##                                         Typeofputter1 
##                                            -7.3571429 
##                                          Breakofputt1 
##                                            -4.0000000 
##                                          Slopeofputt1 
##                                            -5.3571429 
##                           LengthofPutt1:Typeofputter1 
##                                             6.2857143 
##                            LengthofPutt1:Breakofputt1 
##                                             5.7857143 
##                            Typeofputter1:Breakofputt1 
##                                             2.8571429 
##                            LengthofPutt1:Slopeofputt1 
##                                             5.7142857 
##                            Typeofputter1:Slopeofputt1 
##                                             4.7142857 
##                             Breakofputt1:Slopeofputt1 
##                                             7.7857143 
##              LengthofPutt1:Typeofputter1:Breakofputt1 
##                                            -9.4285714 
##              LengthofPutt1:Typeofputter1:Slopeofputt1 
##                                             0.6428571 
##               LengthofPutt1:Breakofputt1:Slopeofputt1 
##                                           -12.1428571 
##               Typeofputter1:Breakofputt1:Slopeofputt1 
##                                           -11.7857143 
## LengthofPutt1:Typeofputter1:Breakofputt1:Slopeofputt1 
##                                            14.7857143
Model <- aov(Model)
gad(Model)
## $anova
## Analysis of Variance Table
## 
## Response: DistancefromCup
##                                                   Df Sum Sq Mean Sq F value
## LengthofPutt                                       1  917.1  917.15 10.5878
## Typeofputter                                       1  388.1  388.15  4.4809
## Breakofputt                                        1  145.1  145.15  1.6756
## Slopeofputt                                        1    1.4    1.40  0.0161
## LengthofPutt:Typeofputter                          1  218.7  218.68  2.5245
## LengthofPutt:Breakofputt                           1   11.9   11.90  0.1373
## Typeofputter:Breakofputt                           1  115.0  115.02  1.3278
## LengthofPutt:Slopeofputt                           1   93.8   93.81  1.0829
## Typeofputter:Slopeofputt                           1   56.4   56.43  0.6515
## Breakofputt:Slopeofputt                            1    1.6    1.63  0.0188
## LengthofPutt:Typeofputter:Breakofputt              1    7.3    7.25  0.0837
## LengthofPutt:Typeofputter:Slopeofputt              1  113.0  113.00  1.3045
## LengthofPutt:Breakofputt:Slopeofputt               1   39.5   39.48  0.4558
## Typeofputter:Breakofputt:Slopeofputt               1   33.8   33.77  0.3899
## LengthofPutt:Typeofputter:Breakofputt:Slopeofputt  1   95.6   95.65  1.1042
## Residuals                                         96 8315.8   86.62        
##                                                     Pr(>F)   
## LengthofPutt                                      0.001572 **
## Typeofputter                                      0.036862 * 
## Breakofputt                                       0.198615   
## Slopeofputt                                       0.899280   
## LengthofPutt:Typeofputter                         0.115377   
## LengthofPutt:Breakofputt                          0.711776   
## Typeofputter:Breakofputt                          0.252054   
## LengthofPutt:Slopeofputt                          0.300658   
## Typeofputter:Slopeofputt                          0.421588   
## Breakofputt:Slopeofputt                           0.891271   
## LengthofPutt:Typeofputter:Breakofputt             0.772939   
## LengthofPutt:Typeofputter:Slopeofputt             0.256228   
## LengthofPutt:Breakofputt:Slopeofputt              0.501207   
## Typeofputter:Breakofputt:Slopeofputt              0.533858   
## LengthofPutt:Typeofputter:Breakofputt:Slopeofputt 0.295994   
## Residuals                                                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-valus of the factors are less than 0.05, so we can reject the null hypothesis.

autoplot(Model)

It does not seem to follow the normality and constant variation and hence I think that the model is not adequate.

6.36:

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

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)

Dat<-data.frame(A,B,C,D,Resistivity)
Dat
##     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

(a):

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

The significant effects are A, B and A🅱️C.

(b):

AA <- as.fixed(A)
BA <- as.fixed(B)
Dat1 <- data.frame(AA,BA,Resistivity)
Model <- aov(Resistivity~AA*BA, data=Dat1)
GAD::gad(Model)
## $anova
## Analysis of Variance Table
## 
## Response: Resistivity
##           Df  Sum Sq Mean Sq F value    Pr(>F)    
## AA         1 159.833 159.833 333.088 4.049e-10 ***
## BA         1  36.090  36.090  75.211 1.630e-06 ***
## AA:BA      1  18.297  18.297  38.130 4.763e-05 ***
## Residuals 12   5.758   0.480                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
autoplot(Model)

Both the normality and constant variance does not seem to be true.

(c):

RRresistivity <- log(Resistivity)
Dat2<-data.frame(A,B,C,D,Resistivity)

Model <- lm(Resistivity~A*B*C*D, data=Dat2)
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

Ac <- as.fixed(A)
Bc <- as.fixed(B)
Dat3 <- data.frame(Ac,Bc,RRresistivity)
Model <- aov(RRresistivity~Ac+Bc, data=Dat3)
GAD::gad(Model)
## $anova
## Analysis of Variance Table
## 
## Response: RRresistivity
##           Df  Sum Sq Mean Sq F value    Pr(>F)    
## Ac         1 10.5721 10.5721  962.95 1.408e-13 ***
## Bc         1  1.5803  1.5803  143.94 2.095e-08 ***
## Residuals 13  0.1427  0.0110                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
autoplot(Model)

Now, the model seems to be adequate.

Dat4 <- data.frame(AA,BA,RRresistivity)
Model <- aov(RRresistivity~AA+BA, data=Dat4)
GAD::gad(Model)
## $anova
## Analysis of Variance Table
## 
## Response: RRresistivity
##           Df  Sum Sq Mean Sq F value    Pr(>F)    
## AA         1 10.5721 10.5721  962.95 1.408e-13 ***
## BA         1  1.5803  1.5803  143.94 2.095e-08 ***
## Residuals 13  0.1427  0.0110                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
autoplot(Model)

Both the conditions are satisfied so the model is again adequate.

Dat5 <- data.frame(RRresistivity,A,B)
Model <- lm(RRresistivity~A+B, data=Dat5)
coef(Model)
## (Intercept)           A           B 
##   1.1854171   0.8128703  -0.3142776

(d):

log(Resistivity) = 1.1854171 + (0.8128703)A + (-0.3142776)B + \(\epsilon\)

6.39:

A <- 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)
B <- 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)
C <- 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)
D <- 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)
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)
Obs <- 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)
Data <- data.frame(A,B,C,D,E,Obs)

(a):

library(DoE.base)
Model <- lm(Obs~A*B*C*D*E,data = Data)
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

summary(Model)
## 
## Call:
## lm.default(formula = Obs ~ A * B * C * D * E, data = Data)
## 
## Residuals:
## ALL 32 residuals are 0: no residual degrees of freedom!
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept) 10.180312        NaN     NaN      NaN
## A            1.615938        NaN     NaN      NaN
## B            0.043438        NaN     NaN      NaN
## C           -0.012187        NaN     NaN      NaN
## D            2.988437        NaN     NaN      NaN
## E            2.187812        NaN     NaN      NaN
## A:B          1.236562        NaN     NaN      NaN
## A:C         -0.001563        NaN     NaN      NaN
## B:C         -0.195313        NaN     NaN      NaN
## A:D          1.666562        NaN     NaN      NaN
## B:D         -0.013438        NaN     NaN      NaN
## C:D          0.003437        NaN     NaN      NaN
## A:E          1.027187        NaN     NaN      NaN
## B:E          1.283437        NaN     NaN      NaN
## C:E          0.301562        NaN     NaN      NaN
## D:E          1.389688        NaN     NaN      NaN
## A:B:C        0.250312        NaN     NaN      NaN
## A:B:D       -0.345312        NaN     NaN      NaN
## A:C:D       -0.063437        NaN     NaN      NaN
## B:C:D        0.305313        NaN     NaN      NaN
## A:B:E        1.185313        NaN     NaN      NaN
## A:C:E       -0.259062        NaN     NaN      NaN
## B:C:E        0.170938        NaN     NaN      NaN
## A:D:E        0.901563        NaN     NaN      NaN
## B:D:E       -0.039687        NaN     NaN      NaN
## C:D:E        0.395938        NaN     NaN      NaN
## A:B:C:D     -0.074063        NaN     NaN      NaN
## A:B:C:E     -0.184687        NaN     NaN      NaN
## A:B:D:E      0.407187        NaN     NaN      NaN
## A:C:D:E      0.127812        NaN     NaN      NaN
## B:C:D:E     -0.074688        NaN     NaN      NaN
## A:B:C:D:E   -0.355312        NaN     NaN      NaN
## 
## Residual standard error: NaN on 0 degrees of freedom
## Multiple R-squared:      1,  Adjusted R-squared:    NaN 
## F-statistic:   NaN on 31 and 0 DF,  p-value: NA
Model2 <- aov(Obs~A+B+D+E+A*B+A*D+A*E+B*E+D*E+A*B*E+A*D*E,data = Data)
summary(Model2)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## A            1  83.56   83.56  51.362 6.10e-07 ***
## B            1   0.06    0.06   0.037 0.849178    
## D            1 285.78  285.78 175.664 2.30e-11 ***
## E            1 153.17  153.17  94.149 5.24e-09 ***
## A:B          1  48.93   48.93  30.076 2.28e-05 ***
## A:D          1  88.88   88.88  54.631 3.87e-07 ***
## A:E          1  33.76   33.76  20.754 0.000192 ***
## B:E          1  52.71   52.71  32.400 1.43e-05 ***
## D:E          1  61.80   61.80  37.986 5.07e-06 ***
## A:B:E        1  44.96   44.96  27.635 3.82e-05 ***
## A:D:E        1  26.01   26.01  15.988 0.000706 ***
## Residuals   20  32.54    1.63                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(b):

autoplot(Model2)

The model does not seem to be adequate.

(c):

A <- 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)
B <- 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)
D <- 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)
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)
Obs <- 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)
Data <- data.frame(A,B,D,E,Obs)

Model <- lm(Obs~A*B*D*E,data = Data)
coef(Model)
## (Intercept)           A           B           D           E         A:B 
##  10.1803125   1.6159375   0.0434375   2.9884375   2.1878125   1.2365625 
##         A:D         B:D         A:E         B:E         D:E       A:B:D 
##   1.6665625  -0.0134375   1.0271875   1.2834375   1.3896875  -0.3453125 
##       A:B:E       A:D:E       B:D:E     A:B:D:E 
##   1.1853125   0.9015625  -0.0396875   0.4071875
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

summary(Model)
## 
## Call:
## lm.default(formula = Obs ~ A * B * D * E, data = Data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.4750 -0.5637  0.0000  0.5637  1.4750 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 10.18031    0.21360  47.661  < 2e-16 ***
## A            1.61594    0.21360   7.565 1.14e-06 ***
## B            0.04344    0.21360   0.203 0.841418    
## D            2.98844    0.21360  13.991 2.16e-10 ***
## E            2.18781    0.21360  10.243 1.97e-08 ***
## A:B          1.23656    0.21360   5.789 2.77e-05 ***
## A:D          1.66656    0.21360   7.802 7.66e-07 ***
## B:D         -0.01344    0.21360  -0.063 0.950618    
## A:E          1.02719    0.21360   4.809 0.000193 ***
## B:E          1.28344    0.21360   6.009 1.82e-05 ***
## D:E          1.38969    0.21360   6.506 7.24e-06 ***
## A:B:D       -0.34531    0.21360  -1.617 0.125501    
## A:B:E        1.18531    0.21360   5.549 4.40e-05 ***
## A:D:E        0.90156    0.21360   4.221 0.000650 ***
## B:D:E       -0.03969    0.21360  -0.186 0.854935    
## A:B:D:E      0.40719    0.21360   1.906 0.074735 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.208 on 16 degrees of freedom
## Multiple R-squared:  0.9744, Adjusted R-squared:  0.9504 
## F-statistic: 40.58 on 15 and 16 DF,  p-value: 7.07e-10

7.12:

library(GAD)
length<-c(-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1)
type<-c(-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1)
brk<-c(-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1,1,1,1,1)
sp<-c(-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1)
I<-c(10,0,4,0,0,5,6.5,16.5,4.5,19.5,15,41.5,8,21.5,0,18)
II<-c(18,16.5,6,10,0,20.5,18.5,4.5,18,18,16,39,4.5,10.5,0,5)
III<-c(14,4.5,1,34,18.5,18,7.5,0,14.5,16,8.5,6.5,6.5,6.5,0,7)
IV<-c(12.5,17.5,14.5,11,19.5,20,6,23.5,10,5.5,0,3.5,10,0,4.5,10)
V<-c(19,20.5,12,25.5,16,29.5,0,8,0,10,0.5,7,13,15.5,1,32.5)
VI<-c(16,17.5,14,21.5,15,19,10,8,17.5,7,9,8.5,41,24,4,18.5)
VII<-c(18.5,33,5,0,11,10,0,8,6,36,3,36,14,16,6.5,8)
Obs<-c(I,II,III,IV,V,VI,VII)
Blk <- c(rep(1,16),rep(2,16),rep(3,16),rep(4,16),rep(5,16),rep(6,16),rep(7,16))

block<-as.fixed(Blk)
length<-as.fixed(length)
type<-as.fixed(type)
brk<-as.fixed(brk)
sp<-as.fixed(sp)

data<-data.frame(length,type,brk,sp,Obs,block)
model<-lm(Obs~length+type+brk+sp+block+length*type+length*brk+type*brk+length*sp+type*sp+brk*sp+length*type*brk+length*type*sp+length*brk*sp+type*brk*sp+length*type*brk*sp,data = data)
GAD::gad(model)
## $anova
## Analysis of Variance Table
## 
## Response: Obs
##                    Df Sum Sq Mean Sq F value  Pr(>F)   
## length              1  917.1  917.15 10.3962 0.00176 **
## type                1  388.1  388.15  4.3998 0.03875 * 
## brk                 1  145.1  145.15  1.6453 0.20290   
## sp                  1    1.4    1.40  0.0158 0.90021   
## block               6  376.1   62.68  0.7105 0.64202   
## length:type         1  218.7  218.68  2.4788 0.11890   
## length:brk          1   11.9   11.90  0.1348 0.71433   
## type:brk            1  115.0  115.02  1.3038 0.25655   
## length:sp           1   93.8   93.81  1.0633 0.30522   
## type:sp             1   56.4   56.43  0.6397 0.42594   
## brk:sp              1    1.6    1.63  0.0184 0.89227   
## length:type:brk     1    7.3    7.25  0.0822 0.77499   
## length:type:sp      1  113.0  113.00  1.2809 0.26073   
## length:brk:sp       1   39.5   39.48  0.4476 0.50520   
## type:brk:sp         1   33.8   33.77  0.3828 0.53767   
## length:type:brk:sp  1   95.6   95.65  1.0842 0.30055   
## Residuals          90 7939.7   88.22                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Going backwards and removing the 4th level interaction.

model1<-lm(Obs~length+type+brk+sp+block+length*type+length*brk+type*brk+length*sp+type*sp+brk*sp+length*type*brk+length*type*sp+length*brk*sp+type*brk*sp,data = data)
GAD::gad(model1)
## $anova
## Analysis of Variance Table
## 
## Response: Obs
##                 Df Sum Sq Mean Sq F value   Pr(>F)   
## length           1  917.1  917.15 10.3866 0.001762 **
## type             1  388.1  388.15  4.3957 0.038804 * 
## brk              1  145.1  145.15  1.6438 0.203067   
## sp               1    1.4    1.40  0.0158 0.900250   
## block            6  376.1   62.68  0.7098 0.642528   
## length:type      1  218.7  218.68  2.4765 0.119026   
## length:brk       1   11.9   11.90  0.1347 0.714449   
## type:brk         1  115.0  115.02  1.3026 0.256734   
## length:sp        1   93.8   93.81  1.0623 0.305413   
## type:sp          1   56.4   56.43  0.6391 0.426128   
## brk:sp           1    1.6    1.63  0.0184 0.892318   
## length:type:brk  1    7.3    7.25  0.0821 0.775082   
## length:type:sp   1  113.0  113.00  1.2797 0.260920   
## length:brk:sp    1   39.5   39.48  0.4472 0.505381   
## type:brk:sp      1   33.8   33.77  0.3824 0.537843   
## Residuals       91 8035.4   88.30                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Getting rid of the 3rd level interaction.

model2<-lm(Obs~length+type+brk+sp+block+length*type+length*brk+type*brk+length*sp+type*sp+brk*sp,data = data)
GAD::gad(model2)
## $anova
## Analysis of Variance Table
## 
## Response: Obs
##             Df Sum Sq Mean Sq F value   Pr(>F)   
## length       1  917.1  917.15 10.5882 0.001577 **
## type         1  388.1  388.15  4.4810 0.036886 * 
## brk          1  145.1  145.15  1.6757 0.198640   
## sp           1    1.4    1.40  0.0161 0.899281   
## block        6  376.1   62.68  0.7236 0.631626   
## length:type  1  218.7  218.68  2.5246 0.115406   
## length:brk   1   11.9   11.90  0.1373 0.711780   
## type:brk     1  115.0  115.02  1.3279 0.252075   
## length:sp    1   93.8   93.81  1.0830 0.300678   
## type:sp      1   56.4   56.43  0.6515 0.421601   
## brk:sp       1    1.6    1.63  0.0188 0.891272   
## Residuals   95 8228.9   86.62                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Removing the 2nd level interaction now.

model3<-lm(Obs~length+type+brk+sp+block,data = data)
GAD::gad(model3)
## $anova
## Analysis of Variance Table
## 
## Response: Obs
##            Df Sum Sq Mean Sq F value   Pr(>F)   
## length      1  917.1  917.15 10.6152 0.001528 **
## type        1  388.1  388.15  4.4925 0.036496 * 
## brk         1  145.1  145.15  1.6799 0.197888   
## sp          1    1.4    1.40  0.0161 0.899137   
## block       6  376.1   62.68  0.7254 0.630108   
## Residuals 101 8726.3   86.40                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Only putterlength and puttertype are significant.

model3<-lm(Obs~length+type,data = data)
library(ggplot2)
library(ggfortify)
autoplot(model3)

The normality plot looks good but the constant variance is not.

7.20:

Block1 <- c('a','b','cd','abcd','ace','bce','de','abde','cf','abcf','adf','bdf','ef','abef','acdef','bcdef')
Block2 <- c('c','abc','ad','bd','e','abe','acde','bcde','af','bf','cdf','abcdf','acef','bcef','def','abdef')
Block3 <- c('ac','bc','d','abd','ae','be','cde','abcde','f','abf','acdf','bcdf','cef','abcef','adef','bdef')
Block4 <- c('(1)','ab','acd','bcd','ce','abce','ade','bde','acf','bcf','df','abdf','aef','bef','cdef','abcdef')
confounding_scheme<-cbind(Block1,Block2,Block3,Block4)
confounding_scheme
##       Block1  Block2  Block3  Block4  
##  [1,] "a"     "c"     "ac"    "(1)"   
##  [2,] "b"     "abc"   "bc"    "ab"    
##  [3,] "cd"    "ad"    "d"     "acd"   
##  [4,] "abcd"  "bd"    "abd"   "bcd"   
##  [5,] "ace"   "e"     "ae"    "ce"    
##  [6,] "bce"   "abe"   "be"    "abce"  
##  [7,] "de"    "acde"  "cde"   "ade"   
##  [8,] "abde"  "bcde"  "abcde" "bde"   
##  [9,] "cf"    "af"    "f"     "acf"   
## [10,] "abcf"  "bf"    "abf"   "bcf"   
## [11,] "adf"   "cdf"   "acdf"  "df"    
## [12,] "bdf"   "abcdf" "bcdf"  "abdf"  
## [13,] "ef"    "acef"  "cef"   "aef"   
## [14,] "abef"  "bcef"  "abcef" "bef"   
## [15,] "acdef" "def"   "adef"  "cdef"  
## [16,] "bcdef" "abdef" "bdef"  "abcdef"

7.21:

block1 <- c('b','acd','ce','abde','abcf','df','aef','bcdef')
block2 <- c('abc','d','ae','bcde','bf','acdf','cef','abdef')
block3 <- c('a','bcd','abce','de','cf','abdf','bef','acdef')
block4 <- c('c','abd','be','acde','af','bcdf','abcef','def')
block5 <- c('ac','bd','abe','cde','f','abcdf','bcef','adef')
block6 <- c('-1','abcd','bce','ade','acf','bdf','abef','cdef')
block7 <- c('bc','ad','e','abcde','abf','cdf','acef','bdef')
block8 <- c('ab','cd','ace','bde','bcf','adf','ef','abcdef')
confounding_scheme2<-cbind(block1,block2,block3,block4,block5,block6,block7,block8)
confounding_scheme2
##      block1  block2  block3  block4  block5  block6 block7  block8  
## [1,] "b"     "abc"   "a"     "c"     "ac"    "-1"   "bc"    "ab"    
## [2,] "acd"   "d"     "bcd"   "abd"   "bd"    "abcd" "ad"    "cd"    
## [3,] "ce"    "ae"    "abce"  "be"    "abe"   "bce"  "e"     "ace"   
## [4,] "abde"  "bcde"  "de"    "acde"  "cde"   "ade"  "abcde" "bde"   
## [5,] "abcf"  "bf"    "cf"    "af"    "f"     "acf"  "abf"   "bcf"   
## [6,] "df"    "acdf"  "abdf"  "bcdf"  "abcdf" "bdf"  "cdf"   "adf"   
## [7,] "aef"   "cef"   "bef"   "abcef" "bcef"  "abef" "acef"  "ef"    
## [8,] "bcdef" "abdef" "acdef" "def"   "adef"  "cdef" "bdef"  "abcdef"

8.2:

library(FrF2)
## Warning: package 'FrF2' was built under R version 4.4.2
design <- FrF2(nfactors=4,resolution=4,randomize=FALSE)
design
##    A  B  C  D
## 1 -1 -1 -1 -1
## 2  1 -1 -1  1
## 3 -1  1 -1  1
## 4  1  1 -1 -1
## 5 -1 -1  1  1
## 6  1 -1  1 -1
## 7 -1  1  1 -1
## 8  1  1  1  1
## class=design, type= FrF2
aliasprint(design)
## $legend
## [1] A=A B=B C=C D=D
## 
## $main
## character(0)
## 
## $fi2
## [1] AB=CD AC=BD AD=BC

No Main effets are aliased but the two factors interactions are aliased with each other.

response<-c(7.037, 16.867, 13.876, 17.273, 11.846, 4.368, 9.36, 15.653)
design.resp <- add.response(design,response)
summary(design.resp)
## Call:
## FrF2(nfactors = 4, resolution = 4, randomize = FALSE)
## 
## Experimental design of type  FrF2 
## 8  runs
## 
## Factor settings (scale ends):
##    A  B  C  D
## 1 -1 -1 -1 -1
## 2  1  1  1  1
## 
## Responses:
## [1] response
## 
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D
## 
## $generators
## [1] D=ABC
## 
## 
## Alias structure:
## $fi2
## [1] AB=CD AC=BD AD=BC
## 
## 
## The design itself:
##    A  B  C  D response
## 1 -1 -1 -1 -1    7.037
## 2  1 -1 -1  1   16.867
## 3 -1  1 -1  1   13.876
## 4  1  1 -1 -1   17.273
## 5 -1 -1  1  1   11.846
## 6  1 -1  1 -1    4.368
## 7 -1  1  1 -1    9.360
## 8  1  1  1  1   15.653
## class=design, type= FrF2
DanielPlot(design.resp,half=TRUE)

MEPlot(design.resp,show.alias=TRUE)

Daniel plot shows that none of the factors are significant.

8.24:

des.res <- FrF2(nfactors = 5, resolution = 5 ,randomize = FALSE)
aliasprint(des.res)
## $legend
## [1] A=A B=B C=C D=D E=E
## 
## [[2]]
## [1] no aliasing among main effects and 2fis
summary(des.res)
## Call:
## FrF2(nfactors = 5, resolution = 5, randomize = FALSE)
## 
## Experimental design of type  FrF2 
## 16  runs
## 
## Factor settings (scale ends):
##    A  B  C  D  E
## 1 -1 -1 -1 -1 -1
## 2  1  1  1  1  1
## 
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D E=E
## 
## $generators
## [1] E=ABCD
## 
## 
## Alias structure:
## [[1]]
## [1] no aliasing among main effects and 2fis
## 
## 
## The design itself:
##     A  B  C  D  E
## 1  -1 -1 -1 -1  1
## 2   1 -1 -1 -1 -1
## 3  -1  1 -1 -1 -1
## 4   1  1 -1 -1  1
## 5  -1 -1  1 -1 -1
## 6   1 -1  1 -1  1
## 7  -1  1  1 -1  1
## 8   1  1  1 -1 -1
## 9  -1 -1 -1  1 -1
## 10  1 -1 -1  1  1
## 11 -1  1 -1  1  1
## 12  1  1 -1  1 -1
## 13 -1 -1  1  1  1
## 14  1 -1  1  1 -1
## 15 -1  1  1  1 -1
## 16  1  1  1  1  1
## class=design, type= FrF2
AB <- c("+","-","-","+","+","-","-","+","+","-","-","+","+","-","-","+")
Block <- c(1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1)
Data <- data.frame(des.res,AB,Block)
Data
##     A  B  C  D  E AB Block
## 1  -1 -1 -1 -1  1  +     1
## 2   1 -1 -1 -1 -1  -     2
## 3  -1  1 -1 -1 -1  -     2
## 4   1  1 -1 -1  1  +     1
## 5  -1 -1  1 -1 -1  +     1
## 6   1 -1  1 -1  1  -     2
## 7  -1  1  1 -1  1  -     2
## 8   1  1  1 -1 -1  +     1
## 9  -1 -1 -1  1 -1  +     1
## 10  1 -1 -1  1  1  -     2
## 11 -1  1 -1  1  1  -     2
## 12  1  1 -1  1 -1  +     1
## 13 -1 -1  1  1  1  +     1
## 14  1 -1  1  1 -1  -     2
## 15 -1  1  1  1 -1  -     2
## 16  1  1  1  1  1  +     1

Main effects confounded in block 1=E, C,D and main effects in block 2= A, B.

8.25:

design <- FrF2(nruns = 32,nfactors=7,blocks = 4,randomize=TRUE)
summary(design)
## Call:
## FrF2(nruns = 32, nfactors = 7, blocks = 4, randomize = TRUE)
## 
## Experimental design of type  FrF2.blocked 
## 32  runs
## blocked design with  4  blocks of size  8 
## 
## Factor settings (scale ends):
##    A  B  C  D  E  F  G
## 1 -1 -1 -1 -1 -1 -1 -1
## 2  1  1  1  1  1  1  1
## 
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D E=E F=F G=G
## 
## $`generators for design itself`
## [1] F=ABC G=ABD
## 
## $`block generators`
## [1] ACD ABE
## 
## 
## Alias structure:
## $fi2
## [1] AB=CF=DG AC=BF    AD=BG    AF=BC    AG=BD    CD=FG    CG=DF   
## 
## Aliased with block main effects:
## [1] none
## 
## The design itself:
##   run.no run.no.std.rp Blocks  A  B  C  D  E  F  G
## 1      1        16.1.4      1 -1  1  1  1  1 -1 -1
## 2      2        29.1.8      1  1  1  1 -1 -1  1 -1
## 3      3        20.1.5      1  1 -1 -1  1  1  1 -1
## 4      4        27.1.7      1  1  1 -1  1 -1 -1  1
## 5      5         7.1.2      1 -1 -1  1  1 -1  1  1
## 6      6         1.1.1      1 -1 -1 -1 -1 -1 -1 -1
## 7      7        22.1.6      1  1 -1  1 -1  1 -1  1
## 8      8        10.1.3      1 -1  1 -1 -1  1  1  1
##    run.no run.no.std.rp Blocks  A  B  C  D  E  F  G
## 9       9         9.2.3      2 -1  1 -1 -1 -1  1  1
## 10     10        28.2.7      2  1  1 -1  1  1 -1  1
## 11     11        19.2.5      2  1 -1 -1  1 -1  1 -1
## 12     12        21.2.6      2  1 -1  1 -1 -1 -1  1
## 13     13        15.2.4      2 -1  1  1  1 -1 -1 -1
## 14     14         2.2.1      2 -1 -1 -1 -1  1 -1 -1
## 15     15        30.2.8      2  1  1  1 -1  1  1 -1
## 16     16         8.2.2      2 -1 -1  1  1  1  1  1
##    run.no run.no.std.rp Blocks  A  B  C  D  E  F  G
## 17     17         5.3.2      3 -1 -1  1 -1 -1  1 -1
## 18     18        25.3.7      3  1  1 -1 -1 -1 -1 -1
## 19     19        12.3.3      3 -1  1 -1  1  1  1 -1
## 20     20         3.3.1      3 -1 -1 -1  1 -1 -1  1
## 21     21        24.3.6      3  1 -1  1  1  1 -1 -1
## 22     22        14.3.4      3 -1  1  1 -1  1 -1  1
## 23     23        31.3.8      3  1  1  1  1 -1  1  1
## 24     24        18.3.5      3  1 -1 -1 -1  1  1  1
##    run.no run.no.std.rp Blocks  A  B  C  D  E  F  G
## 25     25        11.4.3      4 -1  1 -1  1 -1  1 -1
## 26     26        23.4.6      4  1 -1  1  1 -1 -1 -1
## 27     27        17.4.5      4  1 -1 -1 -1 -1  1  1
## 28     28         6.4.2      4 -1 -1  1 -1  1  1 -1
## 29     29        26.4.7      4  1  1 -1 -1  1 -1 -1
## 30     30         4.4.1      4 -1 -1 -1  1  1 -1  1
## 31     31        13.4.4      4 -1  1  1 -1 -1 -1  1
## 32     32        32.4.8      4  1  1  1  1  1  1  1
## class=design, type= FrF2.blocked 
## NOTE: columns run.no and run.no.std.rp  are annotation, 
##  not part of the data frame

No main effects or two factor interactions are confounded with the blocks.

8.28:

(A):

k=6 , p=2 Fraction: $2_{i\nu}^{6-2}$

Runs=16, Design generatos: E=ABC and F=BCD

Defining relations: I=ABCE, I=BCDE, I=ADEF.

(B):

des.res <- FrF2(nfactors = 6,resolution = 4 , randomize = TRUE)
aliasprint(des.res)
## $legend
## [1] A=A B=B C=C D=D E=E F=F
## 
## $main
## character(0)
## 
## $fi2
## [1] AB=CE=DF AC=BE    AD=BF    AE=BC    AF=BD    CD=EF    CF=DE

(C):

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)
E <- c(-1,1,1,-1,1,-1,-1,1,-1,1,1,-1,1,-1,-1,1)
F1 <- c(-1,1,-1,1,1,-1,1,-1,1,-1,1,-1,-1,1,-1,1)

A <- as.factor(A)
B <- as.factor(B)
C <- as.factor(C)
D <- as.factor(D)
E <- as.factor(E)
F1 <- as.factor(F1)

response<-c(0.0167,0.0062,0.0041,0.0073,0.0047,0.0219,0.0121,0.0255,0.0032,0.0078,0.0043,0.0186,0.0110,0.0065,0.0155,0.0093,0.0128,0.0066,0.0043,0.0081,0.0047,0.0258,0.0090,0.0250,0.0023,0.0158,0.0027,0.0137,0.0086,0.0109,0.0158,0.0124,0.0149,0.0044,0.0042,0.0039,0.0040,0.0147,0.0092,0.0226,0.0077,0.0060,0.0028,0.0158,0.0101,0.0126,0.0145,0.0110,0.0185,0.0020,0.0050,0.0030,0.0089,0.0296,0.0086,0.0169,0.0069,0.0045,0.0028,0.0159,0.0158,0.0071,0.0145,0.0133)

Data <- data.frame(A,B,C,D,E,F1,response)
Model <- aov(response~A*B*C*D*E*F1,data = Data)
summary(Model)
##             Df    Sum Sq   Mean Sq F value   Pr(>F)    
## A            1 0.0002422 0.0002422  27.793 3.17e-06 ***
## B            1 0.0000053 0.0000053   0.614  0.43725    
## C            1 0.0005023 0.0005023  57.644 9.14e-10 ***
## D            1 0.0000323 0.0000323   3.712  0.05995 .  
## E            1 0.0001901 0.0001901  21.815 2.45e-05 ***
## F1           1 0.0009602 0.0009602 110.192 5.05e-14 ***
## A:B          1 0.0000587 0.0000587   6.738  0.01249 *  
## A:C          1 0.0000803 0.0000803   9.218  0.00387 ** 
## B:C          1 0.0000527 0.0000527   6.053  0.01754 *  
## A:D          1 0.0000239 0.0000239   2.741  0.10431    
## B:D          1 0.0000849 0.0000849   9.739  0.00305 ** 
## C:D          1 0.0000622 0.0000622   7.139  0.01027 *  
## D:E          1 0.0000088 0.0000088   1.007  0.32062    
## A:B:D        1 0.0000000 0.0000000   0.005  0.94291    
## B:C:D        1 0.0000481 0.0000481   5.523  0.02293 *  
## Residuals   48 0.0004183 0.0000087                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Factors A, C, E and F are significantly affecting the average number.

(D):

SD <- c(24.418,20.976,4.083,25.025,22.41,63.639,16.029,39.42,26.725,50.341,7.681,20.083,31.12,29.51,6.75,17.45)
var <- SD^2
Data2 <- data.frame(A,B,C,D,E,F1,var)
Model2 <- lm(SD~A*B*C*D*E*F1,data = Data2)
DanielPlot(Model2)

(E):

Model2 <- lm(response~A*B*C*D*E*F1,data = Data)
coef(Model2)
##        (Intercept)                 A1                 B1                 C1 
##        0.015725000        0.001009375       -0.007137500        0.001784375 
##                 D1                 E1                F11              A1:B1 
##       -0.002953125       -0.004187500       -0.007746875        0.003725000 
##              A1:C1              B1:C1              A1:D1              B1:D1 
##        0.004481250        0.007100000       -0.002550000        0.007968750 
##              C1:D1              A1:E1              B1:E1              C1:E1 
##       -0.000475000                 NA                 NA                 NA 
##              D1:E1             A1:F11             B1:F11             C1:F11 
##        0.001481250                 NA                 NA                 NA 
##             D1:F11             E1:F11           A1:B1:C1           A1:B1:D1 
##                 NA                 NA                 NA        0.000212500 
##           A1:C1:D1           B1:C1:D1           A1:B1:E1           A1:C1:E1 
##                 NA       -0.006937500                 NA                 NA 
##           B1:C1:E1           A1:D1:E1           B1:D1:E1           C1:D1:E1 
##                 NA                 NA                 NA                 NA 
##          A1:B1:F11          A1:C1:F11          B1:C1:F11          A1:D1:F11 
##                 NA                 NA                 NA                 NA 
##          B1:D1:F11          C1:D1:F11          A1:E1:F11          B1:E1:F11 
##                 NA                 NA                 NA                 NA 
##          C1:E1:F11          D1:E1:F11        A1:B1:C1:D1        A1:B1:C1:E1 
##                 NA                 NA                 NA                 NA 
##        A1:B1:D1:E1        A1:C1:D1:E1        B1:C1:D1:E1       A1:B1:C1:F11 
##                 NA                 NA                 NA                 NA 
##       A1:B1:D1:F11       A1:C1:D1:F11       B1:C1:D1:F11       A1:B1:E1:F11 
##                 NA                 NA                 NA                 NA 
##       A1:C1:E1:F11       B1:C1:E1:F11       A1:D1:E1:F11       B1:D1:E1:F11 
##                 NA                 NA                 NA                 NA 
##       C1:D1:E1:F11     A1:B1:C1:D1:E1    A1:B1:C1:D1:F11    A1:B1:C1:E1:F11 
##                 NA                 NA                 NA                 NA 
##    A1:B1:D1:E1:F11    A1:C1:D1:E1:F11    B1:C1:D1:E1:F11 A1:B1:C1:D1:E1:F11 
##                 NA                 NA                 NA                 NA
summary(Model2)
## 
## Call:
## lm.default(formula = response ~ A * B * C * D * E * F1, data = Data)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.008300 -0.001350 -0.000350  0.001744  0.007275 
## 
## Coefficients: (48 not defined because of singularities)
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         0.0157250  0.0014760  10.654 3.06e-14 ***
## A1                  0.0010094  0.0016502   0.612 0.543644    
## B1                 -0.0071375  0.0018077  -3.948 0.000257 ***
## C1                  0.0017844  0.0016502   1.081 0.284963    
## D1                 -0.0029531  0.0019525  -1.512 0.136976    
## E1                 -0.0041875  0.0010437  -4.012 0.000210 ***
## F11                -0.0077469  0.0007380 -10.497 5.05e-14 ***
## A1:B1               0.0037250  0.0020874   1.785 0.080655 .  
## A1:C1               0.0044812  0.0014760   3.036 0.003866 ** 
## B1:C1               0.0071000  0.0020874   3.401 0.001359 ** 
## A1:D1              -0.0025500  0.0020874  -1.222 0.227809    
## B1:D1               0.0079688  0.0025565   3.117 0.003083 ** 
## C1:D1              -0.0004750  0.0020874  -0.228 0.820954    
## A1:E1                      NA         NA      NA       NA    
## B1:E1                      NA         NA      NA       NA    
## C1:E1                      NA         NA      NA       NA    
## D1:E1               0.0014812  0.0014760   1.004 0.320619    
## A1:F11                     NA         NA      NA       NA    
## B1:F11                     NA         NA      NA       NA    
## C1:F11                     NA         NA      NA       NA    
## D1:F11                     NA         NA      NA       NA    
## E1:F11                     NA         NA      NA       NA    
## A1:B1:C1                   NA         NA      NA       NA    
## A1:B1:D1            0.0002125  0.0029520   0.072 0.942912    
## A1:C1:D1                   NA         NA      NA       NA    
## B1:C1:D1           -0.0069375  0.0029520  -2.350 0.022926 *  
## A1:B1:E1                   NA         NA      NA       NA    
## A1:C1:E1                   NA         NA      NA       NA    
## B1:C1:E1                   NA         NA      NA       NA    
## A1:D1:E1                   NA         NA      NA       NA    
## B1:D1:E1                   NA         NA      NA       NA    
## C1:D1:E1                   NA         NA      NA       NA    
## A1:B1:F11                  NA         NA      NA       NA    
## A1:C1:F11                  NA         NA      NA       NA    
## B1:C1:F11                  NA         NA      NA       NA    
## A1:D1:F11                  NA         NA      NA       NA    
## B1:D1:F11                  NA         NA      NA       NA    
## C1:D1:F11                  NA         NA      NA       NA    
## A1:E1:F11                  NA         NA      NA       NA    
## B1:E1:F11                  NA         NA      NA       NA    
## C1:E1:F11                  NA         NA      NA       NA    
## D1:E1:F11                  NA         NA      NA       NA    
## A1:B1:C1:D1                NA         NA      NA       NA    
## A1:B1:C1:E1                NA         NA      NA       NA    
## A1:B1:D1:E1                NA         NA      NA       NA    
## A1:C1:D1:E1                NA         NA      NA       NA    
## B1:C1:D1:E1                NA         NA      NA       NA    
## A1:B1:C1:F11               NA         NA      NA       NA    
## A1:B1:D1:F11               NA         NA      NA       NA    
## A1:C1:D1:F11               NA         NA      NA       NA    
## B1:C1:D1:F11               NA         NA      NA       NA    
## A1:B1:E1:F11               NA         NA      NA       NA    
## A1:C1:E1:F11               NA         NA      NA       NA    
## B1:C1:E1:F11               NA         NA      NA       NA    
## A1:D1:E1:F11               NA         NA      NA       NA    
## B1:D1:E1:F11               NA         NA      NA       NA    
## C1:D1:E1:F11               NA         NA      NA       NA    
## A1:B1:C1:D1:E1             NA         NA      NA       NA    
## A1:B1:C1:D1:F11            NA         NA      NA       NA    
## A1:B1:C1:E1:F11            NA         NA      NA       NA    
## A1:B1:D1:E1:F11            NA         NA      NA       NA    
## A1:C1:D1:E1:F11            NA         NA      NA       NA    
## B1:C1:D1:E1:F11            NA         NA      NA       NA    
## A1:B1:C1:D1:E1:F11         NA         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.002952 on 48 degrees of freedom
## Multiple R-squared:  0.849,  Adjusted R-squared:  0.8018 
## F-statistic:    18 on 15 and 48 DF,  p-value: 9.012e-15

8.40:

  1. Four factors.

  2. Resolution is also four.

One <- c(8)
AD <- c(10)
BD <- c(12)
AB <- c(7)
CD <- c(13)
AC <- c(6)
BC <- c(5)
ABCD <- c(11)
EffectA <- (2*(AD+AB+AC+ABCD-One-BD-CD-BC))/(8)
EffectB <- (2*(BD+AB+BC+ABCD-One-AD-CD-AC))/(8)
EffectC <- (2*(CD+AC+BC+ABCD-One-AD-BD-AB))/(8)
EffectD <- (2*(AD+BD+CD+ABCD-One-AB-AC-BC))/(8)
  1. Defining relation is I=ABCD

8.48:

design<- FrF2(nfactors = 5,nruns = 8,generators = c("-ABC","BC"), randomize = FALSE)
summary(design)
## Call:
## FrF2(nfactors = 5, nruns = 8, generators = c("-ABC", "BC"), randomize = FALSE)
## 
## Experimental design of type  FrF2.generators 
## 8  runs
## 
## Factor settings (scale ends):
##    A  B  C  D  E
## 1 -1 -1 -1 -1 -1
## 2  1  1  1  1  1
## 
## Design generating information:
## $legend
## [1] A=A B=B C=C D=D E=E
## 
## $generators
## [1] D=-ABC E=BC  
## 
## 
## Alias structure:
## $main
## [1] A=-DE    B=CE     C=BE     D=-AE    E=-AD=BC
## 
## $fi2
## [1] AB=-CD AC=-BD
## 
## 
## The design itself:
##    A  B  C  D  E
## 1 -1 -1 -1  1  1
## 2  1 -1 -1 -1  1
## 3 -1  1 -1 -1 -1
## 4  1  1 -1  1 -1
## 5 -1 -1  1 -1 -1
## 6  1 -1  1  1 -1
## 7 -1  1  1  1  1
## 8  1  1  1 -1  1
## class=design, type= FrF2.generators
  1. The design generator for column D is -ABC.

  2. The design generator for colum E is BC.

  3. Using table 8.14, resolution is four.

8.60:

design <- FrF2(nfactors=7,resolution=3,randomize=FALSE)
design
##    A  B  C  D  E  F  G
## 1 -1 -1 -1  1  1  1 -1
## 2  1 -1 -1 -1 -1  1  1
## 3 -1  1 -1 -1  1 -1  1
## 4  1  1 -1  1 -1 -1 -1
## 5 -1 -1  1  1 -1 -1  1
## 6  1 -1  1 -1  1 -1 -1
## 7 -1  1  1 -1 -1  1 -1
## 8  1  1  1  1  1  1  1
## class=design, type= FrF2
design2 <- fold.design(design,column=1)
design2
##     A  B  C     fold  D  E  F  G
## 1  -1 -1 -1 original  1  1  1 -1
## 2   1 -1 -1 original -1 -1  1  1
## 3  -1  1 -1 original -1  1 -1  1
## 4   1  1 -1 original  1 -1 -1 -1
## 5  -1 -1  1 original  1 -1 -1  1
## 6   1 -1  1 original -1  1 -1 -1
## 7  -1  1  1 original -1 -1  1 -1
## 8   1  1  1 original  1  1  1  1
## 9   1 -1 -1   mirror  1  1  1 -1
## 10 -1 -1 -1   mirror -1 -1  1  1
## 11  1  1 -1   mirror -1  1 -1  1
## 12 -1  1 -1   mirror  1 -1 -1 -1
## 13  1 -1  1   mirror  1 -1 -1  1
## 14 -1 -1  1   mirror -1  1 -1 -1
## 15  1  1  1   mirror -1 -1  1 -1
## 16 -1  1  1   mirror  1  1  1  1
## class=design, type= FrF2.folded
design3 <- design2[-c(1,3,5,7,10,12,14,16),]
design3
##    A  B  C     fold  D  E  F  G
## 2  1 -1 -1 original -1 -1  1  1
## 4  1  1 -1 original  1 -1 -1 -1
## 6  1 -1  1 original -1  1 -1 -1
## 8  1  1  1 original  1  1  1  1
## 9  1 -1 -1   mirror  1  1  1 -1
## 11 1  1 -1   mirror -1  1 -1  1
## 13 1 -1  1   mirror  1 -1 -1  1
## 15 1  1  1   mirror -1 -1  1 -1
aliasprint(design2)
## $legend
## [1] A=A    B=B    C=C    D=fold E=D    F=E    G=F    H=G   
## 
## $main
## [1] B=CG=FH C=BG=EH E=CH=FG F=BH=EG G=BC=EF H=BF=CE
## 
## $fi2
## [1] AB=-DE         AC=-DF         AD=-BE=-CF=-GH AE=-BD         AF=-CD        
## [6] AG=-DH         AH=-DG