Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change map_signif_level #30

Closed
jaison75 opened this issue Sep 8, 2017 · 4 comments
Closed

How to change map_signif_level #30

jaison75 opened this issue Sep 8, 2017 · 4 comments

Comments

@jaison75
Copy link

jaison75 commented Sep 8, 2017

I am trying to change the significance intervals and the associated *s for the output. I thought map_signif_level should do the trick. Am I wrong? Is there a way to do it. I would appreciate any help.
Thanks
JJ

bonferroni_n <- 4828
symnum.args <- list(cutpoints = c(0, 0.05/bonferroni_n, 0.05, 1), symbols = c("***", "*", "ns"))

Output of compare_means works when I try the following
compare_means(len ~ dose, data = ToothGrowth,method="t.test", symnum.args = symnum.args)

I thought the following should work for the stat_compare_means, but it doesnot.
ggboxplot(ToothGrowth, x = "dose", y = "len" ) +
stat_compare_means( comparisons = my_comparisons,
method = "t.test",
label="p.signif",
paired = TRUE,
map_signif_level = c("***"=0.05/bonferroni_n , "**"=0.001, "*"=0.05) )

@kassambara
Copy link
Owner

Hi,

In the current version the function stat_compare_means() don't support the argument map_signif_level. I'll work on that.

Thanks

@elijahrockers
Copy link

As far as I can tell, the significance symbols are still hard coded into stat_compare_means(). Any movement on this? I'd love to be able to control the asterisks on my graphs.

@elijahrockers
Copy link

elijahrockers commented Dec 18, 2017

kassambara added a commit that referenced this issue Dec 19, 2017
@kassambara
Copy link
Owner

After installing the latest developmental version (devtools::install_github("kassambara/ggpubr")), type this:

df <- ToothGrowth
df$dose <- factor(df$dose)


comparisons <- list(
  c("0.5", "1"), c("1", "2"),
  c("0.5", "2")
)

symnum.args <- list(
  cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), 
  symbols = c("xxxx", "***", "**", "*", "ns")
  )

ggplot(df, aes(dose, len)) +
geom_boxplot()+
  stat_compare_means(
    comparisons = comparisons,
    label = "p.signif",
    symnum.args = symnum.args
    )

The output should look like this:

ggplot-significance-levels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants