Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

posterior_summary

Summarize Posterior Samples


Description

Summarizes posterior samples based on point estimates (mean or median), estimation errors (SD or MAD) and quantiles.

Usage

posterior_summary(x, ...)

## Default S3 method:
posterior_summary(x, probs = c(0.025, 0.975), robust = FALSE, ...)

## S3 method for class 'brmsfit'
posterior_summary(x, pars = NA, probs = c(0.025, 0.975), robust = FALSE, ...)

Arguments

x

An R object.

...

More arguments passed to or from other methods.

probs

The percentiles to be computed by the quantile function.

robust

If FALSE (the default) the mean is used as the measure of central tendency and the standard deviation as the measure of variability. If TRUE, the median and the median absolute deviation (MAD) are applied instead.

pars

Names of parameters for which posterior samples should be returned, as given by a character vector or regular expressions. By default, all posterior samples of all parameters are extracted.

Value

A matrix where rows indicate parameters and columns indicate the summary estimates.

Examples

## Not run: 
fit <- brm(time ~ age * sex, data = kidney)
posterior_summary(fit)

## End(Not run)

brms

Bayesian Regression Models using 'Stan'

v2.15.0
GPL-2
Authors
Paul-Christian Bürkner [aut, cre], Jonah Gabry [ctb], Sebastian Weber [ctb], Andrew Johnson [ctb], Martin Modrak [ctb]
Initial release
2021-03-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.