Last active
June 1, 2021 19:13
-
-
Save MCMaurer/db9013e01f34df4f05666c563ce34df2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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