plotMetaAnalysisForest: Perform a meta-analysis and create a forest plot

Description Usage Arguments Details Value References Examples

View source: R/MetaAnalysis.R

Description

plotMetaAnalysisForest performs a meta-analysis and creates a forest plot of effect size estimates.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plotMetaAnalysisForest(
  logRr,
  logLb95Ci,
  logUb95Ci,
  labels,
  xLabel = "Relative risk",
  limits = c(0.1, 10),
  hakn = FALSE,
  fileName = NULL
)

Arguments

logRr

A numeric vector of effect estimates on the log scale.

logLb95Ci

The lower bound of the 95 percent confidence interval on the log scale.

logUb95Ci

The upper bound of the 95 percent confidence interval on the log scale.

labels

A vector containing the labels for the various estimates.

xLabel

The label on the x-axis: the name of the effect estimate.

limits

The limits of the effect size axis.

hakn

A logical indicating whether method by Hartung and Knapp should be used to adjust test statistics and confidence intervals.

fileName

Name of the file where the plot should be saved, for example 'plot.png'. See the function ggsave in the ggplot2 package for supported file formats.

Details

Creates a forest plot of effect size estimates, and includes a meta-analysis estimate using a random effects model. The DerSimonian-Laird estimate (1986) is used.

Value

A Ggplot object. Use the ggsave function to save to file.

References

DerSimonian R, Laird N (1986), Meta-analysis in clinical trials. Controlled Clinical Trials, 7, 177-188.

Examples

1
2
3
4
plotMetaAnalysisForest(logRr = c(0, 0.2, -0.2, 0, 0.2, -0.2),
                       logLb95Ci = c(-0.2, -0.2, -0.6, -0.2, -0.2, -0.6),
                       logUb95Ci = c(0.2, 0.6, 0.2, 0.2, 0.6, 0.2),
                       labels = c("Site A", "Site B", "Site C", "Site D", "Site E", "Site F"))

OHDSI/EvidenceSynthesis documentation built on July 24, 2020, 10:45 a.m.