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

group_effects

Extract baggr study effects


Description

Given a baggr object, returns the raw MCMC draws of the posterior for each group's effect, or a summary of these draws. This is an internal function currently used as a helper for plotting and printing of results.

Usage

group_effects(bg, summary = FALSE, transform = NULL, interval = 0.95)

Arguments

bg

baggr object

summary

logical; if TRUE returns summary statistics as explained below.

transform

a transformation to apply to the result, should be an R function; (this is commonly used when calling group_effects from other plotting or printing functions)

interval

uncertainty interval width (numeric between 0 and 1), if summarising

Details

If summary = TRUE, the returned object contains, for each study or group, the following 5 values: the posterior medians, the lower and upper bounds of the uncertainty intervals using the central posterior credible interval of width specified in the argument interval, the posterior mean, and the posterior standard deviation.

Value

Either a matrix with MCMC samples (if summary = FALSE) or a summary of these samples (if summary = TRUE).

Examples

fit1 <- baggr(schools)
group_effects(fit1, summary = TRUE, interval = 0.5)

baggr

Bayesian Aggregate Treatment Effects

v0.4.0
GPL (>= 3)
Authors
Witold Wiecek [cre, aut], Rachael Meager [aut], Brice Green [ctb] (predict(), loo_compare, many visuals), Trustees of Columbia University [cph] (tools/make_cc.R)
Initial release

We don't support your browser anymore

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