I am analyzing data on some biossays and I need an advice on which statistical analysis to use and how to use ggplot2 R package to better visualize the results.
As you can see in the above image I have infected bean plants with a pathogen, a Pseudomonas bacterium, and then tested the treatment with bacteriophages applied at the same time or 1h before the inoculation. In the scatter plot on the right you can see two repetitions of the four I have. In each plot on the y axis there is the disease index of the plants (from healthy plants designed by 0 to deceased plants, 5). I wanted to test if there is a significant difference between the four cases (positive and negative control and the two phage applications) and between all the possible pairs. I tried with Kruskal-Wallis test and Wilcoxon paired test and I found out that there are significant differences only in two of the four repetition (the two represented).
Now the doubts I have: 1) Are there better suited statistical tests I can conduct? 2) There is a better way to visualize dthe data (I applied the letters directly on the image with power point, but I would prefer to do all by an R script)
I add here the script I used to analyze the data.
# load libraries
library(tidyverse)
library(patchwork)
library(broom)
library(agricolae)
library(ggplot2)
library (reshape2)
#Clear the Worskspace
rm(list=ls())
# Read data
DF<- read_csv2("R_summary_bioassay_4.csv")
#Looks at data as structure , first rows or whole dataset
str(DF)
head(DF)
View(DF)
DF1 <- DF %>%
filter(date=="23/11/2020")
DF2 <- DF %>%
filter(date=="18/02/2022")
DF3 <- DF %>%
filter(date=="22/03/2022")
DF4 <- DF %>%
filter(date=="29/04/2022")
class(DF$treatment)
plot1 <- DF1 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_col(fill = "grey") +
geom_jitter(data = DF,
aes(x = treatment,
y = index),
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
labs(title = "23/11/2020",
x = "Treatment",
y = "Disease index")
plot1
plot2 <- DF2 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_col(fill = "grey") +
geom_jitter(data = DF,
aes(x = treatment,
y = index),
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
labs(title = "18/02/2022",
# caption = paste0("ANOVA value: ", unique(x$ANOVA)),
x = "Treatment",
y = "Disease index")
plot2
plot3 <- DF3 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_col(fill = "grey") +
geom_jitter(data = DF,
aes(x = treatment,
y = index),
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
labs(title = "23/03/2022",
# caption = paste0("ANOVA value: ", unique(x$ANOVA)),
x = "Treatment",
y = "Disease index")
plot3
plot4<- DF4 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_col(fill = "grey") +
geom_jitter(data = DF,
aes(x = treatment,
y = index),
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
labs(title = "23/03/2022",
# caption = paste0("ANOVA value: ", unique(x$ANOVA)),
x = "Treatment",
y = "Disease index")
plot4
scatterplot1 <- DF1 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_jitter(data = DF1,
aes(x = treatment,
y = index, colour = treatment),
show.legend = F,
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
theme(axis.text.x = element_text(angle = -15, vjust = 0.5, hjust=0)) +
labs(title = "23/11/2020",
# caption = paste0("ANOVA value: ", unique(x$ANOVA)),
x = "Treatment",
y = "Disease index")
scatterplot1
scatterplot2 <- DF2 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_jitter(data = DF2,
aes(x = treatment,
y = index, colour = treatment),
show.legend = F,
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
theme(axis.text.x = element_text(angle = -15, vjust = 0.5, hjust=0)) +
labs(title = "18/02/202",
# caption = paste0("ANOVA value: ", unique(x$ANOVA)),
x = "Treatment",
y = "Disease index")
scatterplot2
scatterplot3 <- DF3 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_jitter(data = DF3,
aes(x = treatment,
y = index, colour = treatment),
show.legend = F,
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
theme(axis.text.x = element_text(angle = -15, vjust = 0.5, hjust=0)) +
labs(title = "22/03/2022",
# caption = paste0("ANOVA value: ", unique(x$ANOVA)),
x = "Treatment",
y = "Disease index")
scatterplot3
scatterplot4 <- DF4 %>%
ggplot(aes(x = treatment,
y = index)) +
geom_jitter(data = DF4,
aes(x = treatment,
y = index, colour = treatment),
show.legend = F,
width = 0.1, height = 0) +
theme_classic() +
theme(text = element_text(size = 20 )) +
theme(axis.title.y = element_text(size = 14)) +
theme(axis.text.x = element_text(angle = -15, vjust = 0.5, hjust=0)) +
labs(title = "29/04/2022",
# caption = paste0("ANOVA value: ", unique(x$ANOVA)),
x = "Treatment",
y = "Disease index")
scatterplot4
kruskal.test(index ~ treatment, data = DF1)
kruskal.test(index ~ treatment, data = DF2)
kruskal.test(index ~ treatment, data = DF3)
kruskal.test(index ~ treatment, data = DF4)
pairwise.wilcox.test(DF1$index, DF1$treatment,
p.adjust.method = "BH")
pairwise.wilcox.test(DF2$index, DF2$treatment,
p.adjust.method = "BH")
pairwise.wilcox.test(DF3$index, DF3$treatment,
p.adjust.method = "BH")
pairwise.wilcox.test(DF4$index, DF4$treatment,
p.adjust.method = "BH")
dput
stackoverflow.com/help/minimal-reproducible-example $\endgroup$