nma.predrank {altmeta} | R Documentation |
Predictive P-Score for Treatment Ranking in Bayesian Network Meta-Analysis
Description
Calculates the P-score and predictive P-score for a network meta-analysis in the Bayesian framework described in Rosenberger et al. (2021).
Usage
nma.predrank(sid, tid, r, n, data, n.adapt = 1000, n.chains = 3, n.burnin = 2000,
n.iter = 5000, n.thin = 2, lowerbetter = TRUE, pred = TRUE,
pred.samples = FALSE, trace = FALSE)
Arguments
sid |
a vector specifying the study IDs, from 1 to the number of studies. |
tid |
a vector specifying the treatment IDs, from 1 to the number of treatments. |
r |
a numeric vector specifying the event counts. |
n |
a numeric vector specifying the sample sizes. |
data |
an optional data frame containing the network meta-analysis dataset. If |
n.adapt |
the number of iterations for adaptation in the Markov chain Monte Carlo (MCMC) algorithm. The default is 1,000. This argument and the following |
n.chains |
the number of MCMC chains. The default is 3. |
n.burnin |
the number of iterations for burn-in period. The default is 2,000. |
n.iter |
the total number of iterations in each MCMC chain after the burn-in period. The default is 5,000. |
n.thin |
a positive integer specifying thinning rate. The default is 2. |
lowerbetter |
A logical value indicating whether lower effect measures indicate better treaetments. If |
pred |
a logical value indicating whether the treatment ranking measures in a new study are to be derived. These measures are only derived when |
pred.samples |
a logical value indicating whether the posterior samples of expected scaled ranks in a new study are to be saved. |
trace |
a logical value indicating whether all posterior samples are to be saved. |
Details
Under the frequentist setting, the P-score is built on the quantiles
where and
are the point estimates of treatment effects for
vs. 1 and
vs. 1, respectively, and
is the standard error of
(Rucker and Schwarzer, 2015). Moreover,
is the cumulative distribution function of the standard normal distribution. The quantity
can be interpreted as the extent of certainty that treatment
is better than
. The frequentist P-score of treatment
is
.
Analogously to the frequentist P-score, conditional on and
, the quantities
from the Bayesian perspective can be considered as
, which are Bernoulli random variables. To quantify the overall performance of treatment
, we may similarly use
Note that is a parameter under the Bayesian framework, while the frequentist P-score is a statistic. Moreover,
is equivalent to
, where
is the true rank of treatment
. Thus, we may also write
; this corresponds to the findings by Rucker and Schwarzer (2015). Consequently, we call
the scaled rank in the network meta-analysis (NMA) for treatment
. It transforms the range of the original rank between 1 and
to a range between 0 and 1. In addition, note that
, which is analogous to the quantity of
under the frequentist framework. Therefore, we use the posterior mean of the scaled rank
as the Bayesian P-score; it is a counterpart of the frequentist P-score.
The scaled ranks can be feasibly estimated via the MCMC algorithm. Let
be the posterior samples of the overall relative effects
of all treatments vs. the reference treatment 1 in a total of
MCMC iterations after the burn-in period, where
indexes the iterations. As
is trivially 0, we set
to 0 for all
. The
th posterior sample of treatment
's scaled rank is
. We can make inferences for the scaled ranks from the posterior samples
, and use their posterior means as the Bayesian P-scores. We may also obtain the posterior medians as another set of point estimates, and the 2.5% and 97.5% posterior quantiles as the lower and upper bounds of 95% credible intervals (CrIs), respectively. Because the posterior samples of the scaled ranks take discrete values, the posterior medians and the CrI bounds are also discrete.
Based on the idea of the Bayesian P-score, we can similarly define the predictive P-score for a future study by accounting for the heterogeneity between the existing studies in the NMA and the new study. Specifically, we consider the probabilities in the new study
conditional on the population parameters ,
, and
from the NMA. Here,
and
represent the treatment effects of
vs. 1 and
vs. 1 in the new study, respectively. The
corresponds to the quantity
in the NMA; it represents the probability of treatment
being better than
in the new study. Due to heterogeneity,
and
. The correlation coefficients between treatment comparisons are typically assumed to be 0.5; therefore, such probabilities in the new study can be explicitly calculated as
, which is a function of
,
, and
. Finally, we use
to quantify the performance of treatment in the new study. The posterior samples of
can be derived from the posterior samples of
,
, and
during the MCMC algorithm.
Note that the probabilities can be written as
. Based on similar observations for the scaled ranks in the NMA, the
in the new study subsequently becomes
where is the true rank of treatment
in the new study. Thus, we call
the expected scaled rank in the new study. Like the Bayesian P-score, we define the predictive P-score as the posterior mean of
. The posterior medians and 95% CrIs can also be obtained using the MCMC samples of
. See more details in Rosenberger et al. (2021).
Value
This function estimates the P-score for all treatments in a Bayesian NMA, estimates the predictive P-score (if pred
= TRUE
), gives the posterior samples of expected scaled ranks in a new study (if pred.samples
= TRUE
), and outputs all MCMC posterior samples (if trace
= TRUE
).
Author(s)
Kristine J. Rosenberger, Lifeng Lin
References
Rosenberger KJ, Duan R, Chen Y, Lin L (2021). "Predictive P-score for treatment ranking in Bayesian network meta-analysis." BMC Medical Research Methodology, 21, 213. <doi: 10.1186/s12874-021-01397-5>
Rucker G, Schwarzer G (2015). "Ranking treatments in frequentist network meta-analysis works without resampling methods." BMC Medical Research Methodology, 15, 58. <doi: 10.1186/s12874-015-0060-8>
Examples
## increase n.burnin (e.g., to 50000) and n.iter (e.g., to 200000)
## for better convergence of MCMC
data("dat.sc")
set.seed(1234)
out1 <- nma.predrank(sid, tid, r, n, data = dat.sc, n.burnin = 500, n.iter = 2000,
lowerbetter = FALSE, pred.samples = TRUE)
out1$P.score
out1$P.score.pred
cols <- c("red4", "plum4", "paleturquoise4", "palegreen4")
cols.hist <- adjustcolor(cols, alpha.f = 0.4)
trtnames <- c("1) No contact", "2) Self-help", "3) Individual counseling",
"4) Group counseling")
brks <- seq(0, 1, 0.01)
hist(out1$P.pred[[1]], breaks = brks, freq = FALSE,
xlim = c(0, 1), ylim = c(0, 5), col = cols.hist[1], border = cols[1],
xlab = "Expected scaled rank in a new study", ylab = "Density", main = "")
hist(out1$P.pred[[2]], breaks = brks, freq = FALSE,
col = cols.hist[2], border = cols[2], add = TRUE)
hist(out1$P.pred[[3]], breaks = brks, freq = FALSE,
col = cols.hist[3], border = cols[3], add = TRUE)
hist(out1$P.pred[[4]], breaks = brks, freq = FALSE,
col = cols.hist[4], border = cols[4], add = TRUE)
legend("topright", fill = cols.hist, border = cols, legend = trtnames)
data("dat.xu")
set.seed(1234)
out2 <- nma.predrank(sid, tid, r, n, data = dat.xu, n.burnin = 500, n.iter = 2000)
out2