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

plot_model_diag_stan: Global priors are not plotted #623

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mutlusun
Copy link

@mutlusun mutlusun commented Apr 8, 2020

Hello,

Many thanks for your sjPlot package! I really like it how easy model parameters and their uncertainty can be plotted.

In the latest master, I have found a small issue. In a brms model, if priors are set on a global level (specifying the same prior for all parameters) they are not plotted when calling sjPlot::plot_model(fit, type="diag").

MWE:

myd <- data.table(y=rnorm(100))
myd$x1 <- rnorm(100, mean=myd$y, sd=5)
myd$x2 <- rnorm(100, mean=myd$y, sd=10)

fit <- brms::brm(y ~ x1 + x2,
                 data=myd,
                 sample_prior=TRUE,
                 prior=c(brms::set_prior("normal(0, .2)",
                                         class="b")),
                 chains=4, iter=500)

sjPlot::plot_model(fit, type="diag")

This produces the following output:
unnamed-chunk-1-1

This pull request fixes this small issue.

Best regards

@mutlusun
Copy link
Author

mutlusun commented Jun 2, 2020

Hello,
is there anything I can do to get this fixed/merged?
Best

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

Successfully merging this pull request may close these issues.

None yet

2 participants