Problem 5.4

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.
dpth<-rep(seq(1,4),9)
fedrate<-c(rep(1,12),rep(2,12),rep(3,12))
response<-c(74,79,82,99,64,68,88,104,60,73,92,96,92,98,99,104,86,104,108,110,88,88,95,99,99,104,108,114,98,99,110,111,102,95,99,107)
data.frame(dpth,fedrate,response)
##    dpth fedrate response
## 1     1       1       74
## 2     2       1       79
## 3     3       1       82
## 4     4       1       99
## 5     1       1       64
## 6     2       1       68
## 7     3       1       88
## 8     4       1      104
## 9     1       1       60
## 10    2       1       73
## 11    3       1       92
## 12    4       1       96
## 13    1       2       92
## 14    2       2       98
## 15    3       2       99
## 16    4       2      104
## 17    1       2       86
## 18    2       2      104
## 19    3       2      108
## 20    4       2      110
## 21    1       2       88
## 22    2       2       88
## 23    3       2       95
## 24    4       2       99
## 25    1       3       99
## 26    2       3      104
## 27    3       3      108
## 28    4       3      114
## 29    1       3       98
## 30    2       3       99
## 31    3       3      110
## 32    4       3      111
## 33    1       3      102
## 34    2       3       95
## 35    3       3       99
## 36    4       3      107
dpth<-as.fixed(dpth)
fedrate<-as.fixed(fedrate)
model<-aov(response~dpth+fedrate+dpth*fedrate)
gad(model) 
## Analysis of Variance Table
## 
## Response: response
##              Df  Sum Sq Mean Sq F value    Pr(>F)    
## dpth          3 2125.11  708.37 24.6628 1.652e-07 ***
## fedrate       2 3160.50 1580.25 55.0184 1.086e-09 ***
## dpth:fedrate  6  557.06   92.84  3.2324   0.01797 *  
## Residual     24  689.33   28.72                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(model)

fedrate1<-c(74,79,82,99,64,68,88,104,60,73,92,96)
mean(fedrate1)
## [1] 81.58333
fedrate2<-c(92,98,99,104,86,104,108,110,88,88,95,99)
mean(fedrate2)
## [1] 97.58333
fedrate3<-c(99,104,108,114,98,99,110,111,102,95,99,107)
mean(fedrate3)
## [1] 103.8333

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

a)Here the p value for interraction between depth and feedrate is 0.01797 which is less than 0.05, so we reject null hypothesis and we can say that there is significant interraction between factors.

b) From the graphs we can say that the model is adequate.

c) Mean at feedrate 0.20 is 81.58333

Mean at feedrate 0.25 is 97.58333

Mean at feedrate 0.30 is 103.8333

d) p value for depth is 1.652e-07

p value for fedrate is 1.086e-09

p value for depth:fedrate is 0.01797

Problem 5.34

library(GAD)
b<-c(rep(1,4),rep(2,4),rep(3,4),rep(1,4),rep(2,4),rep(3,4),rep(1,4),rep(2,4),rep(3,4))
b<-as.fixed(b)
data.frame(dpth,fedrate,b,response)
##    dpth fedrate b response
## 1     1       1 1       74
## 2     2       1 1       79
## 3     3       1 1       82
## 4     4       1 1       99
## 5     1       1 2       64
## 6     2       1 2       68
## 7     3       1 2       88
## 8     4       1 2      104
## 9     1       1 3       60
## 10    2       1 3       73
## 11    3       1 3       92
## 12    4       1 3       96
## 13    1       2 1       92
## 14    2       2 1       98
## 15    3       2 1       99
## 16    4       2 1      104
## 17    1       2 2       86
## 18    2       2 2      104
## 19    3       2 2      108
## 20    4       2 2      110
## 21    1       2 3       88
## 22    2       2 3       88
## 23    3       2 3       95
## 24    4       2 3       99
## 25    1       3 1       99
## 26    2       3 1      104
## 27    3       3 1      108
## 28    4       3 1      114
## 29    1       3 2       98
## 30    2       3 2       99
## 31    3       3 2      110
## 32    4       3 2      111
## 33    1       3 3      102
## 34    2       3 3       95
## 35    3       3 3       99
## 36    4       3 3      107
m1<-aov(response~dpth+fedrate+b+dpth*fedrate)
GAD::gad(m1)
## Analysis of Variance Table
## 
## Response: response
##              Df  Sum Sq Mean Sq F value    Pr(>F)    
## dpth          3 2125.11  708.37 30.6373 4.893e-08 ***
## fedrate       2 3160.50 1580.25 68.3463 3.635e-10 ***
## b             2  180.67   90.33  3.9069  0.035322 *  
## dpth:fedrate  6  557.06   92.84  4.0155  0.007258 ** 
## Residual     22  508.67   23.12                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
MSB<-90.33
MSE<-23.12
difference<-MSB-MSE
var<-difference/(3*4)
var
## [1] 5.600833

Here in this case we can say that if we do blocking the p value for interraction comes to be 0.007 which is agin less than 0.05, so we reject null hypothesis. In the case of problem 5.4, we had also rejected null hypothesis. So from the table the p value for blocking is 0.035322. So we can say that blocking has significant effect in this experiment.

Problem 13.5

library(GAD)
temp<-rep(seq(1,3),6)
pos<-c(rep(1,9),rep(2,9))
response<-c(570,1063,565,565,1080,510,583,1043,590,528,988,526,547,1026,538,521,1004,532)
data.frame(temp,pos,response)
##    temp pos response
## 1     1   1      570
## 2     2   1     1063
## 3     3   1      565
## 4     1   1      565
## 5     2   1     1080
## 6     3   1      510
## 7     1   1      583
## 8     2   1     1043
## 9     3   1      590
## 10    1   2      528
## 11    2   2      988
## 12    3   2      526
## 13    1   2      547
## 14    2   2     1026
## 15    3   2      538
## 16    1   2      521
## 17    2   2     1004
## 18    3   2      532
temp<-as.fixed(temp)
pos<-as.random(pos)
model<-aov(response~temp+pos+temp*pos)
GAD::gad(model)
## Analysis of Variance Table
## 
## Response: response
##          Df Sum Sq Mean Sq  F value    Pr(>F)    
## temp      2 945342  472671 1155.518 0.0008647 ***
## pos       1   7160    7160   15.998 0.0017624 ** 
## temp:pos  2    818     409    0.914 0.4271101    
## Residual 12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

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

Here the p value is 0.427 which is greater than 0.05, so we reject null hypotheis and we can say there is no significant effect between 2 factors.

Problem 13.6

library(GAD)
operator<-rep(c(rep(1,3), rep(2,3)), 10)
partno<-c(rep(1,6),rep(2,6),rep(3,6),rep(4,6),rep(5,6),rep(6,6),rep(7,6),rep(8,6),rep(9,6),rep(10,6))
response<-c(50,49,50,50,48,51,52,52,51,51,51,51,53,50,50,54,52,51,49,51,50,48,50,51,48,49,48,48,49,48,52,50,50,52,50,50,51,51,51,51,50,50,52,50,49,53,48,50,50,51,50,51,48,49,47,46,49,46,47,48)
data.frame(operator,partno,response)
##    operator partno response
## 1         1      1       50
## 2         1      1       49
## 3         1      1       50
## 4         2      1       50
## 5         2      1       48
## 6         2      1       51
## 7         1      2       52
## 8         1      2       52
## 9         1      2       51
## 10        2      2       51
## 11        2      2       51
## 12        2      2       51
## 13        1      3       53
## 14        1      3       50
## 15        1      3       50
## 16        2      3       54
## 17        2      3       52
## 18        2      3       51
## 19        1      4       49
## 20        1      4       51
## 21        1      4       50
## 22        2      4       48
## 23        2      4       50
## 24        2      4       51
## 25        1      5       48
## 26        1      5       49
## 27        1      5       48
## 28        2      5       48
## 29        2      5       49
## 30        2      5       48
## 31        1      6       52
## 32        1      6       50
## 33        1      6       50
## 34        2      6       52
## 35        2      6       50
## 36        2      6       50
## 37        1      7       51
## 38        1      7       51
## 39        1      7       51
## 40        2      7       51
## 41        2      7       50
## 42        2      7       50
## 43        1      8       52
## 44        1      8       50
## 45        1      8       49
## 46        2      8       53
## 47        2      8       48
## 48        2      8       50
## 49        1      9       50
## 50        1      9       51
## 51        1      9       50
## 52        2      9       51
## 53        2      9       48
## 54        2      9       49
## 55        1     10       47
## 56        1     10       46
## 57        1     10       49
## 58        2     10       46
## 59        2     10       47
## 60        2     10       48
operator<-as.fixed(operator)
partno<-as.random(partno)
model<-aov(response~operator+partno+operator*partno)
GAD::gad(model)
## Analysis of Variance Table
## 
## Response: response
##                 Df Sum Sq Mean Sq F value    Pr(>F)    
## operator         1  0.417  0.4167  0.6923    0.4269    
## partno           9 99.017 11.0019  7.3346 3.216e-06 ***
## operator:partno  9  5.417  0.6019  0.4012    0.9270    
## Residual        40 60.000  1.5000                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

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

Here the p value is 0.927 which is greater than 0.05, so we fail to reject null hypothesis and we can say that there is no significant effect between 2 factors