nma_thresh {nmathresh} | R Documentation |
Calculate thresholds and invariant intervals
Description
This function calculates decision-invariant bias-adjustment thresholds and intervals for Bayesian network meta-analysis, as described by Phillippo et al. (2018). Thresholds are derived from the joint posterior, and reflect the amount of change to a data point before the treatment decision changes. Calculation is achieved using fast matrix operations.
Usage
nma_thresh(
mean.dk,
lhood,
post,
nmatype = "fixed",
X = NULL,
mu.design = NULL,
delta.design = NULL,
opt.max = TRUE,
trt.rank = 1,
trt.code = NULL,
trt.sub = NULL,
mcid = 0,
mcid.type = "decision"
)
Arguments
mean.dk |
Posterior means of basic treatment parameters |
lhood |
Likelihood (data) covariance matrix. |
post |
Posterior covariance matrix (see details). |
nmatype |
Character string, giving the type of NMA performed. One of "fixed" (fixed effects, the default) or "random" (random effects). May be abbreviated. |
X |
[FE models only] Design matrix for basic treatment parameters. |
mu.design |
[RE models only] Design matrix for any extra parameters.
Defaults to |
delta.design |
[RE models only] Design matrix for delta, defaults to the
|
opt.max |
Should the optimal decision be the maximal treatment effect
( |
trt.rank |
Rank of the treatment to derive thresholds for. Defaults to 1, thresholds for the optimum treatment. |
trt.code |
Treatment codings of the reference treatment and in the
parameter vector |
trt.sub |
Only look at thresholds in this subset of treatments in
|
mcid |
Minimal clinically important difference for the decision (when
|
mcid.type |
Default |
Details
This function provides bias-adjustment threshold analysis for both
fixed and random effects NMA models, as described by Phillippo et
al. (2018). Parameters mean.dk
, lhood
, and
post
are always required, however there are differences in the
specification of post
and other required parameters and between the
fixed and random effects cases:
- FE models
The design matrix
X
for basic treatment parameters is required. The posterior covariance matrix specified inpost
should only refer to the basic treatment parameters.- RE models
The design matrix
mu.design
for additional parameters (e.g. covariates) is required, as is the design matrixdelta.design
for random effects terms. The posterior covariance matrix specified inpost
should refer to the basic treatment parameters, RE terms, and additional parameters in that order; i.e.post
should be the posterior covariance matrix of the vector(d^T, \delta^T, \mu^T)^T
.
Value
An object of class thresh
.
Model details
The FE NMA model
The fixed effects NMA model is assumed to be of the form
- Prior:
d \sim \mathrm{N} ( d_0, \Sigma_d )
- Likelihood:
y|d \sim \mathrm{N} ( \delta, V )
- FE model:
\delta = Xd + M\mu
The additional parameters \mu
may be given any sensible prior; they
do not affect the threshold analysis in any way.
The RE NMA model
The random effects NMA model is assumed to be of the form
- Priors:
d \sim \mathrm{N} ( d_0, \Sigma_d ), \quad \mu \sim \mathrm{N} ( \mu_0, \Sigma_\mu )
- Likelihood:
y|d,\mu,\tau^2 \sim \mathrm{N} ( L\delta + M\mu, V )
- RE model:
\delta \sim \mathrm{N} ( Xd, \tau^2 )
The between-study heterogeneity parameter \tau^2
may be given any
sensible prior. In the RE case, the threshold derivations make the
approximation that \tau^2
is fixed and known.
Decision rules
The default decision rule is maximal efficacy; the optimal treatment is
k^* = \mathrm{argmax}_k \mathrm{E}(d_{k})
.
When \epsilon
= mcid
is greater than zero and
mcid.type = 'decision'
, the decision rule is no longer for a single
best treatment, but is based on minimal clinically important difference. A
treatment is in the optimal set if \mathrm{E}(d_k) \ge
\epsilon
and \max_a \mathrm{E}(d_a) -
\mathrm{E}(d_k) \le \epsilon
.
When mcid.type = 'change'
, the maximal efficacy rule is used, but
thresholds are found for when a new treatment is better than the base-case
optimal by at least mcid
.
See Also
recon_vcov
, thresh_forest
,
thresh-class
.
Examples
# Please see the vignette "Examples" for worked examples including use of
# this function, including more information on the brief code below.
vignette("Examples", package = "nmathresh")
### Contrast level thresholds for Thrombolytic treatments NMA
K <- 6 # Number of treatments
# Contrast design matrix is
X <- matrix(ncol = K-1, byrow = TRUE,
c(1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,
0, -1, 1, 0, 0,
0, -1, 0, 1, 0,
0, -1, 0, 0, 1))
# Reconstruct hypothetical likelihood covariance matrix using NNLS
lik.cov <- recon_vcov(Thrombo.post.cov, prior.prec = .0001, X = X)
# Thresholds are then
thresh <- nma_thresh(mean.dk = Thrombo.post.summary$statistics[1:(K-1), "Mean"],
lhood = lik.cov,
post = Thrombo.post.cov,
nmatype = "fixed",
X = X,
opt.max = FALSE)