QMM7301 Module 6 Applied Activity
Soap Experiment [ANOVA]
A student investigated just how effective washing with soap is in eliminating bacteria. To do this she tested four different methods—washing with water only, washing with regular soap, washing with antibacterial soap, and spraying hands with antibacterial spray (containing 65% ethanol as an active ingredient).
- State the null & alternative hypothesis \[ H_0: μ.water= μ.watersoap = μ.antibacteria = μ.antibacterialspray \\ H_A: \text{At Least one μ is different} \]
- Perform a one-way ANOVA in R and print out the completed summary table.
## Df Sum Sq Mean Sq F value Pr(>F)
## Method 3 29882 9961 7.064 0.00111 **
## Residuals 28 39484 1410
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
- Determine the critical F Values
F Value = 2.9466853
- At 𝛼 = 0.05 state your decision regarding the null hypothesis \[ \text{We reject the null. P.Value is less than 𝛼 of 0.05 meaning there is evidence that means of each experimental handwash method differ significantly} \]
- Check the independence, equal variance, and normal population assumptions.
–> Independence assumption is met, she randomized the order of the experiments so they do not influence each other
We’ll check for equal variance below
I built a boxplot to check for euqal variance visually.The soap method is a bit skewed with one very noticeable outlier. The residuals vs fitted is also almost horizontal so we can assume equal variance mostly holds
Normal Population assumption holds. On the Q-Q residual plot, the observations mostly close to the line
- Create a bar plot with error bars for the average bacterial count for each hand washing method.
## Warning: package 'ggplot2' was built under R version 4.5.1
## Warning: package 'Hmisc' was built under R version 4.5.1
##
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:base':
##
## format.pval, units
The alcohol spray looks to be the most effective having the least bacterial count by a very noticeable margin
- Perform Tukey’s HSD test to confirm your results from the bar plot.
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Bacterial.Counts ~ Method, data = soap.data)
##
## $Method
## diff lwr upr p adj
## Antibacterial Soap-Alcohol Spray 55.0 3.735849 106.26415 0.0319648
## Soap-Alcohol Spray 68.5 17.235849 119.76415 0.0055672
## Water-Alcohol Spray 79.5 28.235849 130.76415 0.0012122
## Soap-Antibacterial Soap 13.5 -37.764151 64.76415 0.8886944
## Water-Antibacterial Soap 24.5 -26.764151 75.76415 0.5675942
## Water-Soap 11.0 -40.264151 62.26415 0.9355196
The interpretation here implies that there is statistically significant difference in the following pairing as we fail to reject the null when paired together
| Method | Method |
|---|---|
| Soap | Antibacterial Soap |
| Water | Antibacterial Soap |
| Water | Soap |