Learn R Programming

rmeta (version 3.0)

forestplot: Forest plots

Description

Draw a forest plot together with a table of text.

Usage

forestplot(labeltext, mean, lower, upper, align = NULL,
 is.summary = FALSE, clip = c(-Inf, Inf), xlab = "", 
 zero = 0, graphwidth = unit(2, "inches"), col = meta.colors(),
  xlog = FALSE, xticks=NULL, boxsize=NULL,...)

Arguments

labeltext

Matrix of strings or NAs for blank spaces

mean

Vector of centers of confidence intervals (or NAs for blank space)

lower

Vector of lower ends of confidence intervals

upper

Vector of upper ends of confidence intervals

align

Vector giving alignment (l,r,c) for columns of table

is.summary

Vector of logicals. Summary lines have bold text and diamond confidence intervals.

clip

Lower and upper limits for clipping confidence intervals to arrows

xlab

x-axis label

zero

x-axis coordinate for zero line

graphwidth

Width of confidence interval graph

xlog

If TRUE, x-axis tick marks are exponentiated

xticks

Optional user-specified x-axis tick marks. Specify NULL to use the defaults, numeric(0) to omit the x-axis.

boxsize

Override the default box size based on precision

Not used.

Value

None

Details

This function is more flexible than metaplot and the plot methods for meta-analysis objects, but requires more work by the user.

In particular, it allows for a table of text, and clips confidence intervals to arrows when they exceed specified limits.

See Also

metaplot

Examples

Run this code
# NOT RUN {
data(cochrane)
steroid <- meta.MH(n.trt, n.ctrl, ev.trt, ev.ctrl,
                        names=name, data=cochrane)

tabletext<-cbind(c("","Study",steroid$names,NA,"Summary"),
          c("Deaths","(steroid)",cochrane$ev.trt,NA,NA),
          c("Deaths","(placebo)", cochrane$ev.ctrl, NA,NA),
          c("","OR",format(exp(steroid$logOR),digits=2),NA,format(exp(steroid$logMH),digits=2))
          )

m<- c(NA,NA,steroid$logOR,NA,steroid$logMH)
l<- m-c(NA,NA,steroid$selogOR,NA,steroid$selogMH)*2
u<- m+c(NA,NA,steroid$selogOR,NA,steroid$selogMH)*2
forestplot(tabletext,m,l,u,zero=0,
   is.summary=c(TRUE,TRUE,rep(FALSE,8),TRUE),
   clip=c(log(0.1),log(2.5)), xlog=TRUE,
   col=meta.colors(box="royalblue",
       line="darkblue", summary="royalblue"))

forestplot(tabletext,m,l,u,zero=0,
    is.summary=c(TRUE,TRUE,rep(FALSE,8),TRUE),
   clip=c(log(0.1),log(2.5)), xlog=TRUE, boxsize=0.75,
   col=meta.colors(box="royalblue",line="darkblue",
    summary="royalblue"))

# }

Run the code above in your browser using DataLab