funnel_plot: Funnel plot from frequentist net-meta

Description Usage Arguments Value Examples

View source: R/funnel_plot.R

Description

To plot the funnel plot from frequentist net-meta

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
funnel_plot(
  nmt,
  font.size,
  text.size,
  text.x.position,
  cap,
  x1,
  x2,
  font.family = "Helvetica"
)

Arguments

nmt

results from model_netmeta function

font.size

font size

text.size

text size

text.x.position

text position

cap

caption

x1

left xlim

x2

right xlim

font.family

"Helvetica" or "Times New Roman"

Value

plot and ggplot objects

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
LDT1 <- read.csv(system.file("extdata", "HR_SH_D.csv", package = "net.meta"))
trt1 <- read.table(system.file("extdata", "HR_SH_D.txt", package = "net.meta"),
    header=TRUE,quote = '"', stringsAsFactors=FALSE)

trt1$description <- factor(trt1$description, trt1$description)
LDT1$study <- factor(LDT1$study, unique(LDT1$study))

trt1$label <- paste0(trt1$id,"-", trt1$description)
LDT1$label <- factor(LDT1$treatment, labels = trt1$label)

trt1$label <- paste0(trt1$id,"-", trt1$description)
LDT1$label <- factor(LDT1$treatment, labels = trt1$label)

nmt.lab1 <- model_netmeta(
  long.data=LDT1[,-2],
  treatment=LDT1$label,
  id.treatments=trt1,
  reference = trt1$label[1],
  outcome="HR")

funnel_plot(
  nmt.lab1,
  font.size=10,
  text.size=4,
  text.x.position=0,
  x1=-1,
  x2=3,
  cap="HR"
  )

meta2020/net.meta documentation built on March 30, 2021, 7:31 p.m.