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

Missing p-value with multiple comparisons #8

Closed
Albluca opened this issue Apr 24, 2017 · 3 comments
Closed

Missing p-value with multiple comparisons #8

Albluca opened this issue Apr 24, 2017 · 3 comments

Comments

@Albluca
Copy link
Contributor

Albluca commented Apr 24, 2017

Hi there,

first of all, thank you for your package. It's very helpful! I'm using the package to display the result of multiple tests and some p-vals are not plotted

This is an example with synthetic data:

library(ggplot2)
library(ggsignif)

ggplot(data.frame(y=runif(100), x=sample(c("A", "B", "C", "D"), size = 100, replace = TRUE)), aes(x = x, y=y)) +
geom_boxplot() + geom_signif(comparisons = list(c(1,2), c(2,3), c(1,3), c(1,4), c(2,4)), step_increase = .1)

and this is the result:

image

I tried playing around with the "step_increase", but it did not helped ... Any idea on how to fix it? Thanks!

Best wishes,
Luca

@ACMGlueck
Copy link

Hi Luca,

As it happens, I faced the same issue. My solution was to make separate geom_signif() layers for the various comparisons as in here:

ggplot(data.frame(y=runif(100), x=sample(c("A", "B", "C", "D"), size = 100, replace = TRUE)), aes(x = x, y=y)) + geom_boxplot() + geom_signif(comparisons = list(c(1,2)), y_position=1.0) + geom_signif(comparisons = list(c(2,3)), y_position=1.1) + geom_signif(comparisons = list(c(1,3)), y_position=1.2) + geom_signif(comparisons = list(c(1,4)), y_position=1.3) + geom_signif(comparisons = list(c(2,4)), y_position=1.4)

You may be able to combine some of your comparisons in one layer and in this manner to reduce the number of layers, but the basic solution remains the same: separate layers for those values that don't show up.

I hope this helps,

Anton

@const-ae
Copy link
Owner

Hi Albluca,

thanks for raising the issue, this was indeed a bug. The internal grouping of the data was erroneous if multiple brackets referenced the same group.

I have fixed the bug and uploaded a new version to github which you can install like this:

devtools::install_github("Artjom-Metro/ggsignif")

image

@Albluca
Copy link
Contributor Author

Albluca commented Apr 24, 2017

Thank you both for your replay! I updated the package and indeed it works brilliantly.

BW,
Luca

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