Water Quality Data collected from 8/18/23 - 8/20/23

Since there was no overlap in time for 8/18/23 and 8/20/23, I decided not to compare these data to each other. Instead of utilizing ANOVA/Kruskal Wallis tests to compare the means between these three dates, I decided to use a t-test/Mann-Whitney-Wilcoxon to compare means between 8/18/23 and 8/19/23, using data from the shared time range, 11:45 to 23:45. Then, I did the same thing for 8/19/23 and 8/20/23, using the data from the shared time range, 00:00 to 11:45.

#Required Packages
library("ggplot2")
library("ggpubr")
library("prettydoc")


Shapiro-Wilk tests for normality to determine whether to utilize a parametric or non-parametric test

8/18/23 and 8/19/23

shapiro.test(data18_19$Chlor)
## 
##  Shapiro-Wilk normality test
## 
## data:  data18_19$Chlor
## W = 0.96725, p-value = 0.01511
shapiro.test(data18_19$DO)
## 
##  Shapiro-Wilk normality test
## 
## data:  data18_19$DO
## W = 0.95225, p-value = 0.001338
shapiro.test(data18_19$SPC)
## 
##  Shapiro-Wilk normality test
## 
## data:  data18_19$SPC
## W = 0.96136, p-value = 0.005647
shapiro.test(data18_19$pH) 
## 
##  Shapiro-Wilk normality test
## 
## data:  data18_19$pH
## W = 0.97682, p-value = 0.08353
shapiro.test(data18_19$Temp)
## 
##  Shapiro-Wilk normality test
## 
## data:  data18_19$Temp
## W = 0.94474, p-value = 0.0004402

8/19/23 and 8/20/23

shapiro.test(data19_20$Chlor)
## 
##  Shapiro-Wilk normality test
## 
## data:  data19_20$Chlor
## W = 0.86024, p-value = 6.01e-08
shapiro.test(data19_20$DO)
## 
##  Shapiro-Wilk normality test
## 
## data:  data19_20$DO
## W = 0.96026, p-value = 0.005985
shapiro.test(data19_20$SPC)
## 
##  Shapiro-Wilk normality test
## 
## data:  data19_20$SPC
## W = 0.73781, p-value = 1.161e-11
shapiro.test(data19_20$pH)
## 
##  Shapiro-Wilk normality test
## 
## data:  data19_20$pH
## W = 0.9625, p-value = 0.009575
shapiro.test(data19_20$Temp)
## 
##  Shapiro-Wilk normality test
## 
## data:  data19_20$Temp
## W = 0.95041, p-value = 0.00134

Mann-Whitney-Wilcoxon tests used to determine if there was a significant difference in means between 8/18/23 and 8/19/23 (t-test used for pH) - and boxplots for visual aid

8/18/23 and 8/19/23

wilcox.test(Chlor ~ Date, exact = FALSE, data=data18_19)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Chlor by Date
## W = 1272, p-value = 0.6139
## alternative hypothesis: true location shift is not equal to 0
a <- ggplot(data = data18_19, aes(x = Date, y = Chlor)) +
  geom_boxplot(fill = "light green") 
a

wilcox.test(DO ~ Date, exact = FALSE, data=data18_19)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  DO by Date
## W = 1297, p-value = 0.4951
## alternative hypothesis: true location shift is not equal to 0
b <- ggplot(data = data18_19, aes(x = Date, y = DO)) +
  geom_boxplot(fill = "light green") 
b

wilcox.test(SPC ~ Date, exact = FALSE, data=data18_19)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  SPC by Date
## W = 1011.5, p-value = 0.1799
## alternative hypothesis: true location shift is not equal to 0
c <- ggplot(data = data18_19, aes(x = Date, y = SPC)) +
  geom_boxplot(fill = "light green") 
c

t.test(pH ~ Date, data=data18_19) #Sig
## 
##  Welch Two Sample t-test
## 
## data:  pH by Date
## t = -6.8394, df = 94.866, p-value = 7.703e-10
## alternative hypothesis: true difference in means between group 8/18/2023 and group 8/19/2023 is not equal to 0
## 95 percent confidence interval:
##  -0.05782627 -0.03180809
## sample estimates:
## mean in group 8/18/2023 mean in group 8/19/2023 
##                6.561224                6.606042
d <- ggplot(data = data18_19, aes(x = Date, y = pH)) +
  geom_boxplot(fill = "light green") 
d

wilcox.test(Temp ~ Date, exact = FALSE, data=data18_19) #Sig
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Temp by Date
## W = 1595.5, p-value = 0.004899
## alternative hypothesis: true location shift is not equal to 0
e <- ggplot(data = data18_19, aes(x = Date, y = Temp)) +
  geom_boxplot(fill = "light green") 
e

There was a significant difference in pH, and in Water Temperature, between 8/18/23 and 8/19/23

No significant difference in Chlorophyll a, Dissolved Oxygen, or Specific Conductance were found between 8/18/23 and 8/19/23



Mann-Whitney-Wilcoxon tests used to determine if there was a significant difference in means between 8/19/23 and 8/20/23 - and boxplots for visual aid

8/19/23 and 8/20/23

wilcox.test(Chlor ~ Date, exact = FALSE, data=data19_20) #Sig
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Chlor by Date
## W = 1407, p-value = 0.02212
## alternative hypothesis: true location shift is not equal to 0
f <- ggplot(data = data18_19, aes(x = Date, y = Temp)) +
  geom_boxplot(fill = "light green") 
f

wilcox.test(DO ~ Date, exact = FALSE, data=data19_20) #Sig
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  DO by Date
## W = 1379.5, p-value = 0.0375
## alternative hypothesis: true location shift is not equal to 0
g <- ggplot(data = data18_19, aes(x = Date, y = Temp)) +
  geom_boxplot(fill = "light green") 
g

wilcox.test(SPC ~ Date, exact = FALSE, data=data19_20) #Sig
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  SPC by Date
## W = 0, p-value < 2.2e-16
## alternative hypothesis: true location shift is not equal to 0
h <- ggplot(data = data18_19, aes(x = Date, y = Temp)) +
  geom_boxplot(fill = "light green") 
h

wilcox.test(pH ~ Date, exact = FALSE, data=data19_20) #Sig
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  pH by Date
## W = 216.5, p-value = 3.922e-11
## alternative hypothesis: true location shift is not equal to 0
i <- ggplot(data = data18_19, aes(x = Date, y = Temp)) +
  geom_boxplot(fill = "light green") 
i

wilcox.test(Temp ~ Date, exact = FALSE, data=data19_20) #Sig
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Temp by Date
## W = 1891.5, p-value = 2.154e-09
## alternative hypothesis: true location shift is not equal to 0
j <- ggplot(data = data18_19, aes(x = Date, y = Temp)) +
  geom_boxplot(fill = "light green") 
j

There was a significant difference in Chlorophyll a, Dissolved Oxygen, Specific Conductance, pH, and Water Temperature between 8/19/23 and 8/20/23.