netcontrib: Contribution matrix in network meta-analysis

View source: R/netcontrib.R

netcontribR Documentation

Contribution matrix in network meta-analysis

Description

This function generates the contribution of direct comparisons to every network treatment comparison. The output is a matrix where rows represent network treatment effects and columns represent the contribution of direct treatment effects.

Usage

netcontrib(
  x,
  method = "shortestpath",
  hatmatrix.F1000 = FALSE,
  common = x$common,
  random = x$random,
  nchar.trts = x$nchar.trts,
  warn.deprecated = gs("warn.deprecated"),
  verbose = FALSE,
  ...
)

## S3 method for class 'netcontrib'
print(
  x,
  common = x$x$common,
  random = x$x$random,
  digits = 4,
  nchar.trts = x$nchar.trts,
  legend = TRUE,
  warn.deprecated = gs("warn.deprecated"),
  ...
)

Arguments

x

An object of class netmeta or netcontrib.

method

A character string indicating which method is to calculate the contribution matrix. Either "randomwalk" or "shortestpath", can be abbreviated.

hatmatrix.F1000

A logical indicating whether hat matrix given in F1000 article should be used for method = "shortestpath".

common

A logical indicating whether a contribution matrix should be printed for the common effects network meta-analysis.

random

A logical indicating whether a contribution matrix should be printed for the random effects network meta-analysis.

nchar.trts

A numeric defining the minimum number of characters used to create unique treatment names (see Details).

warn.deprecated

A logical indicating whether warnings should be printed if deprecated arguments are used.

verbose

A logical indicating whether progress information should be printed.

...

Additional arguments.

digits

Minimal number of significant digits, see print.default.

legend

A logical indicating whether a legend should be printed.

Details

In network meta-analysis (NMA), it is important to assess the influence of limitations or other characteristics of individual studies on the estimates obtained from the network. To this end, the contribution matrix shows how much each direct treatment effect contributes to each treatment effect estimate from network meta-analysis.

We use ideas from graph theory to derive the proportion that is contributed by each direct treatment effect. We start with the 'projection' matrix in a two-step network meta-analysis model, called the H matrix, which is analogous to the hat matrix in a linear regression model. H entries are translated to proportion contributions based on the observation that the rows of H can be interpreted as flow networks. A stream is defined as the composition of a path and its associated flow (Papakonstantinou et al., 2018).

To account for multi-arm trials, we use the H matrix from a two-step (aggregate) version of the graph theoretical NMA model (Davies et al., 2022). This H matrix can be obtained from hatmatrix with argument method = "davies".

Two methods are implemented to estimate the streams and as a result, the proportion contributions:

(1) If argument method = "randomwalk", an analytical random-walk (RW) approach is used (Davies et al., 2022). Here, the "full" version of the aggregate H matrix (hatmatrix with arguments method = "davies" and type = "full") is used to define RW transition matrices. For each pair of treatments (ij) in the network, the elements in the corresponding row of H-full define a transition matrix from node i to node j. We use the igraph package to find every (directed) path from node i to node j. The flow through each path is then equal to the probability that a walker takes that path. This is simply the product of the transition probabilities associated with each edge along the path.

(2) If argument method = "shortestpath", an iterative algorithm is used (Papakonstantinou et al., 2018). Broadly speaking, each iteration of the algorithm consists of the following steps: (i) A path in the evidence flow network is selected. (ii) The minimum flow through the edges making up the path is identified. This is assigned as the flow associated with the path. (iii) The flow of the path is subtracted from the values of flow in the edges that make up that path. This means that the edge corresponding to the minimum flow in that path is removed from the graph. (iv) A new path is then selected from the remaining graph. The process repeats until all the evidence flow in the edges has been assigned to a path.

In the original F1000 paper (Papakonstantinou et al., 2018), the hat matrix used did not account for correlations due to multi-arm trials. For reproducibility the result of this version can be obtained by specifying hatmatrix.F1000 = TRUE for method = "shortestpath". For other purposes, this method is not recommended.

Once the streams have been identified (either by method (1) or (2)), the proportion contribution of each direct comparison is equal to the sum over the flow of evidence in each path containing that edge divided by the number of edges that make up that path.

By default, treatment names are not abbreviated in printouts. However, in order to get more concise printouts, argument nchar.trts can be used to define the minimum number of characters for abbreviated treatment names (see abbreviate, argument minlength). R function treats is utilised internally to create abbreviated treatment names.

Calculation of network contributions can be compute-intensive for the random-walk approach in large networks. Crude information on the computation progress is printed if argument verbose is TRUE. In addition, computation times are printed if R package tictoc is installed.

Value

An object of class netcontrib with corresponding print function. The object is a list containing the following components:

common

Numeric matrix of percentage contributions of direct comparisons for each network comparison for the common effects model.

random

Numeric matrix of percentage contributions of direct comparisons for each network comparison for the random effects model.

x

As defined above.

tictoc.common

Computation times under common effects model (if R package tictoc is installed).

tictoc.random

Computation times under random effects model (if R package tictoc is installed).

with the contribution matrices for common and random NMA. Each matrix has the percentage contributions of each direct comparison as columns for each network comparison, direct or indirect as rows.

Author(s)

Theodoros Papakonstantinou dev@tpapak.com, Annabel Davies annabel.davies@manchester.ac.uk

References

Davies AL, Papakonstantinou T, Nikolakopoulou A, Rücker G, Galla T (2022): Network meta-analysis and random walks. Statistics in Medicine, 41, 2091–2114

Papakonstantinou, T., Nikolakopoulou, A., Rücker, G., Chaimani, A., Schwarzer, G., Egger, M., Salanti, G. (2018): Estimating the contribution of studies in network meta-analysis: paths, flows and streams. F1000Research

See Also

netmeta

Examples

# Use the Woods dataset
#
data("Woods2010")
p1 <- pairwise(treatment, event = r, n = N,
  studlab = author, data = Woods2010, sm = "OR")

net1 <- netmeta(p1)
cm <- netcontrib(net1)
cm

netcontrib(net1, method = "r")


netmeta documentation built on May 31, 2023, 5:45 p.m.