nma.ab performs arm-based network meta-analysis proposed by Zhang et al (2014). It estimates absolute risk (AR), risk difference (RD), odds ratio (OR), risk ratio (RR), log odds ratio (LOR), and log risk ratio (LRR).nma.ab(s.id, t.id, event.n, total.n, data, trtname,
param = c("AR", "LOR", "LRR", "RD", "rank.prob"),
model = "het_cor", prior.type, a = 0.001, b = 0.001, c = 10,
higher.better = FALSE, digits = 4, n.adapt = 5000,
n.iter = 100000, n.burnin = floor(n.iter/2), n.chains = 3,
n.thin = max(1, floor((n.iter - n.burnin)/100000)),
conv.diag = FALSE, trace = NULL, dic = FALSE, postdens = FALSE,
mcmc.samples = FALSE)data.data.data.data.data is specified, the previous arguments, s.id, t.id, event.n, and total.n, should be specified as the correspondt.id. If not specified, t.id is used as treatment names."AR" (absolute risk), "LOR" (log odds ratio), "LRR" (log risk ratio), "RD" (risk difference), "rank.p"hom_eqcor", "het_eqcor", or "het_cor" (default). See "Details" for thmodel is "hom_eqcor" or "het_eqcor", it can be set as "unif" (uniform prior for standard deviation, the default) or "invgamma"prior.type as "invgamma" for model "hom_eqcor" or "het_eqcor". The defaults prior.type as "unif" for model "hom_eqcor" or "het_eqcor". The default is 10."rank.prob" is included in the argument param). TRUE indicates higher event rate implying better treatmentn.adapt. This argument and the following n.iter, nn.iter/2.FALSE. If TRUE, n.chains must be greater than 1, and a .txt file, which contains the point estimates of the potential scale reparam (except "rank.prob"), and trace plots of the specified effect sizes will be saved in users' current working dirFALSE.TRUE, a .pdf file containing the density plot will be saved in users' current working directory. The default is FALSE<FALSE.nma.ab returns a list with estimates of effect sizes specified in param. If the argument dic = TRUE, the deviance information criterion (DIC) statistic will be returned in the output list. In addition, if conv.diag = TRUE, a .txt file containing the point estimates of the potential scale reduction factor and their upper confidence limits by Gelman and Rubin (1992) will be saved in users' current working directory. If postdens = TRUE, the posterior densities of treatment-specific absolute risks will be saved as a .pdf file. If trace is specified, the trace plots are saved as .png files.model = "het_cor". Denote $\sigma_{k}$ as the standard deviation of $\nu_{ik}$ and $\mathbf{D} = diag(\sigma_{1}, \ldots, \sigma_{K})$, then the correlation matrix $\mathbf{R}_{K} = \mathbf{D}^{-1} \mathbf{\Sigma}_{K} \mathbf{D}^{-1}$. If we assume that all of the off-diagonal elements in $\mathbf{R}_{K}$ are equal, say to $\rho$, then this model corresponds to model = "het_eqcor". If we further assume the homogeneity of variances of the random effects, that is, $\sigma_{k} = \sigma$ for $k = 1, 2, \ldots, K$, then the model is "hom_eqcor". In addition, for the models "hom_eqcor" and "het_eqcor", setting prior.type as "invgamma" implies using inverse-gamma priors with shape and scale parameters $a, b$ for $\sigma_{k}^2$ or $\sigma^2$, and "unif" implies uniform priors $U(0, c)$ for $\sigma_{k}$ or $\sigma$.nma.ab.cont, nma.ab.py, nma.ab.followupdata(smoke)
# For the smoke cessation data,
# higher event rate indicates better treatment
# use the model = "het_cor"
#set.seed(1234)
#het.cor.out <- nma.ab(s.id, t.id, r, n, data = smoke,
# trtname = c("NC", "SH", "IC", "GC"), param = c("AR", "OR", "RR", "LOR",
# "LRR", "RD", "rank.prob"), model = "het_cor", higher.better = TRUE,
# n.iter = 200000, n.thin = 1, conv.diag = TRUE, dic = TRUE,
# trace = c("AR", "LOR"), postdens = TRUE)
# use the model = "hom_eqcor"
# increase n.iter to reach convergence
# increase n.adapt to enhance efficiency
set.seed(1234)
hom.eqcor.out <- nma.ab(s.id, t.id, r, n, data = smoke,
param = c("AR", "LRR"), model = "hom_eqcor", prior.type = "unif", c = 10,
higher.better = TRUE, n.adapt = 400, n.iter = 100, n.chains = 1)Run the code above in your browser using DataLab