fixef.brmsfit: Extract Population-Level Estimates

Description Usage Arguments Value Examples

View source: R/brmsfit-methods.R

Description

Extract the population-level ('fixed') effects from a brmsfit object.

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class 'brmsfit'
fixef(
  object,
  summary = TRUE,
  robust = FALSE,
  probs = c(0.025, 0.975),
  pars = NULL,
  ...
)

Arguments

object

An object of class brmsfit.

summary

Should summary statistics be returned instead of the raw values? Default is TRUE.

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. Only used if summary is TRUE.

probs

The percentiles to be computed by the quantile function. Only used if summary is TRUE.

pars

Optional names of coefficients to extract. By default, all coefficients are extracted.

...

Currently ignored.

Value

If summary is TRUE, a matrix returned by posterior_summary for the population-level effects. If summary is FALSE, a matrix with one row per posterior draw and one column per population-level effect.

Examples

1
2
3
4
5
6
7
8
## Not run: 
fit <- brm(time | cens(censored) ~ age + sex + disease, 
           data = kidney, family = "exponential")
fixef(fit)
# extract only some coefficients
fixef(fit, pars = c("age", "sex"))

## End(Not run)

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