nma.ab conducts network meta-analysis using the arm-based approach, proposed by Zhang et al (2014). It can be applied to estimate absolute risk (AR), risk difference (RD), odds ratio (OR), relative risk (RR), log odds ratio (LOR), and log relative risk (LRR). Also, it can provide deviance information criterion (DIC) statistics for evaluating the goodness of fit; give trace plots and Gelman-Rubin diagnostics to check the MCMC convergence; generate posterior density plot for absolute risks of multiple treatments.nma.ab(s.id, t.id, event.n, total.n, trtname, model = "het_cor",
prior.type, a = 0.001, b = 0.001, c = 10,
param = c("AR", "LOR", "LRR", "RD", "best"), 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)t.id. If not specified, t.id is used as treatment names."hom", "het_ind", or "het_cor" (default). See "Details" for the modelsmodel = "hom" or "het_ind", it can be set as "unif" (uniform prior for standard deviation, default) or "invgamma" (inverse gamma priorprior.type = "invgamma" for model "hom" or "het_ind". The defaults for both parameters arprior.type = "unif" for model "hom" or "het_ind". The default is 10.param. TRUE indicates higher event rate implying better treatment, that is, the event is "goodn.adapt. This argument and the following n.iter, n.burnin, n.chains, n.n.iter/2.FALSE. If TRUE, a txt file, which contains the point estimates of the potential scale reduction factor (psrf) and their upper confidence liparam (except "best"), and trace plots would be drew for the specified effect sizes and saved in the current working directory. TheFALSE. If TRUE, n.chains must be greater than 1.TRUE, a pdf file containing the plot would be written in the current working directory. The default is FALSEnma.ab returns a list with estimations of effect sizes specified in param. Also, if the argument dic is set as TRUE, the deviance information criterion (DIC) statistics would be returned in the output list. In addition, if conv.diag is set as TRUE, a txt file containing the point estimates of the potential scale reduction factor (psrf) and their upper confidence limits by Gelman and Rubin (1992) would be saved in the current working directory. If postdens is set as TRUE, the posterior densities of absolute risks of multiple treatments would be saved as a pdf file. If trace is specified, the trace plots are saved as png files.model as "het_cor". If we reduce $\mathbf{R}_{K}$ to a $K \times K$ identity matrix, then it corresponds to model "het_ind". If we further let $\sigma_{k} = \sigma$ for $k = 1, 2, \ldots, K$, then it corresponds to model "hom". In addition, for the model "het_ind" and "hom", setting prior.type as "invgamma" implies using inverse-gamma priors with shape and scale parameters $a, b$ for $\sigma_{k}$ or $\sigma$, and "unif" implies uniform priors $U(0, c)$.nma.ab.cont, nma.ab.py, nma.ab.followupdata(smoke)
# For the smoke cessation data,
# higher event rate indicates better treatment
#het.cor.out <- nma.ab(smoke$sid, smoke$tid, smoke$r, smoke$n,
# model = "het_cor", trtname = c("No contact", "Self-help",
# "Individual counselling", "Group counselling"),
# param = c("AR", "OR", "RR", "LOR", "LRR", "RD", "best"),
# higher.better = TRUE, n.iter = 200000, n.thin = 1,
# conv.diag = TRUE, dic = TRUE, trace = c("AR", "LOR"), postdens = TRUE)
# increase n.iter to reach convergence of MCMC
het.ind.out <- nma.ab(smoke$sid, smoke$tid, smoke$r, smoke$n,
model = "het_ind", prior.type = "unif", c = 10, param = c("AR", "LRR"),
higher.better = TRUE, n.adapt = 1000, n.iter = 100)
hom.out <- nma.ab(smoke$sid, smoke$tid, smoke$r, smoke$n,
model = "hom", prior.type = "invgamma", a = 0.001, b = 0.001,
param = c("AR", "RD"), higher.better = TRUE, n.adapt = 1000,
n.iter = 100)Run the code above in your browser using DataLab