nma.ab.py conducts an arm-based network meta-analysis for binary outcomes with exposure time in person-years. It can be applied to estimate hazard rate of each treatment, hazard ratio between treatments, and their logarithms. 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 hazard rates of multiple treatments.nma.ab.py(s.id, t.id, event.n, py, trtname, model = "het_cor",
prior.type, a = 0.001, b = 0.001, c = 10,
param = c("rate", "logratio", "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.paramparam. TRUE indicates higher sample mean of the continuous outcomes implying better treatment,n.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 FALSE.nma.ab.py 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 hazard rates 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, nma.ab.cont, nma.ab.followupdata(dietaryfat)
# increase n.iter to reach convergence of MCMC
py.out <- nma.ab.py(dietaryfat$sid, dietaryfat$tid, dietaryfat$y,
dietaryfat$py, model = "het_cor", n.adapt = 1000, n.iter = 100)Run the code above in your browser using DataLab