\title{studies on the effectiveness of nicotine replacement therapy for smoking cessation}
\description{results from 133 studies examining the effectiveness of nicotine replacement therapy (nrt) for smoking cessation at 6+ months of follow-up.}
\bold{study}     \tab \code{numeric}   \tab study identifier \cr
\bold{x.nrt}     \tab \code{numeric}   \tab number of participants in the nrt group who were abstinent at the follow-up \cr
\bold{n.nrt}     \tab \code{numeric}   \tab number of participants in the nrt group \cr
\bold{x.ctrl}    \tab \code{numeric}   \tab number of participants in the control group who were abstinent at the follow-up \cr
\bold{n.ctrl}    \tab \code{numeric}   \tab number of participants in the control group \cr
\bold{treatment} \tab \code{character} \tab type of nrt provided in the treatment group
the dataset includes the results from 133 studies examining the effectiveness of nicotine replacement therapy (nrt) for smoking cessation. the results given in this dataset pertain to abstinence at 6+ months of follow-up. nrt was provided to participants in the treatment groups in various forms as indicated by the \code{treatment} variable (e.g., gum, patch, inhalator). note that the dataset includes 136 rows, since a few studies included multiple treatments.
hartmann‐boyce, j., chepkin, s. c., ye, w., bullen, c. & lancaster, t. (2018). nicotine replacement therapy versus control for smoking cessation. \emph{cochrane database of systematic reviews}, \bold{5}, cd000146. \verb{https://doi.org//10.1002/14651858.cd000146.pub5}
### turn treatment into a factor with the desired ordering
### meta-analysis per treatment using the m-h method
medicine, smoking, risk ratios, mantel-haenszel method

\title{studies on the effectiveness of counseling for smoking cessation}
\description{results from 24 studies on the effectiveness of various counseling types for smoking cessation.}
\bold{id}         \tab \code{numeric}    \tab id number for each treatment arm \cr
\bold{study}      \tab \code{numeric}    \tab study id number \cr
\bold{authors}    \tab \code{character}  \tab study author(s) \cr
\bold{trt}        \tab \code{character}  \tab intervention group \cr
\bold{xi}         \tab \code{numeric}    \tab number of individuals abstinent \cr
\bold{ni}         \tab \code{numeric}    \tab number of individuals in group
the dataset includes the results from 24 studies on the effectiveness of various counseling types for smoking cessation (i.e., self-help, individual counseling, group counseling, and no contact). the dataset indicates the total number of individuals within each study arm and the number that were abstinent from 6 to 12 months. the majority of the studies compared two interventions types against each other, while 2 studies compared three types against each other simultaneously.
the data can be used for a \squote{network meta-analysis} (also called a \squote{mixed treatment comparison}). the code below shows how such an analysis can be conducted using an arm-based and a contrast-based model (see salanti et al., 2008, for more details).
hasselblad, v. (1998). meta-analysis of multitreatment studies. \emph{medical decision making}, \bold{18}(1), 37--43. \verb{https://doi.org/10.1177/0272989x9801800110}
gleser, l. j., & olkin, i. (2009). stochastically dependent effect sizes. in h. cooper, l. v. hedges, & j. c. valentine (eds.), \emph{the handbook of research synthesis and meta-analysis} (2nd ed., pp. 357--376). new york: russell sage foundation.
law, m., jackson, d., turner, r., rhodes, k., & viechtbauer, w. (2016). two new methods to fit models for network meta-analysis with random inconsistency effects. \emph{bmc medical research methodology}, \bold{16}, 87. \verb{https://doi.org/10.1186/s12874-016-0184-5}
salanti, g., higgins, j. p. t., ades, a. e., & ioannidis, j. p. a. (2008). evaluation of networks of randomized trials. \emph{statistical methods in medical research}, \bold{17}(3), 279--301. \verb{https://doi.org/10.1177/0962280207080643}
### create network graph ('igraph' package must be installed)
sapply(split(dat$trt, dat$study), function(x) t(combn(x,2)))), stringsasfactors=false)
lvls <- c("no_contact", "self_help", "ind_counseling", "grp_counseling")
g <- graph_from_adjacency_matrix(tab, mode = "plus", weighted=true, diag=false)
vertex_attr(g, "name") <- c("no contact", "self-help",
### calculate log odds for each study arm
dat <- escalc(measure="plo", xi=xi, ni=ni, add=1/2, to="all", data=dat)
### convert trt variable to factor with desired ordering of levels
dat$trt <- factor(dat$trt, levels=c("no_contact", "self_help", "ind_counseling", "grp_counseling"))
### add a space before each level (this makes the output a bit more legible)
levels(dat$trt) <- paste0(" ", levels(dat$trt))
### network meta-analysis using an arm-based model with fixed study effects
### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons
res <- rma.mv(yi, vi, mods = ~ 0 + factor(study) + trt,
random = ~ trt | study, rho=1/2, data=dat, btt="trt")
### all pairwise odds ratios of interventions versus no contact
predict(res, newmods=cbind(matrix(0, nrow=3, ncol=24), diag(3)),
### all pairwise odds ratios comparing interventions (ic vs sh, gc vs sh, and gc vs ic)
### forest plot of ors of interventions versus no contact
slab=c("no contact", "self-help", "individual counseling", "group counseling"),
atransf=exp, at=log(c(0.5, 1, 2, 4, 8)), xlab="odds ratio for intervention vs. no contact",
header=c("intervention", "odds ratio [95\% ci]"))
### restructure dataset to a contrast-based format
dat <- to.wide(dat.hasselblad1998, study="study", grp="trt", ref="no_contact", grpvars=6:7)
### calculate log odds ratios for each treatment comparison
dat <- escalc(measure="or", ai=xi.1, n1i=ni.1,
ci=xi.2, n2i=ni.2, add=1/2, to="all", data=dat)
### calculate the variance-covariance matrix of the log odds ratios for multitreatment studies
### see gleser & olkin (2009), equation (19.11), for the covariance equation
v <- bldiag(lapply(split(dat, dat$study), calc.v))
dat <- contrmat(dat, grp1="trt.1", grp2="trt.2")
### network meta-analysis using a contrast-based random-effects model
res <- rma.mv(yi, v, mods = ~ 0 + self_help + ind_counseling + grp_counseling,
random = ~ comp | study, rho=1/2, data=dat)
### predicted odds ratios of interventions versus no contact
### fit random inconsistency effects model (see law et al., 2016)
random = list(~ comp | study, ~ comp | design), rho=1/2, phi=1/2, data=dat)
medicine, psychology, smoking, odds ratios, network meta-analysis