Bonferroni p adjusted value with Bar Plot

I am a new user, and I am happy to be now part of this community :slight_smile:
I am having issues adding the adjusted pvalues (after the Bonferroni correction) on top of the boxplot (using the packages ggplot2) for statistical significance.

My actual code is:
boxplot(MEs_tdf1[,-1], boxfill = NA, border = NA) #invisible boxes - only axes and plot area
boxplot(MEs_tdf1[MEs_tdf1$cluster=="1", -1], xaxt = "n", add = TRUE, boxfill="red",
boxwex=0.25, at = 1:ncol(MEs_tdf1[,-1]) - 0.15) #shift these left by -0.15
boxplot(MEs_tdf1[MEs_tdf1$cluster=="2", -1], xaxt = "n", add = TRUE, boxfill="blue",
boxwex=0.25, at = 1:ncol(MEs_tdf1[,-1]) + 0.15)

If someone can guide me on how to plot * for p< 0.001, ** for p < 0.0001, *** for p < 0.00001 on top of the bar plots, I shall be highly grateful to you.

Thanking you.

1 Like

Maybe this link could help you, @beowulf.jayseon

I suspect @ M_AcostaCH's suggestion may give better results overall but at its simplest with boxplot.

xx <-   sample(1:20, 100, replace = TRUE)
text(1, 20.5, cex = 2,"***")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.