Learn R Programming

pcnetmeta (version 2.1)

forest.plot: Forest Plot of Relative Effect Sizes

Description

forest.plot generates forest plot, which shows 95% credible intervals (CIs) for relative effect sizes.

Usage

forest.plot(nma.obj, effect.size, reference, left.margin = 0.5, width = 10, height)

Arguments

nma.obj
a list object obtained by function nma.ab, nma.ab.cont, nma.ab.py, or
effect.size
a character string indicating the relative effect size to be shown in the forest plot. If nma.obj is obtained from nma.ab, this argument can be "OR" (default), "LOR", <
reference
a character string indicating the reference treatment name to be compared against.
left.margin
a positive number to adjust the left margin of the plot. A higher value leads to a wider left margin. The default is 0.5.
width
a positive number indicating the plot width. The default is 10.
height
a positive number indicating the plot height. The default is the treatment number minus 1.

Value

  • A forest plot for relative effect sizes is saved as a .pdf file in users' current working directory.

Examples

Run this code
data(smoke)
# increase n.iter to reach convergence
nma.out <- nma.ab(s.id, t.id, r, n, data = smoke,
  trtname = c("NC", "SH", "IC", "GC"), param= "LOR",
  model = "het_cor", n.adapt = 1000, n.iter = 100)
forest.plot(nma.out)
# use getwd() to find the path of generated forest plot

Run the code above in your browser using DataLab