Skip to content

Instantly share code, notes, and snippets.

@MCMaurer
Last active June 1, 2021 19:13
Show Gist options
  • Save MCMaurer/db9013e01f34df4f05666c563ce34df2 to your computer and use it in GitHub Desktop.
Save MCMaurer/db9013e01f34df4f05666c563ce34df2 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(brms)
library(tidybayes)
d <- tibble(a = rnorm(1000, sd = 1),
b = rnorm(1000, sd = 5),
c = rnorm(1000, sd = 2),
d = rnorm(1000, sd = 1),
e = rnorm(1000, sd = 3))
m1 <- brm(bf(mvbind(a, b, c, d, e) ~ 1) + set_rescor(TRUE), data = d, cores = 3, chains = 3)
m1
posterior_samples(m1) %>%
select(starts_with("b_")) %>%
pivot_longer(everything()) %>%
ggplot(aes(x = value, y = name)) +
geom_vline(xintercept = 0, linetype = 2, color = "gray90") +
stat_halfeye() +
theme_bw()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment