pooling: Pooling metrics and related statistics for baggr

View source: R/pooling_metrics.R

poolingR Documentation

Pooling metrics and related statistics for baggr


Compute statistics relating to pooling in a given baggr meta-analysis model returns statistics, for either the entire model or individual groups, such as pooling statistic by Gelman & Pardoe (2006), I-squared, H-squared, or study weights; heterogeneity is a shorthand for pooling(type = "total") weights is shorthand for pooling(metric = "weights")


  metric = c("pooling", "isq", "hsq", "weights"),
  type = c("groups", "total"),
  summary = TRUE

  metric = c("pooling", "isq", "hsq", "weights"),
  summary = TRUE

## S3 method for class 'baggr'
weights(object, ...)



a baggr model


"pooling" for Gelman & Pardoe statistic P, "isq" for I-squared statistic (1-P, Higgins & Thompson, 2002) "hsq" for H squared statistic (1/P, ibid.); "weights" for study weights; also see Details


In pooling calculation is done for each of the "groups" (default) or for "total" hypereffect(s).


logical; if FALSE a whole vector of pooling values is returned, otherwise only the means and intervals


baggr model for which to calculate group (study) weights


Unused, please ignore.


Pooling statistic (Gelman & Pardoe, 2006) describes the extent to which group-level estimates of treatment effect are "pooled" toward average treatment effect in the meta-analysis model. If pooling = "none" or "full" (which you specify when calling baggr), then the values are always 0 or 1, respectively. If pooling = "partial", the value is somewhere between 0 and 1. We can distinguish between pooling of individual groups and overall pooling in the model.

In many contexts, i.e. medical statistics, it is typical to report 1-P, called I^2 (see Higgins and Thompson, 2002; sometimes another statistic, H^2 = 1 / P, is used). Higher values of I-squared indicate higher heterogeneity; Von Hippel (2015) provides useful details for I-squared calculations (and some issues related to it, especially in frequentist models). See Gelman & Pardoe (2006) Section 1.1 for a short explanation of how R^2 statistic relates to the pooling metric.

Group pooling

This is the calculation done by pooling() if type = "groups" (default). In a partial pooling model (see baggr and above), group k (e.g. study) has standard error of treatment effect estimate, se_k. The treatment effect (across k groups) is variable across groups, with hyper-SD parameter σ_(τ).

The quantity of interest is ratio of variation in treatment effects to the total variation. By convention, we subtract it from 1, to obtain a pooling metric P.

p = 1 - (σ_(τ)^2 / (σ_(τ)^2 + se_k^2))

  • If p < 0.5, the variation across studies is higher than variation within studies.

  • Values close to 1 indicate nearly full pooling. Variation across studies dominates.

  • Values close to 0 indicate no pooling. Variation within studies dominates.

Note that, since σ_{τ}^2 is a Bayesian parameter (rather than a single fixed value), P is also a parameter. It is typical for P to have very high dispersion, as in many cases we cannot precisely estimate σ_{τ}. To obtain samples from the distribution of P (rather than summarised values), set summary=FALSE.

Study weights

Contributions of each group (e.g. each study) to the mean meta-analysis estimate can be calculated by calculating for each study w_k the inverse of sum of group-specific SE squared and between-study variation. To obtain weights, this vector (across all studies) has to be normalised to 1, i.e. w_k/sum(w_k) for each k.

SE is typically treated as a fixed quantity (and usually reported on the reported point estimate), but between-study variance is a model parameter, hence the weights themselves are also random variables.

Overall pooling in the model

Typically researchers want to report a single measure from the model, relating to heterogeneity across groups. This is calculated by either pooling(mymodel, type = "total") or simply heterogeneity(mymodel)

Formulae for the calculations below are provided in main package vignette and almost analogous to the group calculation above, but using mean variance across all studies. In other words, pooling P is simply ratio of the expected within-study variance term to total variance.

To obtain such single estimate we need to substitute average variability of group-specific treatment effects and then calculate the same way we would calculate p. By default we use the mean across k se_k^2 values. Typically, implementations of I^2 in statistical packages use a different calculation for this quantity, which may make I's not comparable when different studies have different SE's.

Same as for group-specific estimates, P is a Bayesian parameter and its dispersion can be high.


Matrix with mean and intervals for chosen pooling metric, each row corresponding to one meta-analysis group.


Gelman, Andrew, and Iain Pardoe. "Bayesian Measures of Explained Variance and Pooling in Multilevel (Hierarchical) Models." Technometrics 48, no. 2 (May 2006): 241-51.

Higgins, Julian P. T., and Simon G. Thompson. "Quantifying Heterogeneity in a Meta-Analysis." Statistics in Medicine, vol. 21, no. 11, June 2002, pp. 1539-58.

Hippel, Paul T von. "The Heterogeneity Statistic I2 Can Be Biased in Small Meta-Analyses." BMC Medical Research Methodology 15 (April 14, 2015).

baggr documentation built on March 18, 2022, 7:02 p.m.