posterior_summary: Summarize Posterior draws

Description Usage Arguments Value See Also Examples

View source: R/summary.R

Description

Summarizes posterior draws based on point estimates (mean or median), estimation errors (SD or MAD) and quantiles. This function mainly exists to retain backwards compatibility. It will eventually be replaced by functions of the posterior package (see examples below).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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,
  variable = NULL,
  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

Deprecated alias of variable. For reasons of backwards compatibility, pars is interpreted as a vector of regular expressions by default unless fixed = TRUE is specified.

variable

A character vector providing the variables to extract. By default, all variables are extracted.

Value

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

See Also

summarize_draws

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
fit <- brm(time ~ age * sex, data = kidney)
posterior_summary(fit)

# recommended workflow using posterior
library(posterior)
draws <- as_draws_array(fit)
summarise_draws(draws, default_summary_measures())

## End(Not run)

brms documentation built on Aug. 23, 2021, 5:08 p.m.