# \donttest{
# Create an mb.network object from a dataset
alognet <- mb.network(alog_pcfb)
# Run a quadratic time-course MBNMA using the alogliptin dataset
mbnma <- mb.run(alognet,
fun=tpoly(degree=2,
pool.1="rel", method.1="random",
pool.2="rel", method.2="common"
)
)
# Calculate differences between all treatments at 20 weeks follow-up
allres <- get.relative(mbnma, time=20)
# Calculate difference between a subset of treatments at 10 weeks follow-up
subres <- get.relative(mbnma, time=10,
treats=c("alog_50", "alog_25", "placebo"))
###########################
##### 2-stage MBNMA #####
###########################
# Using the osteoarthritis dataset
# With placebo (Pl_0) as common comparator between subnetworks
#### Sparse model ####
# Treatments on which time-course data is limited
sparse.trt <- c("Ce_100", "Ce_400", "Du_90", "Lu_200", "Lu_400",
"Lu_NA", "Et_5", "Ox_44")
# Create a subnetwork of studies comparing these treatments
sparse.df <- osteopain %>% dplyr::group_by(studyID) %>%
dplyr::filter(any(treatment %in% sparse.trt)) %>%
dplyr::ungroup() %>%
subset(treatment %in% c("Pl_0", sparse.trt))
sparse.net <- mb.network(sparse.df)
# Run a ITP MBNMA with a known rate
sparse.mbnma <- mb.run(sparse.net, fun=titp(method.rate=0.8, pool.rate="abs"))
#### Complex model ####
# Treatments on which time-course data is rich
rich.trt <- levels(osteopain$treatment)[!levels(osteopain$treatment) %in%
c("Pl_0", "Ce_100", "Ce_400", "Du_90", "Lu_200",
"Lu_400", "Lu_NA", "Et_5", "Ox_44")]
# Create a subnetwork of studies comparing these treatments
rich.df <- osteopain %>% dplyr::group_by(studyID) %>%
dplyr::filter(any(treatment %in% rich.trt)) %>%
dplyr::ungroup() %>%
subset(treatment %in% c("Pl_0", rich.trt))
rich.net <- mb.network(rich.df)
# Run a Emax MBNMA
rich.mbnma <- mb.run(rich.net, temax(p.expon = FALSE))
#### Calculate relative effects between models ####
# At 10 weeks follow-up
rels.sparse <- get.relative(sparse.mbnma, time=10)
rels.rich <- get.relative(rich.mbnma, time=10)
rels.all <- get.relative(mbnma=rich.mbnma,
mbnma.add=sparse.mbnma, time=10)
print(rels.all$median)
# }
Run the code above in your browser using DataLab