Description Usage Arguments Author(s) Examples
A function to call package forestplot
from R library and produce forest plot using
results from bmeta
. The posterior estimate and credible interval for each study are
given by a square and a horizontal line, respectively. The summary estimate is drawn
as a diamond.
1 2 3 |
x |
a |
title |
title of the plot |
xlab |
title of the x-axis label |
log |
estimates on natural scale is displayed by default. If TRUE, log scale is used (i.e. log odds ratio, log incidence rate ratio). For continuous data, estimates are always presented on natural scale and users do not need to specify this argument. |
study.label |
label for each study and the summary estimate. See details. |
clip |
lower and upper limits for clipping credible intervals to arrows |
lines |
selects the colour for the lines of the intervals. If the extra option |
box |
selects the colour for mean study-specific estimates. If the extra option |
summary |
selects the colour for the pooled estimate |
box.symb |
selects the symbol used to plot the mean. Options are "box" (default) or "circle" |
label.cex |
defines the size of the text for the label. Defaults at .8 of normal size |
xlab.cex |
defines the size of the text for the x-label. Defaults at 1 of the normal size |
ticks.cex |
defines the size of the text for the x-axis ticks. Defaults at .8 of the normal size |
... |
Additional arguments. Includes - |
Tao Ding Gianluca Baio
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 | ### Read and format the data (binary)
data = read.csv(url("http://www.statistica.it/gianluca/bmeta/Data-bin.csv"))
### List data for binary outcome
data.list <- list(y0=data$y0,y1=data$y1,n0=data$n0,n1=data$n1)
### Select fixed-effects meta-analysis with normal prior for binary data
x <- bmeta(data.list, outcome="bin", model="std.norm", type="fix")
### Plot forest plot
forest.plot(x)
### Plot forest plot on log scale
forest.plot(x,log=TRUE)
### Select random-effects meta-analysis with t-distribution prior for binary
### data
x <- bmeta(data.list, outcome="bin", model="std.dt", type="ran")
### Plot 'two-line' forest plot showing estimates from both randome-effects
### model and no-pooling effects model for comparison
forest.plot(x,add.null=TRUE,title="Two-line forestplot for comparison")
### Read and format the data (continuous)
data = read.csv(url("http://www.statistica.it/gianluca/bmeta/Data-ctns.csv"))
### List data for continuous outcome
data.list <- list(y0=data$y0,y1=data$y1,se0=data$se0,se1=data$se1)
### Select fix-effects meta-analysis for studies reporting two arms separately
x <- bmeta(data=data.list,outcome="ctns",model="std.ta",type="fix")
### Define for individual studies
study.label <- c(paste0(data$study,", ",data$year),"Summary estimate")
### Produce forest plot with label for each study and control the lower and upper
### limits for clipping credible intervals to arrows
forest.plot(x,study.label=study.label,clip=c(-7,4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.