#
# 1) Smoking cessation example
#
data(smokingcessation)
# Add variable with (fictitious) risk of bias values
# with 1 = "low risk" and 2 = "high risk"
#
smokingcessation$rob <- rep(1:2, 12)
pw1 <- pairwise(list(treat1, treat2, treat3),
event = list(event1, event2, event3), n = list(n1, n2, n3),
data = smokingcessation, sm = "OR")
# Run network meta-analysis (NMA)
nma1 <- netmeta(pw1, common = FALSE, ref = "A")
# Network meta-regression with continuous covariate and assumption of
# independent slopes
nr1 <- netmetareg(nma1, rob)
nr1
# \donttest{
# 2) Pain Prevention of Propofol Injection Example (Jalota2011)
#
# Create pairwise object
pw2 <- pairwise(treat = trt, event = pain, n = n,
studlab = id, data = Jalota2011, sm = "OR")
# Run network meta-analysis (NMA)
nma2 <- netmeta(pw2, common = FALSE, ref = "Hand vein")
# NMR with independent and consistent assumption (default)
nmr2_i <- netmetareg(nma2, covar = seTE, consistency = TRUE,
assumption = "i")
# NMR with common and consistent assumption
nmr2_c <- netmetareg(nma2, covar = seTE, consistency = TRUE,
assumption = "c")
# NMR with independent UMIE model (no consistency in interactions) using
# default treatment order
nmr2_i_umie <- netmetareg(nma2, covar = seTE, consistency = FALSE,
assumption = "i")
# 3) Physical therapy example (Hong 2015)
#
dat3 <- Hong2015
# Externally create a customizable treatment order indicator variable,
# which will later be modified
dat3$trtnum <- as.numeric(as.factor(dat3$trt))
dat3 <- do.call(rbind, lapply(split(dat3, dat3$id),
function(x) {
x$direction <- ifelse(x$trtnum == min(x$trtnum), 0, 1)
x}))
pw3 <- pairwise(treat = trt, mean = mean_pain, n = n, sd = sd_pain,
studlab=id, data = dat3, sm = "MD")
# Create difference variable for covariate
pw3$disability_diff <- pw3$mean_disability1 - pw3$mean_disability2
# Update directionality parameters so that they will exclude imputed values
sel.NA <- is.na(pw3$disability_diff)
pw3$direction1[sel.NA] <- 0
pw3$direction2[sel.NA] <- 0
# Mean imputations for missing covariate values
pw3$disability_diff[sel.NA] <- mean(pw3$disability_diff, na.rm = TRUE)
# NMA
nma3 <- netmeta(pw3, common = FALSE, ref = "No treatment")
# NMR with independent and consistent assumption (default)
nmr3_i <- netmetareg(nma3, covar = disability_diff, consistency = TRUE,
assumption = "i")
# NMR with common and consistent assumption
nmr3_c <- netmetareg(nma3, covar = disability_diff, consistency = TRUE,
assumption = "c")
# NMR with independent UMIE model (no consistency in interactions) using
# default treatment order variable
nmr3_i_umie <- netmetareg(nma3, covar = disability_diff, consistency = FALSE,
assumption = "i")
# NMR with independent UMIE model (no consistency in interactions) using
# custom treatment order variable which excludes the mean imputations from
# interaction estimation
nmr3_i_umie_noimp <- netmetareg(nma3, covar = disability_diff,
consistency = FALSE, assumption = "i",
direction1 = "direction1", direction2 = "direction2")
# NMR with common UMIE model (no consistency in interactions) using default
# treatment order variable
nmr3_c_umie <- netmetareg(nma3, covar = disability_diff, consistency = FALSE,
assumption = "c")
# NMR with common UMIE model (no consistency in interactions) using custom
# treatment order variable which excludes the mean imputations from
# interaction estimation
nmr3_c_umie_noimp <- netmetareg(nma3, covar = disability_diff,
consistency = FALSE, assumption = "c",
direction1 = "direction1", direction2 = "direction2")
# }
Run the code above in your browser using DataLab