QMM7301 Module 7 Applied Activity
Sprouts
An experiment on mung beans was performed to investigate the environmental effects of salinity and water temperature on sprouting. Beans were randomly allocated to each of 36 petri dishes that were subject to one of four levels of Salinity (0ppm, 4ppm, 8ppm, and 12 ppm) and one of three Temperatures (32°C, 34°C, or 36° C). After 48 hours, the biomass of the sprouts in grams per meter (gm) was measured to determine which combination of Salinity and Temperature results in the highest biomass of bean sprouts. a.
boxplot(Biomass~Temperature, sprouts, col = rainbow(10), ylab="Biomass", main="Effects on Sprouting")boxplot(Biomass~Salinity*Temperature, sprouts, col = rainbow(10), ylab="Biomass",
main="Effects on Sprouting")Based on these plots, explain if you think higher or lower salinity and temperatures result in higher biomass for sprouts.
-Low Salinity does but it varies. High temperature is a bit trickier. The variation in the boxplot is quite high for me to say that it does though.
- State the null and alternative hypotheses for a two-way analysis of variance to determine the effect the factors salinity and temperature have on biomass.
State the null & alternative hypothesis \[ H_0: μ\text{ Levels of Salinity Factors are Equal} \\ H_0: μ\text{ Levels of Temperature Factors are Equal} \\ H_0: \text{ Interaction: The effects of Salinity Factor are constant across the Temperature} \\ H_A: \text{At Least one μ is different} \]
## Df Sum Sq Mean Sq F value Pr(>F)
## Salinity 3 36.47 12.157 16.981 3.93e-06 ***
## Temperature 2 34.72 17.358 24.247 1.73e-06 ***
## Salinity:Temperature 6 5.30 0.883 1.233 0.324
## Residuals 24 17.18 0.716
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We reject the null that levels of Salinity factors are equal We reject the null that levels of Temperature Factors are equal We fail to reject the null that the effects of salinity factors are constant across the temperatures recorded
Are the similar variance and normality conditions satisfied? Create at least 2 plots and interpret the plots to explain your answers.
Reference line is a bit flat showing no signs of unequal variance.-
First Image Normal population assumption is also met. There’s no strong
skew even though it’s left skewing
- Create an interaction plot (Hint: use temperature on the x-axis). Explain how this plot supports the conclusion from the ANOVA test regarding the significance of the main effects and interaction.
interaction.plot(sprouts$Temperature, sprouts$Salinity, sprouts$Biomass,
xlab="Temperature", ylab="Biomass",
main="Interaction Plot", trace.label="Salinity")
The lines vary and diverge. Very difficult to tell if they’ll intersect
supporting the anova test
- Perform Tukey’s HSD Test. Interpret any significant values. Which
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Biomass ~ Salinity * Temperature, data = sprouts)
##
## $Salinity
## diff lwr upr p adj
## 12ppm-0ppm -2.5877778 -3.6880751 -1.48748050 0.0000059
## 4ppm-0ppm -0.5922222 -1.6925195 0.50807506 0.4617796
## 8ppm-0ppm -1.7677778 -2.8680751 -0.66748050 0.0009488
## 4ppm-12ppm 1.9955556 0.8952583 3.09585284 0.0002274
## 8ppm-12ppm 0.8200000 -0.2802973 1.92029728 0.1962785
## 8ppm-4ppm -1.1755556 -2.2758528 -0.07525828 0.0331843
##
## $Temperature
## diff lwr upr p adj
## 34C-32C 2.064167 1.201548 2.926786 0.0000105
## 36C-32C 2.101667 1.239048 2.964286 0.0000081
## 36C-34C 0.037500 -0.825119 0.900119 0.9935251
##
## $`Salinity:Temperature`
## diff lwr upr p adj
## 12ppm:32C-0ppm:32C -1.5533333 -4.04426389 0.93759722 0.5340926
## 4ppm:32C-0ppm:32C -0.1566667 -2.64759722 2.33426389 1.0000000
## 8ppm:32C-0ppm:32C -0.8766667 -3.36759722 1.61426389 0.9756898
## 0ppm:34C-0ppm:32C 2.8800000 0.38906945 5.37093055 0.0141316
## 12ppm:34C-0ppm:32C 0.2266667 -2.26426389 2.71759722 0.9999999
## 4ppm:34C-0ppm:32C 1.6766667 -0.81426389 4.16759722 0.4261727
## 8ppm:34C-0ppm:32C 0.8866667 -1.60426389 3.37759722 0.9736494
## 0ppm:36C-0ppm:32C 3.0566667 0.56573611 5.54759722 0.0077689
## 12ppm:36C-0ppm:32C -0.5000000 -2.99093055 1.99093055 0.9997919
## 4ppm:36C-0ppm:32C 2.6400000 0.14906945 5.13093055 0.0311529
## 8ppm:36C-0ppm:32C 0.6233333 -1.86759722 3.11426389 0.9984269
## 4ppm:32C-12ppm:32C 1.3966667 -1.09426389 3.88759722 0.6760842
## 8ppm:32C-12ppm:32C 0.6766667 -1.81426389 3.16759722 0.9968045
## 0ppm:34C-12ppm:32C 4.4333333 1.94240278 6.92426389 0.0000656
## 12ppm:34C-12ppm:32C 1.7800000 -0.71093055 4.27093055 0.3440602
## 4ppm:34C-12ppm:32C 3.2300000 0.73906945 5.72093055 0.0042805
## 8ppm:34C-12ppm:32C 2.4400000 -0.05093055 4.93093055 0.0585416
## 0ppm:36C-12ppm:32C 4.6100000 2.11906945 7.10093055 0.0000360
## 12ppm:36C-12ppm:32C 1.0533333 -1.43759722 3.54426389 0.9189185
## 4ppm:36C-12ppm:32C 4.1933333 1.70240278 6.68426389 0.0001495
## 8ppm:36C-12ppm:32C 2.1766667 -0.31426389 4.66759722 0.1271418
## 8ppm:32C-4ppm:32C -0.7200000 -3.21093055 1.77093055 0.9946425
## 0ppm:34C-4ppm:32C 3.0366667 0.54573611 5.52759722 0.0083177
## 12ppm:34C-4ppm:32C 0.3833333 -2.10759722 2.87426389 0.9999847
## 4ppm:34C-4ppm:32C 1.8333333 -0.65759722 4.32426389 0.3055630
## 8ppm:34C-4ppm:32C 1.0433333 -1.44759722 3.53426389 0.9234167
## 0ppm:36C-4ppm:32C 3.2133333 0.72240278 5.70426389 0.0045343
## 12ppm:36C-4ppm:32C -0.3433333 -2.83426389 2.14759722 0.9999950
## 4ppm:36C-4ppm:32C 2.7966667 0.30573611 5.28759722 0.0186580
## 8ppm:36C-4ppm:32C 0.7800000 -1.71093055 3.27093055 0.9898447
## 0ppm:34C-8ppm:32C 3.7566667 1.26573611 6.24759722 0.0006827
## 12ppm:34C-8ppm:32C 1.1033333 -1.38759722 3.59426389 0.8939622
## 4ppm:34C-8ppm:32C 2.5533333 0.06240278 5.04426389 0.0410971
## 8ppm:34C-8ppm:32C 1.7633333 -0.72759722 4.25426389 0.3566606
## 0ppm:36C-8ppm:32C 3.9333333 1.44240278 6.42426389 0.0003685
## 12ppm:36C-8ppm:32C 0.3766667 -2.11426389 2.86759722 0.9999872
## 4ppm:36C-8ppm:32C 3.5166667 1.02573611 6.00759722 0.0015793
## 8ppm:36C-8ppm:32C 1.5000000 -0.99093055 3.99093055 0.5825667
## 12ppm:34C-0ppm:34C -2.6533333 -5.14426389 -0.16240278 0.0298397
## 4ppm:34C-0ppm:34C -1.2033333 -3.69426389 1.28759722 0.8320266
## 8ppm:34C-0ppm:34C -1.9933333 -4.48426389 0.49759722 0.2076802
## 0ppm:36C-0ppm:34C 0.1766667 -2.31426389 2.66759722 1.0000000
## 12ppm:36C-0ppm:34C -3.3800000 -5.87093055 -0.88906945 0.0025434
## 4ppm:36C-0ppm:34C -0.2400000 -2.73093055 2.25093055 0.9999999
## 8ppm:36C-0ppm:34C -2.2566667 -4.74759722 0.23426389 0.1012444
## 4ppm:34C-12ppm:34C 1.4500000 -1.04093055 3.94093055 0.6281200
## 8ppm:34C-12ppm:34C 0.6600000 -1.83093055 3.15093055 0.9974159
## 0ppm:36C-12ppm:34C 2.8300000 0.33906945 5.32093055 0.0167018
## 12ppm:36C-12ppm:34C -0.7266667 -3.21759722 1.76426389 0.9942239
## 4ppm:36C-12ppm:34C 2.4133333 -0.07759722 4.90426389 0.0635245
## 8ppm:36C-12ppm:34C 0.3966667 -2.09426389 2.88759722 0.9999784
## 8ppm:34C-4ppm:34C -0.7900000 -3.28093055 1.70093055 0.9887901
## 0ppm:36C-4ppm:34C 1.3800000 -1.11093055 3.87093055 0.6908149
## 12ppm:36C-4ppm:34C -2.1766667 -4.66759722 0.31426389 0.1271418
## 4ppm:36C-4ppm:34C 0.9633333 -1.52759722 3.45426389 0.9536254
## 8ppm:36C-4ppm:34C -1.0533333 -3.54426389 1.43759722 0.9189185
## 0ppm:36C-8ppm:34C 2.1700000 -0.32093055 4.66093055 0.1295331
## 12ppm:36C-8ppm:34C -1.3866667 -3.87759722 1.10426389 0.6849412
## 4ppm:36C-8ppm:34C 1.7533333 -0.73759722 4.24426389 0.3643462
## 8ppm:36C-8ppm:34C -0.2633333 -2.75426389 2.22759722 0.9999997
## 12ppm:36C-0ppm:36C -3.5566667 -6.04759722 -1.06573611 0.0013733
## 4ppm:36C-0ppm:36C -0.4166667 -2.90759722 2.07426389 0.9999647
## 8ppm:36C-0ppm:36C -2.4333333 -4.92426389 0.05759722 0.0597530
## 4ppm:36C-12ppm:36C 3.1400000 0.64906945 5.63093055 0.0058384
## 8ppm:36C-12ppm:36C 1.1233333 -1.36759722 3.61426389 0.8828335
## 8ppm:36C-4ppm:36C -2.0166667 -4.50759722 0.47426389 0.1956268
For this particular test
0ppm:36C
The difference in means is the most statistically significant
g.Create a grouped bar plot for the mean of biomass by salinity and temperature.
## 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
0ppm:36C Has the highest biomass
## Df Sum Sq Mean Sq F value Pr(>F)
## Program 2 10.1 5.070 0.669 0.514
## Residuals 147 1114.6 7.582
Ho: Means of Programs are similar
HA: At least one of the means of the programs is different
We reject the null at alpha of 0.05. The means of each program differ significantly.