forestplot.bayesmeta: Generate a forest plot for a 'bayesmeta' object (based on the...

Description Usage Arguments Details Note Author(s) References See Also Examples

View source: R/bayesmeta.R

Description

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

Usage

1
2
3
4
  ## S3 method for class 'bayesmeta'
forestplot(x, labeltext, exponentiate=FALSE,
           prediction=TRUE, shrinkage=TRUE, digits=2, plot=TRUE,
           fn.ci_norm, fn.ci_sum, col, legend, boxsize, ...)

Arguments

x

a bayesmeta object.

labeltext

an (alternative) “labeltext” argument which is then handed on to the forestplot() function (see the help there). You can use this to change contents or add columns to the displayed table; see the example below.

exponentiate

a logical flag indicating whether to exponentiate numbers (effect sizes) in table and plot.

prediction

a logical flag indicating whether to show the prediction interval below the mean estimate.

shrinkage

a logical flag indicating whether to show shrinkage intervals along with the quoted estimates.

digits

The number of significant digits to be shown. This is interpreted relative to the standard errors of all estimates.

plot

a logical flag indicating whether to actually generate a plot.

fn.ci_norm, fn.ci_sum, col, legend, boxsize, ...

other arguments passed on to the forestplot package's forestplot function (see also the help there).

Details

Generates a forest plot illustrating the underlying data and resulting estimates (effect estimate and prediction interval, as well as shrinkage estimates and intervals).

Note

This function is based on the forestplot package's “forestplot()” function.

Author(s)

Christian Roever [email protected]

References

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

C. Guddat, U. Grouven, R. Bender and G. Skipka. A note on the graphical presentation of prediction intervals in random-effects meta-analyses. Systematic Reviews, 1(34), 2012.

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

See Also

bayesmeta, forestplot, forest.bayesmeta, plot.bayesmeta.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# load data:
data("CrinsEtAl2014")

## Not run: 
# compute effect sizes (log odds ratios) from count data
# (requires "metafor" package to be installed):
require("metafor")
if (require("metafor")) {
  crins.es <- escalc(measure="OR",
                     ai=exp.AR.events,  n1i=exp.total,
                     ci=cont.AR.events, n2i=cont.total,
                     slab=publication, data=CrinsEtAl2014)
} else print("Sorry, 'metafor' package not installed!")
print(crins.es)

# perform meta analysis:
crins.ma <- bayesmeta(crins.es, tau.prior=function(t){dhalfcauchy(t,scale=1)})

########################
# generate forest plots
require("forestplot")

# default options:
forestplot(crins.ma)

# exponentiate values (shown in table and plot), show vertical line at OR=1:
forestplot(crins.ma, expo=TRUE, zero=1)

# logarithmic x-axis:
forestplot(crins.ma, expo=TRUE, xlog=TRUE)

# omit prediction interval:
forestplot(crins.ma, predict=FALSE)

# omit shrinkage intervals:
forestplot(crins.ma, shrink=FALSE)

# show more decimal places:
forestplot(crins.ma, digits=3)

# change table values:
# (here: add columns for event counts)
fp <- forestplot(crins.ma, expo=TRUE, plot=FALSE)
labtext <- fp$labeltext
labtext <- cbind(labtext[,1],
                 c("treatment",
                   paste0(CrinsEtAl2014[,"exp.AR.events"], "/", CrinsEtAl2014[,"exp.total"]),
                   "",""),
                 c("control",
                   paste0(CrinsEtAl2014[,"cont.AR.events"], "/", CrinsEtAl2014[,"cont.total"]),
                   "",""),
                 labtext[,2:3])
labtext[1,4] <- "OR"
print(fp$labeltext) # before
print(labtext)      # after
forestplot(crins.ma, labeltext=labtext, expo=TRUE, xlog=TRUE)

# see also the "forestplot" help for more arguments that you may change,
# e.g. the "clip", "xticks", "xlab" and "title" arguments,
# or the "txt_gp" argument for label sizes etc.:
forestplot(crins.ma, clip=c(-4,1), xticks=(-3):0,
           xlab="log-OR", title="pediatric transplantation example",
           txt_gp = fpTxtGp(ticks = gpar(cex=1), xlab = gpar(cex=1)))

## End(Not run)

Example output

Loading required package: forestplot
Loading required package: grid
Loading required package: magrittr
Loading required package: checkmate
Loading required package: metafor
Loading required package: Matrix
Loading 'metafor' package (version 1.9-9). For an overview 
and introduction to the package please type: help(metafor).
      publication year randomized control.type      comparison       IL2RA
1  Heffron (2003) 2003        yes   concurrent     delayed CNI  daclizumab
2  Gibelli (2004) 2004         no   historical     IL-2RA only basiliximab
3 Schuller (2005) 2005         no   concurrent     IL-2RA only  daclizumab
4 Ganschow (2005) 2005         no   historical     IL-2RA only basiliximab
5    Spada (2006) 2006        yes   concurrent no/low steroids basiliximab
6     Gras (2008) 2008         no   historical no/low steroids basiliximab
             CNI MMF followup exp.AR.events exp.SRR.events exp.total
1     tacrolimus yes       24            14              2        61
2 cyclosporine A  no        6            16             NA        28
3     tacrolimus yes        6             3             NA        18
4 cyclosporine A  no       36             9              4        54
5     tacrolimus  no       12             4             NA        36
6     tacrolimus  no       36             0              1        50
  cont.AR.events cont.SRR.events cont.total      yi     vi
1             15               4         20 -2.3097 0.3594
2             19              NA         28 -0.4595 0.3096
3              8              NA         12 -2.3026 0.7750
4             29               6         54 -1.7579 0.2078
5             11              NA         36 -1.2585 0.4122
6              3               4         34 -2.4179 2.3373
      [,1]              [,2]       [,3]            
 [1,] "study"           "estimate" "95% CI"        
 [2,] "Heffron (2003)"  "0.099"    "[0.031, 0.322]"
 [3,] "Gibelli (2004)"  "0.632"    "[0.212, 1.879]"
 [4,] "Schuller (2005)" "0.100"    "[0.018, 0.561]"
 [5,] "Ganschow (2005)" "0.172"    "[0.071, 0.421]"
 [6,] "Spada (2006)"    "0.284"    "[0.081, 1.000]"
 [7,] "Gras (2008)"     "0.089"    "[0.004, 1.783]"
 [8,] "mean"            "0.203"    "[0.091, 0.439]"
 [9,] "prediction"      "0.205"    "[0.038, 1.017]"
      [,1]              [,2]        [,3]      [,4]    [,5]            
 [1,] "study"           "treatment" "control" "OR"    "95% CI"        
 [2,] "Heffron (2003)"  "14/61"     "15/20"   "0.099" "[0.031, 0.322]"
 [3,] "Gibelli (2004)"  "16/28"     "19/28"   "0.632" "[0.212, 1.879]"
 [4,] "Schuller (2005)" "3/18"      "8/12"    "0.100" "[0.018, 0.561]"
 [5,] "Ganschow (2005)" "9/54"      "29/54"   "0.172" "[0.071, 0.421]"
 [6,] "Spada (2006)"    "4/36"      "11/36"   "0.284" "[0.081, 1.000]"
 [7,] "Gras (2008)"     "0/50"      "3/34"    "0.089" "[0.004, 1.783]"
 [8,] "mean"            ""          ""        "0.203" "[0.091, 0.439]"
 [9,] "prediction"      ""          ""        "0.205" "[0.038, 1.017]"

bayesmeta documentation built on Sept. 8, 2017, 5:04 p.m.