Title: | Thresholds and Invariant Intervals for Network Meta-Analysis |
---|---|
Description: | Calculation and presentation of decision-invariant bias adjustment thresholds and intervals for Network Meta-Analysis, as described by Phillippo et al. (2018) <doi:10.1111/rssa.12341>. These describe the smallest changes to the data that would result in a change of decision. |
Authors: | David Phillippo [aut, cre] |
Maintainer: | David Phillippo <[email protected]> |
License: | GPL-3 |
Version: | 0.1.6 |
Built: | 2025-03-04 03:02:22 UTC |
Source: | https://github.com/dmphillippo/nmathresh |
Functions for converting between indexing of contrasts (useful
notationally) and
d[i]
indexing used by R.
d_ab2i(a, b, K) d_i2ab(i, K)
d_ab2i(a, b, K) d_i2ab(i, K)
a |
Vector of treatment codes |
b |
Vector of treatment codes |
K |
Total number of treatments. |
i |
Vector of indices |
d_ab2i
returns a vector of indices i
. d_i2ab
returns a data frame of indices a
and b
.
d_ab2i
: Convert d[i]
type indices to type indices.
d_i2ab
: Convert type indices to
d[i]
type indices.
By convention, . If this is not the case, an
error will be thrown. For a given number of treatments
, the total
number of possible contrasts
is
, and hence
. Again, if this is not the case, an error will be thrown.
d_ab2i(c(1,1,1, 2,2, 3), c(2,3,4, 3,4, 4), K=4) d_i2ab(1:6, K=4)
d_ab2i(c(1,1,1, 2,2, 3), c(2,3,4, 3,4, 4), K=4) d_i2ab(1:6, K=4)
Return the positive and negative thresholds for an observation, given a
vector of possible threshold solutions. This function is intended for
internal use, and is called by nma_thresh
automatically.
get.int( x, kstar, trt.code, contrs, mcid = FALSE, mean.dk = NULL, inflmat = NULL, opt.max = NULL )
get.int( x, kstar, trt.code, contrs, mcid = FALSE, mean.dk = NULL, inflmat = NULL, opt.max = NULL )
x |
Column of |
kstar |
Base-case optimal treatment. |
trt.code |
Vector of (possibly recoded) treatments. See
|
contrs |
Details of contrasts corresponding to rows in |
mcid |
Use MCID decision rule? Default |
mean.dk |
Posterior means of basic treatment parameters, required when
|
inflmat |
Column of influence matrix |
opt.max |
Is the maximum treatment effect optimal? See
|
Data frame of thresholds and new optimal treatments with columns
lo
, lo.newkstar
, hi
, and hi.newkstar
.
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.
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" )
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" )
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 |
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:
The design matrix X
for basic
treatment parameters is required. The posterior covariance matrix specified
in post
should only refer to the basic treatment parameters.
The design matrix mu.design
for additional
parameters (e.g. covariates) is required, as is the design matrix
delta.design
for random effects terms. The posterior covariance
matrix specified in post
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
.
An object of class thresh
.
The FE NMA model
The fixed effects NMA model is assumed to be of the form
The additional parameters 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
The between-study heterogeneity parameter may be given any
sensible prior. In the RE case, the threshold derivations make the
approximation that
is fixed and known.
The default decision rule is maximal efficacy; the optimal treatment is
.
When =
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 and
.
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
.
recon_vcov
, thresh_forest
,
thresh-class
.
# 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)
# 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)
Reconstruct the contrast-level likelihood covariance matrix from prior and
posterior covariance matrices. The resulting likelihood covariance matrix can
then be used to perform a contrast-level threshold analysis with the function
nma_thresh
.
recon_vcov( post, prior.prec = 1e-04, prior.vcov = diag(1/prior.prec, dim(post)[1]), X = NULL, verbose = FALSE )
recon_vcov( post, prior.prec = 1e-04, prior.vcov = diag(1/prior.prec, dim(post)[1]), X = NULL, verbose = FALSE )
post |
Posterior covariance matrix. |
prior.prec |
Prior precision. Defaults to .0001 which is a common flat
prior for NMA. Not used if |
prior.vcov |
Prior covariance matrix. Defaults to a diagonal matrix of
the same size as post, with elements |
X |
Contrast design matrix. If omitted a complete network is assumed. |
verbose |
Print intermediate matrices? Defaults to |
Full details of the calculation are given by Phillippo et al.
(2018). Briefly, the aim is to recover the contrast-level likelihood
covariance matrix that would have led to the posterior covariance
matrix
being obtained from a fixed effects NMA, with design
matrix
and prior covariance matrix
for a normal
prior on the basic treatment parameters. This is possible in this case via
the equation (resulting from conjugacy):
When the treatment network is complete (i.e. fully connected), this equation may be rearranged exactly.
When the treatment network is incomplete (i.e. not all treatments are directly compared), this equation may be solved through the use of non-negative least squares (NNLS).
When NNLS is used, some additional diagnostics are printed (and returned as attributes). Firstly, the residual sum-of-squares (RSS) from the NNLS fit. The RSS is further split into fixed RSS, from structural zeros in the reconstructed posterior according to the design matrix (and hence not fitted) that are non-zero in the true posterior, and fitted RSS, from the other fitted elements. Secondly, the Kullback-Leibler divergence of the reconstructed posterior from the true posterior. Interpreting the KL divergence as a log Bayes factor, values less than 1 indicate negligible differences between the reconstructed posterior from the true posterior, whilst values greater than 3 indicate considerable differences.
A matrix; the reconstructed likelihood covariance matrix. If NNLS is
used, the residual sum-of-squares and Kullback-Leibler divergence
diagnostics (as printed to the console) are returned as additional
attributes rss.total
, rss.fixed
, rss.free
,
kl.divergence
.
# 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)
# 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)
The posterior covariance matrix of the variables d
(basic treatment
effect parameters) and delta
(shrunken random effects estimates for
each study).
SocAnx.post.cov
SocAnx.post.cov
An object of class matrix
(inherits from array
) with 186 rows and 186 columns.
Generated from WinBUGS output, using the WinBUGS code from
Mayo-Wilson et al. (2014). See also vignette("Examples", package =
"nmathresh")
.
Mayo-Wilson E, Dias S, Mavranezouli I, Kew K, Clark DM, Ades AE, et al. Psychological and pharmacological interventions for social anxiety disorder in adults: a systematic review and network meta-analysis. Lancet Psychiatry 2014;1:368-76. http://dx.doi.org/10.1016/S2215-0366(14)70329-3
A summary.mcmc
object of the type produced by the coda
package,
containing the requisite posterior summary information on the variables
d
(basic treatment effect parameters), delta
(shrunken random
effects estimates for each study), and diff
(contrasts of treatment
effect parameters).
SocAnx.post.summary
SocAnx.post.summary
A summary.mcmc
object. The key components for our use are:
Matrix containing the posterior summary
statistics of the variables d
, delta
, and diff
, with
columns for Mean
, SD
, Naive SE
, and Time-series
SE
(also known as the Monte-Carlo standard error)
Matrix
containing the posterior 2.5%, 25%, 50%, 75%, and 97.5% quantiles of
the variables d
, delta
, and diff
Generated from WinBUGS output, using the WinBUGS code from
Mayo-Wilson et al. (2014). See also vignette("Examples", package =
"nmathresh")
.
Mayo-Wilson E, Dias S, Mavranezouli I, Kew K, Clark DM, Ades AE, et al. Psychological and pharmacological interventions for social anxiety disorder in adults: a systematic review and network meta-analysis. Lancet Psychiatry 2014;1:368-76. http://dx.doi.org/10.1016/S2215-0366(14)70329-3
This function produces two-dimensional threshold lines and invariant regions, as shown by Phillippo et al. (2018).
thresh_2d( thresh, idx, idy, xlab = paste("Adjustment to data point", idx), ylab = paste("Adjustment to data point", idy), xlim = NULL, ylim = NULL, breaks = waiver(), xbreaks = breaks, ybreaks = breaks, fill = rgb(0.72, 0.8, 0.93, 0.7), lwd = 1, fontsize = 12 )
thresh_2d( thresh, idx, idy, xlab = paste("Adjustment to data point", idx), ylab = paste("Adjustment to data point", idy), xlim = NULL, ylim = NULL, breaks = waiver(), xbreaks = breaks, ybreaks = breaks, fill = rgb(0.72, 0.8, 0.93, 0.7), lwd = 1, fontsize = 12 )
thresh |
A |
idx |
Integer specifying the index (with respect to
|
idy |
Integer specifying the index (with respect to
|
xlab |
Character string giving the label for the x axis. |
ylab |
Character string giving the label for the y axis. |
xlim |
Numeric vector of length 2, giving the x axis limits. |
ylim |
Numeric vector of length 2, giving the y axis limits. |
breaks |
Numeric vector giving position of tick marks on the x and y axes. Calculated automatically by default. |
xbreaks |
Numeric vector giving position of tick marks on the x axis.
Equal to |
ybreaks |
Numeric vector giving position of tick marks on the y axis.
Equal to |
fill |
Fill colour for invariant region. Defaults to a nice shade of
blue |
lwd |
Line width for threshold lines. Default 1. |
fontsize |
Font size for labels. Default 12. |
A ggplot
object containing the 2D threshold plot, which is
returned invisibly and plotted (unless assigned).
# 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) # Produce an invariant region for simultaneous adjustments to both arms of Study 1 thresh_2d(thresh, 1, 2, xlab = "Adjustment in Study 1 LOR: 3 vs. 1", ylab = "Adjustment in Study 1 LOR: 4 vs. 1", xlim = c(-1.5, 0.5), ylim = c(-2, 14), ybreaks = seq(-2, 14, 2))
# 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) # Produce an invariant region for simultaneous adjustments to both arms of Study 1 thresh_2d(thresh, 1, 2, xlab = "Adjustment in Study 1 LOR: 3 vs. 1", ylab = "Adjustment in Study 1 LOR: 4 vs. 1", xlim = c(-1.5, 0.5), ylim = c(-2, 14), ybreaks = seq(-2, 14, 2))
This function produces threshold forest plots, overlaying the decision-invariant intervals on the data points and their confidence/credible intervals, as shown by Phillippo et al. (2018).
thresh_forest( thresh, y, CI.lo, CI.hi, label, orderby = NULL, data = NULL, CI.title = "95% Confidence Interval", label.title = "", y.title = "Mean", II.title = "Invariant Interval", xlab = "", xlim = NULL, sigfig = 3, digits = NULL, refline = NULL, clinsig = NULL, cutoff = NULL, II.colw = rgb(0.72, 0.8, 0.93), II.cols = rgb(0.93, 0.72, 0.8), II.lwd = 8, CI.lwd = 1, pointsize = 4, fontsize = 12, xbreaks = NULL, add.columns = NULL, add.columns.title = NULL, add.columns.after = -1, add.columns.hjust = 0.5, add.columns.uline = TRUE, calcdim = display, display = TRUE )
thresh_forest( thresh, y, CI.lo, CI.hi, label, orderby = NULL, data = NULL, CI.title = "95% Confidence Interval", label.title = "", y.title = "Mean", II.title = "Invariant Interval", xlab = "", xlim = NULL, sigfig = 3, digits = NULL, refline = NULL, clinsig = NULL, cutoff = NULL, II.colw = rgb(0.72, 0.8, 0.93), II.cols = rgb(0.93, 0.72, 0.8), II.lwd = 8, CI.lwd = 1, pointsize = 4, fontsize = 12, xbreaks = NULL, add.columns = NULL, add.columns.title = NULL, add.columns.after = -1, add.columns.hjust = 0.5, add.columns.uline = TRUE, calcdim = display, display = TRUE )
thresh |
A |
y |
Data points. Either a column of |
CI.lo |
Confidence/credible interval lower limits. Either a column of
|
CI.hi |
Confidence/credible interval upper limits. Either a column of
|
label |
Row labels (for each data point). Either a column of
|
orderby |
Variable(s) to order the table rows by. Either a column or
columns of |
data |
A data frame containing the data points |
CI.title |
Title for CI column, default "95% Confidence Interval". |
label.title |
Character string giving the heading for the row labels column. |
y.title |
Character string giving the heading for the data points column, default "Mean". |
II.title |
Title for invariant interval column, default "Invariant Interval". |
xlab |
Character string giving the label for the |
xlim |
Numeric vector (length 2) of lower and upper limits for the
|
sigfig |
Number of significant digits to display in the table. Default 3. |
digits |
Number of decimal places to display in the table. Overrides
|
refline |
|
clinsig |
Set the clinical significance level. Rows are marked with a dagger if they have one or more thresholds less than this value. Not set by default. |
cutoff |
A single numeric value or numeric vector pair. Thresholds larger in magnitude than this value, or lying outside this interval, will be cut off and marked as NT (no threshold). Not set by default. |
II.colw |
Colour for "wide" invariant intervals. |
II.cols |
Colour for "short" invariant intervals. |
II.lwd |
Line width of invariant intervals. Default 8. |
CI.lwd |
Line width of confidence/credible intervals. Default 1. |
pointsize |
Point size for forest plot means. Default 4. |
fontsize |
Base font size. Default 12. |
xbreaks |
Position of tick marks on the |
add.columns |
Data frame (or matrix, vector) of additional columns to add to table. |
add.columns.title |
Optional titles for the additional columns, otherwise use names from provided data. |
add.columns.after |
Which column to add the new columns after? Default adds the columns to the far right. |
add.columns.hjust |
Vector of horizontal justifications for the new
columns, from |
add.columns.uline |
Underline the header of the new columns? Default
|
calcdim |
Logical, calculate suggested output dimensions for saving to
pdf? Calculates output size when |
display |
Logical, display the plot? Defaults to |
Displays the forest plot on the current plot device (if display
= TRUE
). Also returns invisibly the underlying gtable
object, which
can be further manipulated.
# 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) # Get treatment codes for the contrasts with data d.a <- d.b <- vector(length = nrow(X)) for (i in 1:nrow(X)){ d.a[i] <- ifelse(any(X[i, ] == -1), which(X[i, ] == -1), 0) + 1 d.b[i] <- ifelse(any(X[i, ] == 1), which(X[i, ] == 1), 0) + 1 } # Transform from d_ab style contrast references into d[i] style from the full set of contrasts # for easy indexing in R d.i <- d_ab2i(d.a, d.b, K = 6) # Create plot data plotdat <- data.frame(lab = paste0(d.b, " vs. ", d.a), contr.mean = Thrombo.post.summary$statistics[d.i, "Mean"], CI2.5 = Thrombo.post.summary$quantiles[d.i, "2.5%"], CI97.5 = Thrombo.post.summary$quantiles[d.i, "97.5%"]) # Plot thresh_forest(thresh, contr.mean, CI2.5, CI97.5, label = lab, data = plotdat, label.title = "Contrast", xlab = "Log Odds Ratio", CI.title = "95% Credible Interval", xlim = c(-.3, .3), refline = 0, digits = 2)
# 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) # Get treatment codes for the contrasts with data d.a <- d.b <- vector(length = nrow(X)) for (i in 1:nrow(X)){ d.a[i] <- ifelse(any(X[i, ] == -1), which(X[i, ] == -1), 0) + 1 d.b[i] <- ifelse(any(X[i, ] == 1), which(X[i, ] == 1), 0) + 1 } # Transform from d_ab style contrast references into d[i] style from the full set of contrasts # for easy indexing in R d.i <- d_ab2i(d.a, d.b, K = 6) # Create plot data plotdat <- data.frame(lab = paste0(d.b, " vs. ", d.a), contr.mean = Thrombo.post.summary$statistics[d.i, "Mean"], CI2.5 = Thrombo.post.summary$quantiles[d.i, "2.5%"], CI97.5 = Thrombo.post.summary$quantiles[d.i, "97.5%"]) # Plot thresh_forest(thresh, contr.mean, CI2.5, CI97.5, label = lab, data = plotdat, label.title = "Contrast", xlab = "Log Odds Ratio", CI.title = "95% Credible Interval", xlim = c(-.3, .3), refline = 0, digits = 2)
The function nmathresh
returns S3 objects of class thresh
.
Objects of class thresh
have the following components:
thresholds
A data frame with columns lo
and hi
for the lower and upper thresholds, and lo.newkstar
and
hi.newkstar
for the new optimal (or rank-trt.rank
) treatments
at each of the thresholds.
U
The threshold solutions matrix. One column for each data
point , one row for each contrast
(in ascending order).
The elements
describe the amount of adjustment to data point
required to reverse the relative ranking of treatments
and
. This matrix is particularly useful for deriving thresholds for
more complex decisions (e.g. bias-adjustment thresholds for a new treatment
entering the top two, for any change in rank of the top three, etc.)
Ukstar
The threshold solutions matrix limited to contrasts
involving . In other words, the rows of
U
corresponding to
contrasts of the form or
. Elements
of this matrix describe the amount of adjustment to data
point
required to make treatment
optimal (or
rank-
trt.rank
) over .
H
The influence matrix of the data on the basic treatment
parameters. One column for each data point , one row for each basic
treatment parameter
. Elements
describe the
influence of data point
on parameter
. This matrix can
be used to derive more complex thresholds (e.g. 2D thresholds
for simultaneous adjustments to two data points, or thresholds for common
adjustments to a group of data points).
kstar
The base-case optimal (or rank-trt.rank
)
treatment .
call
A list containing all the arguments defined in the
original call to nma_thresh
.
The posterior covariance matrix of the basic treatment effect parameters.
Thrombo.post.cov
Thrombo.post.cov
An object of class matrix
(inherits from array
) with 5 rows and 5 columns.
Generated from WinBUGS output, using the WinBUGS code from Caldwell
et al. (2005). See also vignette("Examples", package = "nmathresh")
.
Caldwell DM, Ades AE, Higgins JPT. Simultaneous comparison of multiple treatments: combining direct and indirect evidence. Brit Med J 2005;331:897-900. http://dx.doi.org/10.1136/bmj.331.7521.897
A summary.mcmc
object of the type produced by the coda
package,
containing the requisite posterior summary information on the variables
dd
, the contrasts of the treatment effect parameters.
Thrombo.post.summary
Thrombo.post.summary
A summary.mcmc
object. The key components for our use are:
Matrix containing the posterior summary
statistics, with columns for Mean
, SD
, Naive SE
, and
Time-series SE
(also known as the Monte-Carlo standard error)
Matrix containing the posterior 2.5%, 25%, 50%, 75%, and 97.5% quantiles
Generated from WinBUGS output, using the WinBUGS code from Caldwell
et al. (2005). See also vignette("Examples", package = "nmathresh")
.
Caldwell DM, Ades AE, Higgins JPT. Simultaneous comparison of multiple treatments: combining direct and indirect evidence. Brit Med J 2005;331:897-900. http://dx.doi.org/10.1136/bmj.331.7521.897
summary.mcmc
, Thrombo.post.cov