Question 4.3 & 4.16
Linear Effects Equation:
Xij = mu + τi + βj + ϵij
Null Hypothesis(H0): Ti = 0 for all i
Alternate Hypothesis(Ha): Ti != 0 for some i
library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
observations<-c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
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))
data<-data.frame(observations,chemical,Bolt)
chemical <- as.fixed(chemical)
Bolt <- as.fixed(Bolt)
model1 <- lm(observations~Bolt+chemical)
gad(model1)
## Analysis of Variance Table
##
## Response: observations
## Df Sum Sq Mean Sq F value Pr(>F)
## Bolt 4 157.00 39.250 21.6055 2.059e-05 ***
## chemical 3 12.95 4.317 2.3761 0.1211
## Residual 12 21.80 1.817
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The p-value is 0.1211 > 0.05 level of signifance .so we fail to
reject the null hypothesis(H0).
we could say that the chemical agents doesn’t signifcantly effect
the strength of the cloth for the given level of significance.
Question 4.22
Observation <- 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)
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)
Day <- c(rep(seq(1,5),5))
Ingredient <- as.factor(Ingredient)
batch <- as.factor(batch)
Day <- as.factor(Day)
Data1<- data.frame(Observation, batch, Day, Ingredient)
Xij = mu + τi + βj + ϵij
Fixed Effects
Assuming τi is the ingredient effect, and thus we define our null
and alternative hypotheses as
Null Hypothesis H0: τi = 0
Alternative Hypothesis Ha: τi != 0
Analysis
model2<-aov(Observation~Ingredient+batch+Day,data=Data1)
summary(model2)
## 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
The p value of the ingredients is less than the level of
significance (0.05) so we reject null Hypothesis
we conclude there’s a significant effect of ingredients on the
reaction time of chemical process.