model_gemtc: Bayesian net-meta model for MD, HR, and RR This function is...

Description Usage Arguments Value Examples

View source: R/model_gemtc.R

Description

Bayesian net-meta model for MD, HR, and RR This function is the warpper of mtc.network, mtc.model, mtc.run, and relative.effect from gemtc package. R packgae gemtc and rjags are required.

Usage

1
2
3
4
5
6
7
8
9
model_gemtc(
  long.data,
  id.treatments,
  reference,
  outcome = c("MD", "HR", "RR"),
  mtc.n.adapt,
  mtc.n.iter,
  mtc.thin
)

Arguments

long.data

data.frame to be analyzed should be formatted in long format

id.treatments

data.frame to specify the id and treatments

reference

the referential id in the net-meta

outcome

the outcome should be MD-mean difference, HR-hazard ratio, and RR-risk ratio

mtc.n.adapt

the number of adaptation (or tuning, burn-in) iterations, default is 5000, which means to discard 1-5000 of the iterations.

mtc.n.iter

the number of simulation iteration, default is 10000, which means to perform 10000 simulations

mtc.thin

default is 20, which means to extract 20th value; details in mtc.run from gemtc package

Value

Summary list of the results

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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))

set.seed(1)
bmt1 <- model_gemtc(
long.data=LDT1,
id.treatments=trt1,
reference="A",
outcome="HR",
mtc.n.adapt = 500, mtc.n.iter = 1000, mtc.thin = 20)

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