Best way to present results of rstanarm output?

383 Views Asked by At

I'm wondering if anyone has any recommendations for the best way to display output from rstanarm. I like texreg::screenreg and stargazer typically, but neither one accepts rstanarm objects. Bonus if it's something that takes a regular lm object as well for direct comparison of the two outputs with similar-looking tables! Thanks!

1

There are 1 best solutions below

1
On

The modelsummary package for R supports models produced by the rstanarm package out-of-the-box (dislaimer: I am the author).

For example, if you want to estimate two models and display the results in a side-by-side regression table, you could do this:

library(rstanarm)
library(modelsummary)

mod1 <- stan_glm(hp ~ mpg, data = mtcars)
mod2 <- stan_glm(hp ~ mpg + drat, data = mtcars)

models <- list(mod1, mod2)

modelsummary(models, statistic = "conf.int")

Notice that I had to manually define the statistic to be a confidence interval, since this model type does not produce a standard error.

The resulting HTML table looks like this (other available formats: LaTeX, JPG, Word):

enter image description here