knitr::opts_chunk$set(echo = TRUE)
Meghan Cephus
10/12/2024
Linear effects equation: \[Y_{ij} = \mu + \alpha_i + \beta_j + \epsilon_{ij}\]
Where :
Yij is the tensile strength for the i-th chemical agent and the j-th bolt,
μ is the overall mean tensile strength,
α is the effect of the i-th chemical agent (treatment effect),
β is the effect of the j-th bolt (block effect),
ϵ is the random error term, assumed to be normally distributed with mean 0 and constant variance.
Chemical Null Hypothesis: There is NO significant difference between the means due to the chemical agent.
Chemical Alternative Hypothesis: There IS a significant difference between at least one mean due to the chemical agent.
Bolt Null Hypothesis: There is NO significant difference between the means due to the bolt number.
Bolt Alternative Hypothesis: There IS a significant difference between at least one mean due to the bolt number.
Using GAD for RCBD, we find that the chemical type has an F value that is more than the F critical value. (2.3761 > 2.12) Therefore the chemical type DOES seem to have a significant effect. The bolt type also has an F value that is greater than the F critical value. (21.605 > 2.05) Therefore the bolt type DOES seem to have a significant effect.
The Alternative Hypothesis is true for both the Chemical Agent and the Bolt and we can reject the Null Hypothesis.
library(GAD)
tensile_strength <- c(73, 68, 74, 71, 67,
73, 67, 75, 72, 70,
75, 68, 78, 73, 68,
73, 71, 75, 75, 69)
chemical <- factor(rep(1:4, each=5)) # 4 chemicals
chemical<- as.fixed(chemical)
bolt <- factor(rep(1:5, times=4)) # 5 bolts
bolt<- as.fixed(bolt)
data <- data.frame(bolt, chemical, tensile_strength)
model <- lm(tensile_strength~chemical+bolt)
gad(model)
## $anova
## Analysis of Variance Table
##
## Response: tensile_strength
## 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 ***
## Residuals 12 21.80 1.817
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
chem_crit_f <- qf(0.85, 3, 12)
chem_crit_f
## [1] 2.127759
bolt_crit_f <- qf(0.85, 4, 12)
bolt_crit_f
## [1] 2.056789
Linear effects equation: \[Y_{ij} = \mu + \tau_i + \epsilon_{ij}\]
Where :
Yij is the tensile strength for the i-th chemical agent and the j-th bolt,
μ is the overall mean tensile strength,
τ is the effect of the i-th chemical agent (treatment effect),
ϵ is the random error term, assumed to be normally distributed with mean 0 and constant variance.
Chemical Null Hypothesis: There is NO significant difference between the means due to the chemical agent.
Chemical Alternative Hypothesis: There IS a significant difference between at least one mean due to the chemical agent.
The chemical agent has F value that is less than the F critical value. (0.386 < 2.03) Therefore the chemical agent does NOT seem to have a significant effect. We cannot reject the Null Hypothesis.
The Null Hypothesis is true for the Chemical Agent.
## Df Sum Sq Mean Sq F value Pr(>F)
## name 3 12.95 4.317 0.386 0.764
## Residuals 16 178.80 11.175
## [1] 2.031605
3. Comments
When we used the randomized block design with two factors established it made the F values for both the chemical agent and the bolt larger that the F critical. This means we could reject the null hypothesis. While the one-way ANOVA only looking at the chemical agent caused the F value to be less than the F critical which means that we couldn’t reject the null hypothesis.
In conclusion: Using the two-way GAD made the chemical agent and bolt have a significant effect while the one-way ANOVA made the chemical agent not have a significant effect.