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

Plotly with halfeye plots for bayesian posterior probabilities #1667

Closed
albertocarm opened this issue Dec 2, 2019 · 1 comment
Closed

Plotly with halfeye plots for bayesian posterior probabilities #1667

albertocarm opened this issue Dec 2, 2019 · 1 comment

Comments

@albertocarm
Copy link

albertocarm commented Dec 2, 2019

It would be nice if these graphs could be interactive to show the bayesian posterior probability.
The user should get the area to the right of point x (probability of effect great than x)
Is that possible?

library(tidyr)
library(tidybayes)
library(ggplot2)
set.seed(1234)
pp2<-tribble(
  ~y,    ~x, 
  
  "a1", exp(rnorm(8000, 0.16, 0.04)),
  "a2", exp(rnorm(8000, 0.24, 0.1)),
  "b1", exp(rnorm(8000, 0.24, 0.1)),
  "b2", exp(rnorm(8000, 0.24, 0.1)),
  "c1", exp(rnorm(8000, 0.16, 0.04)),
  "c2", exp(rnorm(8000, 0.19, 0.09)),
  "c3", exp(rnorm(8000, 0.18, 0.07)),
  "d1", exp(rnorm(8000, 0.16, 0.04)),
  "d2", exp(rnorm(8000, 0.24, 0.08)),
  "d3", exp(rnorm(8000, 0.17, 0.09)),
  "d4", exp(rnorm(8000, 0.2, 0.1)),
) %>%
  unnest(x) %>%
  ggplot(aes(x, y ) ) +
  geom_halfeyeh()+
  geom_vline(xintercept = c( 1), linetype = "dashed") +
  scale_fill_manual(values = c("blue", "gray80"), limits=c(0.1,0.7) ) + theme_tidybayes()
ggplotly(pp2) # doest not work


@cpsievert
Copy link
Collaborator

Thanks, added tidybayes to #566.

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

2 participants