Summarize Bayesian MCMC Output

R function for summarizing MCMC output in a regression-style table.

mcmcTab(sims, ci = c(0.025, 0.975), pars = NULL, Pr = FALSE,
  ROPE = NULL, regex = FALSE)

Arguments

sims

Bayesian model object generated by R2jags, rjags, R2WinBUGS, R2OpenBUGS, MCMCpack, rstan, and rstanarm.

ci

desired level for credible intervals; defaults to c(0.025, 0.975).

pars

character vector of parameters to be printed; defaults to NULL (all parameters are printed). If not NULL, the user can either specify the exact names of parameters to be printed (e.g. c("alpha", "beta1", "beta2")) or part of a name so that all parameters containing that name will be printed (e.g. "beta" will print beta1, beta2, etc.).

Pr

print percent of posterior draws with same sign as median; defaults to FALSE.

ROPE

defaults to NULL. If not NULL, a vector of two values defining the region of practical equivalence ("ROPE"); returns % of posterior draws to the left/right of ROPE. For this quantity to be meaningful, all parameters must be on the same scale (e.g. standardized coefficients or first differences). See Kruschke (2013, Journal of Experimental Psychology 143(2): 573-603) for more on the ROPE.

regex

use regular expression matching with pars?

Value

a data frame containing MCMC summary statistics.

References

Kruschke, John K. 2013. “Bayesian Estimation Supersedes the T-Test.” Journal of Experimental Psychology: General 142 (2): 573–603. https://doi.org/10.1037/a0029146.

Examples

.old_wd <- setwd(tempdir()) # \donttest{ data("jags_logit") ## printing out table object <- mcmcTab(jags_logit, ci = c(0.025, 0.975), pars = NULL, Pr = FALSE, ROPE = NULL) object
#> Variable Median SD Lower Upper #> 1 b[1] 0.108 0.090 -0.066 0.285 #> 2 b[2] 0.527 0.166 0.197 0.837 #> 3 b[3] 0.636 0.161 0.328 0.948 #> 4 deviance 669.628 2.496 667.488 676.678
# } setwd(.old_wd)