I'm seeking to create something like this:
Using my own data, I would be specifically using the p-values I found here:
I was able to produce something similar, albeit with the incorrect method. Specifically, I was able to produce something similar using a T-test:
I produced this by writing this code:
l<- ggplot(VioPos, aes(x=Regulation, y=Score,fill=Regulation)) +
geom_violin(trim=FALSE)+
labs(title="Plot of ARE Scores by Regulation",x="Gene Regulation", y = "ARE Score")+
geom_boxplot(width=0.1,fill="white")+
theme_classic()
l
dp <- l + scale_y_continuous(trans="log2")
dp
dp7 <- dp +
stat_compare_means(comparisons=my_comparisons, method="t.test")
dp7
In other words, I utilized stat_compare_means()
using ggplot2/tidyverse/ggpubr/rstatix.
However, if I modify the method in the code, it seems to display correctly for Wilcoxon and T tests, but not for ANOVA and Kruskal-Wallis tests. Moreover, it seems that stat_compare_means()
only supports those four and not KS, but I'm specifically interested in plotting mean comparisons from my KS test output onto my violin plots.
Is there some other package I can use?
Also please note: for the KS test, the "UpScorePos" "DownScorePos" etc. was to compare ARE score by regulation (as I did with the graphs in the T test).