blobbogram: Plot a blobbogram (AKA forest plot)

View source: R/blobbogram.R

blobbogramR Documentation

Plot a blobbogram (AKA forest plot)

Description

blobbogram is a flexible function for creating blobbograms (forest plots), making no specific assumptions about the data being plotted. It supports column and row grouping as well as pagination.

Usage

blobbogram(data, id.label="Study", ci.label="Mean (95% CI)",
    left.label=NULL, right.label=NULL, center.label=NULL,
    log.scale=FALSE, xlim=NULL, styles=NULL,
    grouped=TRUE, group.labels=NULL,
    columns=NULL, column.labels=NULL,
    column.groups=NULL, column.group.labels=NULL,
    digits=2,
    ask=dev.interactive(orNone=TRUE),
    draw.no.effect=TRUE)

forest(x, ...)

Arguments

data

A data frame containing one row for each confidence interval to be visualized. The data format is described below.

id.label

Label to show above the row-id column.

ci.label

Label to show above the confidence intervals.

left.label

Label to show on the left-hand side of the no-difference line.

right.label

Label to show on the right-hand side of the no-difference line.

center.label

Label to show center-aligned with the no-difference line.

log.scale

If TRUE, the confidence intervals are given on a log scale, and axis labels will be exp() transformed.

xlim

The scale limits of the plot, if the confidence interval exceeds these limits an arrow will be shown at the limit. If unspecified, limits will be chosen that encompass all confidence intervals.

styles

A data frame describing the different row styles. By default, the styles "normal", "pooled" and "group" are defined.

grouped

If TRUE, and group.labels are specified, rows will be grouped according to the "group" column given in the data argument.

group.labels

Vector of group labels.

columns

Additional user-defined columns to be shown (names of columns given in the data argument).

column.labels

A vector of labels for the user-defined columns.

column.groups

Column groups, a numeric vector specifying the column group for each column.

column.group.labels

A vector of labels for the column groups.

digits

The number of (significant) digits to print.

ask

If TRUE, a prompt will be displayed before generating the next page of a multi-page plot.

draw.no.effect

If TRUE, draw the no-effect line.

x

An object to create a forest plot of.

...

Additional arguments.

Details

The forest function is a generic S3 method (definition compatible with the meta package). This package defines methods for mtc.result and mtc.relative.effect.table.

The blobbogram function creates a blobbogram (forest plot) from the given data (point estimates and confidence intervals) and meta-data (labels, column specifications, column groups, row groups, styles) using the grid package. If the plot would not fit the device's graphics region, the content is broken up into multiple plots generated in sequence (pagination).

The data argument is given as a data frame containing the following columns:

  • id: identifier (label) for this row.

  • group (optional): row group this row belongs to (indexes into the group.labels argument).

  • pe: point estimate.

  • ci.l: lower confidence interval limit.

  • ci.u: upper confidence interval limit.

  • style: the style to apply to this row (defined in the styles argument).

Additional user-defined columns can be specified using the columns and column.labels arguments.

The styles argument is given as a data frame containing the following columns:

  • style: name of the style.

  • weight: font weight.

  • pe.style: symbol to draw for the point estimate ("circle" or "square", currently).

Value

None.

Note

This method should not be considered stable. We intend to generalize it further and possibly provide it in a separate package. The interface may change at any time.

Author(s)

Gert van Valkenhoef, Joël Kuiper

See Also

meta::forest, grid::Grid

Examples

data <- read.table(textConnection('
id               group pe       ci.l ci.u style      value.A    value.B 
"Study 1"  1         0.35 0.08 0.92 "normal" "2/46"     "7/46" 
"Study 2"  1         0.43 0.15 1.14 "normal" "4/50"     "8/49" 
"Study 3"  2         0.31 0.07 0.74 "normal" "2/97"     "10/100"
"Study 4"  2         0.86 0.34 2.90 "normal" "9/104"    "6/105" 
"Study 5"  2         0.33 0.10 0.72 "normal" "4/74"     "14/74" 
"Study 6"  2         0.47 0.23 0.91 "normal" "11/120" "22/129"
"Pooled"     NA      0.42 0.15 1.04 "pooled" NA             NA 
'), header=TRUE)
data$pe <- log(data$pe)
data$ci.l <- log(data$ci.l)
data$ci.u <- log(data$ci.u)

blobbogram(data, group.labels=c('GROUP 1', 'GROUP 2'),
    columns=c('value.A', 'value.B'), column.labels=c('r/n', 'r/n'),
    column.groups=c(1, 2), grouped=TRUE,
    column.group.labels=c('Intervention', 'Control'),
    id.label="Trial", ci.label="Odds Ratio (95% CrI)", log.scale=TRUE)

gemtc documentation built on July 9, 2023, 5:33 p.m.