Putting Multiple ANOVA P-Values on Violin Plot
1
0
Entering edit mode
10 months ago
cthangav ▴ 100

I'm creating a violin plot and trying to put brackets comparing the P-Value of MEF group to the other groups (DAY3,DAY6, DAY9), but I have not been able to find a working example that shows how to include multiple P-Values.

VP

Here is the code for the graph:

ggplot(DAY9REoverTimeSimple, aes(x=Day, y=Openness, fill = Day)) +
geom_violin() +
geom_boxplot(width=0.1) +
theme_classic() +
theme(axis.text=element_text(size=14), axis.title=element_text(size=14,face="bold")) +
scale_fill_brewer(palette = "Blues") + 
theme(plot.title = element_text(size = 14, face='bold')) 

Here are the P-Values from the ANOVA I did:

res.aov <- aov(Openness ~ Day, data = DAY9REoverTimeSimple)
ANOVA <- summary(res.aov)
Tukey <- TukeyHSD(res.aov)
> Tukey
Fit: aov(formula = Openness ~ Day, data = DAY9REoverTimeSimple)

$Day
             diff         lwr        upr     p adj
DAY3-MEF    7.0096448  3.16557140 10.8537183 0.0000052
DAY6-MEF    7.6491654  3.76950158 11.5288292 0.0000006
DAY9-MEF    4.8194108  1.09515551  8.5436661 0.0033798
violin R ANOVA • 452 views
ADD COMMENT
0
Entering edit mode
10 months ago
Asaf 10k

You can use the package ggpubr, see this tutorial

enter image description here

ADD COMMENT

Login before adding your answer.

Traffic: 1738 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6