library(GAD)
#data
Chemical <- c(1,1,1,1, 2,2,2,2, 3,3,3,3, 4,4,4,4)
Bolt <- c(1,2,3,4, 1,2,3,4, 1,2,3,4, 1,2,3,4)
Strength <- c(73,68,74,71, 73,67,75,72, 75,68,78,73, 73,71,75,75)
#linear effect
Model: Y = μ + α + β + ε Where: - Y = tensile strength - μ = overall mean - α = chemical effect (fixed) - β = bolt effect (random) - ε = error
Hypothesis: - H0: All chemicals have the same effect - Ha: At least one chemical is different
#RCBD Analysis
#model
model <- aov(Strength ~ Chemical + Bolt)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## Chemical 1 12.01 12.012 1.33 0.270
## Bolt 1 4.51 4.512 0.50 0.492
## Residuals 13 117.41 9.032
#plot
boxplot(Strength ~ Chemical,
xlab = "Chemical",
ylab = "Strength")
Answer: the results show that the chemical factor has an F-value of 1.33 with a p-value of 0.270. Since this p-value is greater than our significance level of α = 0.15, we fail to reject the null hypothesis
#data (CRD)
Chemical2 <- c(1,1,1,1, 2,2,2,2, 3,3,3,3, 4,4,4,4)
Strength2 <- c(73,68,74,71, 73,67,75,72, 75,68,78,73, 73,71,75,75)
#linear effect (CRD)
Model: Y = μ + α + ε
Where: - Y = tensile strength - μ = overall mean - α = chemical effect (fixed) - ε = random error
Hypothesis: - H0: All chemicals have the same effect - Ha: At least one chemical is different
#CRD Analysis
#one-way ANOVA
model2 <- aov(Strength2 ~ factor(Chemical2))
summary(model2)
## Df Sum Sq Mean Sq F value Pr(>F)
## factor(Chemical2) 3 14.19 4.729 0.474 0.706
## Residuals 12 119.75 9.979
#boxplot
boxplot(Strength2 ~ Chemical2,
xlab = "Chemical",
ylab = "Strength")
Answer: the one-way ANOVA for the completely randomized
design shows that the chemical factor has an F-value of 0.474 with a
p-value of 0.706. Since this p-value is much greater than our
significance level of α = 0.15, we fail to reject the null
hypothesis
Answer:
when comparing the findings from questions 1 and 2, both analyses led to the same conclusion that the chemical agents do not significantly differ in their effect on tensile strength. However, there are important differences in the precision of these results. In part 1, the residual mean square was 9.032, while in part2 it was 9.979, showing that the CRD had more random variability. Since the bolt factor in part 1 had an F-value of 0.50 with a p-value of 0.492, this suggests that the Bolt of cloth does not represent a significant amount of nuisance variability in this particular experiment
{r eval=FALSE}