Test Hypothesis
Ho: μ1=μ2=μ3=μ4 - Null Hypothesis
Ha: At least 1 differs - Alternative Hypothesis
α = 0.15
chemical<-c(rep(1,5), rep(2,5), rep(3,5), rep(4,5))
bolt<-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.
chemical<-as.fixed(chemical)
bolt<-as.fixed(bolt)
Linear Effects
y_{ij}=\(\mu M\)+\(\tau T\)i+\(\beta B\)i+\(\epsilon\){ij}
model<-lm(obs~chemical+bolt)
gad(model)
## Analysis of Variance Table
##
## Response: obs
## Df Sum Sq Mean Sq F value Pr(>F)
## chemical 3 12.95 4.317 2.3761 0.1211
## bolt 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 > alpha= 0.05 level of significance we fail to reject Ho, and thus we conclude that different chemical agents do not have a significant effect on the mean strength.
###question 3.16
ch<-c(70.5,71.4,72.4,72.6)
mean(ch)
## [1] 71.725
ch1<-c(73,68,74,71,67)
mean(ch1)
## [1] 70.6
ch2<-c(73,67,75,72,70)
mean(ch2)
## [1] 71.4
ch3<-c(75,68,78,73,68)
mean(ch3)
## [1] 72.4
ch4<-c(73,71,75,75,69)
mean(ch4)
## [1] 72.6
blt1<-c(73,73,75,73)
mean(blt1)
## [1] 73.5
blt2<-c(68,67,71,68)
mean(blt2)
## [1] 68.5
blt3<-c(74,75,78,75)
mean(blt3)
## [1] 75.5
blt4<-c(71,72,73,75)
mean(blt4)
## [1] 72.75
blt5<-c(67,70,68,69)
mean(blt5)
## [1] 68.5
Calculating τi:
\(\tau T\) 1 = ch1 - μ = -1.15
\(\tau T\) 2 = ch2 - μ = -0.35
\(\tau T\) 3 = ch3 - μ = 0.65
\(\tau T\) 4 = ch4 - μ = 0.85
Calculating βj:
\(\beta B\) 1 = blt1 - μ = 1.75
\(\beta B\) 2 = blt2 - μ = -3.25
\(\beta B\) 3 = blt3 - μ = 3.75
\(\beta B\) 4 = blt4 - μ = 1
\(\beta B\) 5 = blt5 - μ = -3.25
### question 3.22
```r
Observations <- 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)
Data1 <- data.frame(Observations, Batch, Day, Ingredient)
Test Hypothesis
Ho: μ1=μ2=μ3=μ4 - Null Hypothesis
Ha: At least 1 differs - Alternative Hypothesis
aplha = 0.05
This Data we had any observation doesnt repeat in row or coloum so we can conclude that is an orthogonal Latin square.
linear model effects equation: Y_{i,j,k} = \(\mu M\) + \(\tau T\)i + \(\beta B\)j + \(\alpha A\)k + \(\epsilon\) {i,j,k}
aov.model<-aov(Observations~Ingredient+Batch+Day,data=Data1)
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
IN our anova testt p-value = 0.000488 < 0.05 , Thus we reject the null hypothesis and thus we conclude that there’s a significant effect of ingredients on the mean reaction times of chemical processes.