Learn R Programming

pcnetmeta (version 2.0)

nma.ab: Network Meta-Analysis Using Arm-Based Method for Binary Outcomes

Description

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.

Usage

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)

Arguments

s.id
a numeric or character vector indicating study ID.
t.id
a numeric or character vector indicating treatment ID.
event.n
a numeric vector of non-negative integers, indicating event number for a certain treatment in the corresponding study.
total.n
a numeric vector of non-negative integers, indicating total number of participants for a certain treatment in the corresponding study.
trtname
a vector of character string indicating the treatment names for the corresponding treatment IDs according their order in t.id. If not specified, t.id is used as treatment names.
model
a character string indicating which Bayesian hierarchical model to be applied in the arm-based network meta-analysis. This argument can be set as "hom", "het_ind", or "het_cor" (default). See "Details" for the models
prior.type
prior distribution of variances or covariances of random effects. If model = "hom" or "het_ind", it can be set as "unif" (uniform prior for standard deviation, default) or "invgamma" (inverse gamma prior
a, b
positive numbers, specifying the shape and scale parameters of inverse gamma priors for variance(s) of random effects if using prior.type = "invgamma" for model "hom" or "het_ind". The defaults for both parameters ar
c
positive number, specifying the upper bound of uniform prior for variance(s) of random effects if using prior.type = "unif" for model "hom" or "het_ind". The default is 10.
param
a vector of character string indicating the effect sizes to be estimated. The default includes "AR" (absolute risk), "LOR" (log odds ratio), "LRR" (log relative risk), "RD" (risk difference), "best" (probability of being the best treatment). "AR" is autom
higher.better
a logical value which is in effect when estimating the probabilities of being the best treatment, i.e., "best" is included in argument param. TRUE indicates higher event rate implying better treatment, that is, the event is "good
digits
a positive integer specifying the digits after the decimal point of the effect sizes estimations. The default is 4.
n.adapt
the number of iterations for adaptation. The default is 5,000. If a warning "adaptation incomplete" appears, one may increase n.adapt. This argument and the following n.iter, n.burnin, n.chains, n.
n.iter
the total number of iterations in each MCMC chain. The default is 100,000.
n.burnin
the number of iterations for burn-in. The default is n.iter/2.
n.chains
the number of MCMC chains. The default is 3.
n.thin
a positive integer indicating thinning rate. The default is the thinning rate which yields no more than 100,000 iterations remaining in each chain.
conv.diag
a logical value indicating whether to conduct MCMC convergence diagnostic. The default is FALSE. If TRUE, a txt file, which contains the point estimates of the potential scale reduction factor (psrf) and their upper confidence li
trace
a vector of character string of effect sizes. The character strings should be selected from those specified by param (except "best"), and trace plots would be drew for the specified effect sizes and saved in the current working directory. The
dic
a logical value indicating whether the deviance information criterion (DIC) to be calculated. The default is FALSE. If TRUE, n.chains must be greater than 1.
postdens
a logical value indicating whether to draw the posterior density plot for absolue risks (ARs) of multiple treatments. If TRUE, a pdf file containing the plot would be written in the current working directory. The default is FALSE

Value

  • nma.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.

Details

Suppose that a network meta-analysis reviews $I$ studies on $K$ treatments, where each study investigates a subset of the $K$ treatments. Denote the studies from $i = 1$ to $I$ and the treatments from $k = 1$ to $K$. Let $T_{i}$ be the subset of the $K$ treatments that is compared in the $i$th study. Also, in the $i$th study, let $n_{ik}$ be the number of participants allocated to treatment $k$ ($k \in T_{i}$), and $y_{ik}$ the number of events. The arm-based model for network meta-analysis is constructed as (Zhang et al 2014) $$y_{ik} \sim Bin (n_{ik}, p_{ik}) \qquad k \in T_{i}$$ $$\Phi^{-1} (p_{ik}) = \mu_{k} + \sigma_{k} \nu_{ik} \qquad k \in T_{i}$$ $$(\nu_{i1}, \nu_{i2}, \ldots, \nu_{iK})^{T} \sim N (\boldsymbol{0}, \mathbf{R}_{K}),$$ where $\Phi (\cdot)$ is the standard normal cumulative distribution function, and $\mathbf{R}_{K}$ is a $K \times K$ positive definite correlation matrix. $\mu_{k}$'s are the fixed effects for different treatments, and $\nu_{ik}$'s are random effects. When we use an inverse-Wishart prior for the variance-covariance matrix of random effects, the above model corresponds to setting the function argument 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)$.

References

Gelman A and Rubin, DB (1992). "Inference from iterative simulation using multiple sequences." Statistical science 457--472. Lu G and Ades AE (2004). "Combination of direct and indirect evidence in mixed treatment comparisons." Stat Med 23(20), 3105--24. Spiegelhalter DJ, Best NG, Carlin BP, and Van Der Linde A (2002). "Bayesian measures of model complexity and fit." JRSSB 64(4), 583--639. Zhang J, Carlin BP, Neaton JD, Soon GG, Nie L, Kane R, Virnig BA, Chu H (2014). "Network meta-analysis of randomized clinical trials: Reporting the proper summaries." Clin Trials 11(2), 246--62.

See Also

nma.ab.cont, nma.ab.py, nma.ab.followup

Examples

Run this code
data(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