plantation: Plantation (regular forest) plot

Description Usage Arguments Details Author(s) Examples

View source: R/plantation.R

Description

Provides a simple forest plot. Allows an arbitrary functional relationship between the plotting scale and the numerical values displayed, useful hazard ratios or odds ratios where plotting on a log scale is preferred.

Usage

1
2
3
4
5
plantation(ntext, beta, ci.lo, ci.hi, se, alpha = 0.05,
                       FUN = I, pvals = TRUE, meta = TRUE,
                       xzero = 0, xlim, xticks, xlab = "Effect",
                       digits = 2,
                       groups = list("Fixed effect meta-analysis" = 1:length(beta)))

Arguments

ntext

Names for each item

beta

Effect sizes on the plotting scale

ci.lo

Lower CI limits

ci.hi

Upper CI limits

se

Standard errors

alpha

Alpha level for CIs

FUN

Function to transform from plotting scale to printing scale

pvals

Whether to write P-values

meta

Calculate meta-analysis

xzero

Value of X at which to

xlim

X-axis limits on plotting scale

xticks

X-axis ticks on plotting scale

xlab

X-axis label

digits

digits

groups

List of groups for meta-analyses

Details

The user can supply either standard errors (SEs) or upper and lower limits of confidence intervals (CIs). Whichever is missing is calculated from the other, assuming the CIs are symmetric and at the level alpha.

A key concept is the separation of the printing scale (which is the scale that effect sizes are conventionally reported on), and the plotting scale (which should typically be the same as the analysis scale; the scale on which normal theory for the estimator best holds). The most common examples are the printing scale being hazard ratio (HR) or odds ratio (OR), and the plotting scale being (natural) log HR or log OR. A key feature of plantation is that it allows an arbitrary function FUN to map the plotting scale onto the printing scale.

See the examples and vignette.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
6
7
8
9
plantation(paste("Study ", 1:4, " (drug ", c("A", "A", "B", "B"), ")", sep = ""),
           c(0.41, 0.06, 0.39, 0.50),
           se = c(0.12, 0.17, 0.18, 0.25),
           FUN = exp, digits = 2,
           xlim = log(c(0.8, 2.5)), xticks = log(c(0.8, 1, 1.5, 2, 2.5)),
           xlab = "HR", 
           groups = list("Fixed effect all drug A" = 1:2,
             "Fixed effect all drug B" = 3:4,
             "Fixed effect all studies" = 1:4))

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.