Learn R Programming

baggr (version 0.2.0)

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, interval = 0.95)

Arguments

bg

baggr object

summary

logical; if TRUE returns summary statistics as explained below.

interval

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

Value

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

Details

If summary = TRUE, the returned object contains for each study or group: 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.

Examples

Run this code
# NOT RUN {
fit1 <- baggr(schools)
group_effects(fit1, summary = TRUE, interval = 0.5)
# }

Run the code above in your browser using DataLab