Learn R Programming

bayesmeta (version 2.6)

forest.bayesmeta: Generate a forest plot for a bayesmeta object (based on the metafor package's plotting functions).

Description

Generates a forest plot, showing individual estimates along with their 95 percent confidence intervals, resulting effect estimate and prediction interval.

Usage

# S3 method for bayesmeta
forest(x, xlab="effect size", refline=0, cex=1,...)

Arguments

x

a bayesmeta object.

xlab

title for the x-axis.

refline

value at which a vertical ‘reference’ line should be drawn (default is 0). The line can be suppressed by setting this argument to ‘NA’.

cex

character and symbol expansion factor.

other arguments.

Details

Generates a simple forest plot illustrating the underlying data and resulting estimates (effect estimate and prediction interval).

References

C. Lewis and M. Clarke. Forest plots: trying to see the wood and the trees. BMJ, 322:1479, 2001.

R.D. Riley, J.P. Higgins and J.J. Deeks. Interpretation of random effects meta-analyses. BMJ, 342:d549, 2011.

See Also

bayesmeta, forest.default, addpoly, forestplot.bayesmeta

Examples

Run this code
# NOT RUN {
data("CrinsEtAl2014")

# }
# NOT RUN {
# compute effect sizes (log odds ratios) from count data
# (using "metafor" package's "escalc()" function):
require("metafor")
es.crins <- escalc(measure="OR",
                   ai=exp.AR.events,  n1i=exp.total,
                   ci=cont.AR.events, n2i=cont.total,
                   slab=publication, data=CrinsEtAl2014)
# derive a prior distribution for the heterogeneity:
tp.crins <- TurnerEtAlPrior("surgical", "pharma", "placebo / control")
# perform meta-analysis:
ma.crins <- bayesmeta(es.crins, tau.prior=tp.crins$dprior)

########
# plot:
forest(ma.crins, xlab="log odds ratio")

forest(ma.crins, trans=exp, refline=1, xlab="odds ratio")
# }

Run the code above in your browser using DataLab