traceplot {bayesmeta}R Documentation

Illustrate conditional means of overall effect as well as study-specific estimates as a function of heterogeneity.

Description

Generates a trace plot of overall mean effect and study-specific (shrinkage) estimates as a function of the heterogeneity (τ). The heterogeneity's posterior distribution is also indicated.

Usage

  traceplot(x, ...)
  ## S3 method for class 'bayesmeta'
traceplot(x, mulim, taulim, ci=FALSE,
          ylab="effect",
          rightmargin=8, col=rainbow(x$k), ...)
  ## S3 method for class 'bmr'
traceplot(x, mulim, taulim, ci=FALSE,
          ylab="effect",
          rightmargin=8, col=rainbow(x$k), ...)

Arguments

x

a bayesmeta or bmrobject.

mulim, taulim

(optional) ranges for the effect (mu) and heterogeneity (tau) axes. If only one value is given for taulim, then this is taken as the upper limit, and the lower limit is zero.

ci

a logical flag indicating whether to also show (conditional) confidence intervals.

ylab

a y-axis label.

rightmargin

an additional margin to be added to the right side of the plot, in order to accomodate the estimates' labels. In case study labels still extend beyond the figure margin, try increasing this number.

col

colors to be used for plotting the (k) estimates.

...

other arguments passed on to the plot() function.

Details

For a given heterogeneity (τ) value, the conditional posterior distributions of the overall effect (μ) as well as the study-specific parameters (theta[i]) are again normal. The conditional normal moments (mean and variance) then vary as functions of the heterogeneity; for large heterogeneity, the shrinkage estimates approach the original data (y[i]), while the overall mean approaches an un-weighted overall average. For small heterogeneity, both overall mean as well as study-specific estimates are increasingly shrunk towards the inverse-variance-weighted ‘common-effect’ estimate (Roever, 2020).

This trace plot illustrates the conditional (overall and study-specific) estimates along with the heterogeneity's posterior distribution (density) in a layout similar to that utilized by Rubin (1981).

Author(s)

Christian Roever christian.roever@med.uni-goettingen.de

References

C. Roever. Bayesian random-effects meta-analysis using the bayesmeta R package. Journal of Statistical Software, 93(6):1-51, 2020. doi: 10.18637/jss.v093.i06.

C. Roever, T. Friede. Using the bayesmeta R package for Bayesian random-effects meta-regression. arXiv preprint 2209.06004, 2022.

D.B. Rubin. Estimation in parallel randomized experiments. Journal of Educational Statistics, 6(4):377-401, 1981. doi: 10.3102/10769986006004377.

See Also

bayesmeta, bmr.

Examples

# load example data:
data("Rubin1981")

## Not run: 
# perform meta-analysis:
ma01 <- bayesmeta(y=Rubin1981[,"effect"], sigma=Rubin1981[,"stderr"],
                  labels=Rubin1981[,"school"], tau.prior="uniform")

# show meta-analysis results:
forestplot(ma01)

# show trace plot:
traceplot(ma01)

## End(Not run)

[Package bayesmeta version 3.2 Index]