So I'm seeking to create something like this:
using my own data, specifically using the p-values I found here:
Now, I was able to produce something similar albeit with not the correct method. Specifically, I was able to produce something similar using a T-test: T test p-value
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).