sjPlot icon indicating copy to clipboard operation
sjPlot copied to clipboard

plot_model_diag_stan: Global priors are not plotted

Open mutlusun opened this issue 4 years ago • 1 comments

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 avatar Apr 08 '20 09:04 mutlusun

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

mutlusun avatar Jun 02 '20 09:06 mutlusun