I would like to use Bonferroni-adjusted p-values in a ggplot showing comparison bars, but I can't seem to figure it out.
If I use t.test
method...
ggplot(iris, aes(x = Species, y = Sepal.Length)) +
geom_boxplot() + # using `ggsignif` to display comparison of interest
geom_signif(
comparisons = list(c("versicolor", "virginica"),c('versicolor','setosa'), c('virginica', 'setosa')),
map_signif_level = TRUE,
test = t.test,
step_increase = .1,
margin_top = 0.1,
vjust = 0.5,
textsize = 3)
...then I can't add the bonferroni correction.
If I instead use the t_test
method (which DOES include a way to implement the bonferroni)...
ggplot(iris, aes(x = Species, y = Sepal.Length)) +
geom_boxplot() + # using `ggsignif` to display comparison of interest
geom_signif(
comparisons = list(c("versicolor", "virginica"),c('versicolor','setosa'), c('virginica', 'setosa')),
map_signif_level = TRUE,
test = t_test, # This method doesn't work inside geom_signif()
p.adjust.method = "bonferroni"
step_increase = .1,
margin_top = 0.1,
vjust = 0.5,
textsize = 3)
...it doesn't work at all, because t_test
does not work in this context.
Any suggestions on how to include bonferroni-adjusted p-values on a ggplot?
TIA