question 3.2

ch<-c(rep(1,5), rep(2,5), rep(3,5), rep(4,5))
blt<-c(seq(1,5),seq(1,5),seq(1,5),seq(1,5))
obs<-c(73,  68, 74, 71, 67, 73, 67, 75, 72, 70, 75, 68, 78, 73, 68, 73, 71, 75, 75, 69)
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.
ch<-as.fixed(ch)
blt<-as.fixed(blt)

Test Hypothesis :

Ho: μ1=μ2=μ3=μ4

Ha: At least 1 differs of μa

Linear Effects equation for the question :

y{ij}=\(\mu M\)+\(\tau T\)i+\(\beta B\)i+\(\epsilon\){ij}

model<-lm(obs~ch+blt)
gad(model)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq F value    Pr(>F)    
## ch        3  12.95   4.317  2.3761    0.1211    
## blt       4 157.00  39.250 21.6055 2.059e-05 ***
## Residual 12  21.80   1.817                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

###Our p-value is 0.1211 is greater than alpha= 0.05 level of significance ##we fail to reject Hypothesis, and thus we conclude that chemicals do not have a significant effect on the mean strength.

###question 3.16

che2<-c(70.5,71.4,72.4,72.6)
mean(che2)
## [1] 71.725
chem1<-c(73,68,74,71,67)
mean(chem1)
## [1] 70.6
chem2<-c(73,67,75,72,70)
mean(chem2)
## [1] 71.4
chem3<-c(75,68,78,73,68)
mean(chem3)
## [1] 72.4
chem4<-c(73,71,75,75,69)
mean(chem4)
## [1] 72.6
bolt1<-c(73,73,75,73)
mean(bolt1)
## [1] 73.5
bolt2<-c(68,67,71,68)
mean(bolt2)
## [1] 68.5
bolt3<-c(74,75,78,75)
mean(bolt3)
## [1] 75.5
bolt4<-c(71,72,73,75)
mean(bolt4)
## [1] 72.75
bolt5<-c(67,70,68,69)
mean(bolt5)
## [1] 68.5

Calculating τi:

T 1 = chemical1 - μ = -1.15

T 2 = chemical2 - μ = -0.35

T 3 = chemical3 - μ = 0.65

T 4 = chemical4 - μ = 0.85

Calculating βetaj:

B 1 = bolt1 - μ = 1.75

B 2 = bolt2 - μ = -3.25

B 3 = bolt3 - μ = 3.75

B 4 = bolt4 - μ = 1

B 5 = bolt5 - μ = -3.25



### question 3.22



```r
Obs <- c(8,7,1,7,3,11,2,7,3,8,4,9,10,1,5,6,8,6,6,10,4,2,3,8,8)
Batch <- c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)
Day <- c(rep(seq(1,5),5))
Ingredient <- c(1,2,4,3,5,3,5,1,4,2,2,1,3,5,4,4,3,5,2,1,5,4,2,1,3)
Batch <- as.factor(Batch)
Day <- as.factor(Day)
Ingredient <- as.factor(Ingredient)
D <- data.frame(Obs, Batch, Day, Ingredient)

Test Hypothesis

Ho: μ1=μ2=μ3=μ4

Ha: At least 1 differs OF μ

This question is an orthogonal Latin square.

linear model effects equation:

Yi,j,k = \(\mu M\) + \(\tau T\)i + \(\beta B\)j + \(\alpha A\)k + \(\epsilon\) i,j,k

aov.model<-aov(Obs~Ingredient+Batch+Day,data=D)
summary(aov.model)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## Ingredient   4 141.44   35.36  11.309 0.000488 ***
## Batch        4  15.44    3.86   1.235 0.347618    
## Day          4  12.24    3.06   0.979 0.455014    
## Residuals   12  37.52    3.13                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

anova test result p-value = 0.000488 is lesser than the alpha = 0.05 , so, we reject the null hypothesis

we have to conclude that there’s a significant on the mean of observations reaction times of chemical processes.