Closed ibecav closed 4 years ago
library(tidyverse)
library(ggsignif)
library(BayesFactor)
#> Loading required package: coda
#> Loading required package: Matrix
#>
#> Attaching package: 'Matrix'
#> The following object is masked from 'package:tidyr':
#>
#> expand
#> ************
#> Welcome to BayesFactor 0.9.12-4.2. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
#>
#> Type BFManual() to open the manual.
#> ************
xxx <- msleep %>% filter(!is.na(vore), !is.na(brainwt))
magic1 <- function(x = NULL, y = NULL) {
results <- ttestBF(x = x, y = y) %>%
extractBF() %>%
mutate(p.value = bf)
return(results)
}
ggplot(xxx, aes(x=vore, y=brainwt)) +
geom_boxplot() +
geom_signif(comparisons = list(c("carni", "herbi"),
c("carni", "insecti"),
c("carni", "omni")
),
test = "magic1",
step_increase = .1)
Created on 2019-07-12 by the reprex package (v0.3.0)
closed in favor of https://github.com/IndrajeetPatil/pairwiseComparisons/issues/10
Hi Indrajeet,
Was working on multiple comparisons for bayes analysis see https://ibecav.netlify.com/post/pairwise-bayesian-comparisons-even-faster/ when it struck me that a nice future feature for ggstatsplot::ggbetweenstats might be to display BF10 similar to the way you do p values for parametric.
I hacked at your code a little bit
signif_column
andpairwise_p
and the reprex kind of shows what's possible...Created on 2019-07-11 by the reprex package (v0.3.0)