<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/quick-sjplot-status-update-rstats-rstanarm-ggplot2/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://strengejacke.wordpress.com/2017/09/15/quick-sjplot-status-update-rstats-rstanarm-ggplot2/"> R – Strenge Jacke!</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>I’m working on the next update of my <a rel="nofollow" href="https://cran.r-project.org/package=sjPlot" target="_blank">sjPlot-package</a>, which will get a generic <code>plot_model()</code> method, which plots any kind of regression model, with different plot types being supported (forest plots for estimates, marginal effects and predictions, including displaying interaction terms, …).</p>
<p>The package also supports <code>rstan</code> resp. <code>rstanarm</code> models. Since these are typically presented in a slightly different way (e.g., „outer“ and „inner“ probability of credible intervals), I implemented a special handling for these models, for which I wanted to show a quick preview here:</p>
<p><code>
<pre>
library(sjPlot)
library(rstanarm)

m &lt;- stan_glm(
  mpg ~ cyl + disp + drat + wt + gear + am,
  data = mtcars
)

plot_model(m) + theme_sjplot()
</pre>
<p></p>
<p><a rel="nofollow" href="https://strengejacke.files.wordpress.com/2017/09/rstan_plot.png" target="_blank"><img data-orig-file="https://strengejacke.files.wordpress.com/2017/09/rstan_plot.png" data-orig-size="800,600" data-medium-file="https://strengejacke.files.wordpress.com/2017/09/rstan_plot.png?w=300" data-attachment-id="1403" data-image-meta="{" data-image-description="" src="https://strengejacke.files.wordpress.com/2017/09/rstan_plot.png?w=450&h=567&fit=756%2C567" data-permalink="https://strengejacke.wordpress.com/2017/09/15/quick-sjplot-status-update-rstats-rstanarm-ggplot2/rstan_plot/" data-large-file="https://strengejacke.files.wordpress.com/2017/09/rstan_plot.png?w=450&amp;h=567&amp;fit=756%2C567" alt="" data-image-title="rstan_plot" sizes="(max-width: 756px) 100vw, 756px" data-comments-opened="1" class="wp-image-1403" data-recalc-dims="1"></a></p>
<p>The thin error bars represent the High Density Intervals (HDI) specified in the <code>ci.lvl</code> argument, the thick bar is the 50%-HDI, and the white point is the posterior median.</p>
<p>This is still work in progress, the latest version is <a rel="nofollow" href="https://github.com/strengejacke/sjPlot" target="_blank">on GitHub</a>…</p>
<p> Tagged: <a rel="nofollow" href="https://strengejacke.wordpress.com/tag/data-visualization/" target="_blank">data visualization</a>, <a rel="nofollow" href="https://strengejacke.wordpress.com/tag/ggplot/" target="_blank">ggplot</a>, <a rel="nofollow" href="https://strengejacke.wordpress.com/tag/r/" target="_blank">R</a>, <a rel="nofollow" href="https://strengejacke.wordpress.com/tag/rstan/" target="_blank">rstan</a>, <a rel="nofollow" href="https://strengejacke.wordpress.com/tag/rstanarm/" target="_blank">rstanarm</a>, <a rel="nofollow" href="https://strengejacke.wordpress.com/tag/rstats/" target="_blank">rstats</a>, <a rel="nofollow" href="https://strengejacke.wordpress.com/tag/sjplot/" target="_blank">sjPlot</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/strengejacke.wordpress.com/1402/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/comments/strengejacke.wordpress.com/1402/"></a> <img border="0" alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" data-recalc-dims="1"></p>

				
		
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://strengejacke.wordpress.com/2017/09/15/quick-sjplot-status-update-rstats-rstanarm-ggplot2/"> R – Strenge Jacke!</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/zf6b4r-5T3M" height="1"></a></div></code>