STHDA forum

ggpubr » [Solved] How to use p.adj in stat_compare_means()?

Administrator

rank_admin.png

Avatar

Signed up since: 10/02/2013

Messages: 32

On 08/11/2017 at 08h43
Yes, it's possible to use p.adj as the basis for p.format and display it.

Read this: http://www.sthda.com/english/wiki/add-p-values-and-significance-levels-to-ggplots#compare-two-independent-groups

Briefly, you can do this:


Code R :
 
library(ggpubr)
p <- ggboxplot(ToothGrowth, x = "supp", y = "len",
          color = "supp", palette = "jco",
          add = "jitter")
p + stat_compare_means( aes(label = format.pval(..p.adj.., digits = 3)), 
                        label.x = 1.5, label.y = 40)
 
Website    
Answer
You aren't allowed to write in this category
1 User online : 0 Administrator, 0 Moderator, 0 Member and 1 Visitor
User online : No member online