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), relative risk (RR), log odds ratio (LOR), and log relative risk (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 = "", dic = FALSE, postdens = 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 relative risk), "RD" (risk difference), "ran"hom_ind", "het_ind", "hom_eqcor", "het_eqcor", or model is "hom_eqcor", "het_eqcor", "hom_ind", or "het_ind", it can be set as "unif" (uniform prior for standardprior.type as "invgamma" for model "hom_eqcor", "het_eqcor", "hom_ind"prior.type as "unif" for model "hom_eqcor", "het_eqcor", "hom_ind", or ""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<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". Moreover, if $\mathbf{R}_{K}$ is set to be the $K \times K$ identity matrix, then the model becomes "het_ind" for heterogeneous variances of random effects, and "hom_ind" for homogeneous variance. Note that the models "het_ind" and "hom_ind" lead to independence between different treatments. Therefore, they may break study randomization, and we do not recommend these two models. In addition, for the models "hom_eqcor", "het_eqcor", "hom_ind" and "het_ind", 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"
#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
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 = 1000, n.iter = 100)Run the code above in your browser using DataLab