### Show first 6 rows of the dataset
head(dat.baker2009)
if (FALSE) {
### Load netmeta package
suppressPackageStartupMessages(library("netmeta"))
### Print odds ratios and confidence limits with two digits
oldset <- settings.meta(digits = 2)
### Transform data from long arm-based format to contrast-based
### format. Argument 'sm' has to be used for odds ratio as summary
### measure; by default the risk ratio is used in the metabin function
### called internally.
pw <- pairwise(treatment, exac, total, studlab = paste(study, year),
data = dat.baker2009, sm = "OR")
### Conduct random effects network meta-analysis (NMA)
### with placebo as reference
net <- netmeta(pw, fixed = FALSE, ref = "plac")
### Show network graph
netgraph(net, seq = "optimal", start = "prcomp",
labels = gsub("+", " +\n", trts, fixed = TRUE),
plastic = TRUE, thickness = "se.fixed", number = TRUE,
points = TRUE, cex.points = 5, col.points = "red",
offset = 0.025)
### Print and plot results for network meta-analysis
net
forest(net)
### Conduct component network meta-analysis (CNMA)
cnet <- netcomb(net)
cnet
### Compare results of NMA and additive CNMA
nb <- netbind(net, cnet, name = c("Standard NMA", "Additive CNMA"))
forest(nb)
### Use previous settings
settings.meta(oldset)
}
Run the code above in your browser using DataLab