Learn R Programming

bayesmeta (version 3.0)

traceplot: 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 (\(\tau\)). The heterogeneity's posterior distribution is also indicated.

Usage

traceplot(x, ...)
  # S3 method for bayesmeta
traceplot(x, mulim, taulim, ci=FALSE,
          rightmargin=8, col=rainbow(x$k), ...)
  # S3 method for bmr
traceplot(x, mulim, taulim, ci=FALSE,
          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.

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 (\(\tau\)) value, the conditional posterior distributions of the overall effect (\(\mu\)) 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 (\(\mu_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).

References

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

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

See Also

bayesmeta, bmr.

Examples

Run this code
# load example data:
data("Rubin1981")

if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab