linegraph: Line graph showing the results of 'mtrank' across different...

View source: R/linegraph.R

linegraphR Documentation

Line graph showing the results of mtrank across different smallest worthwhile difference (SWD) values

Description

This function produces a line graph that visualizes the results of mtrank in terms of either abilities or probabilities across different smallest worthwhile difference (SWD) values.

Usage

linegraph(
  x,
  swd,
  swd.ref,
  small.values = x$small.values,
  type = "probability",
  k = length(x$trts),
  backtransf = FALSE,
  linewidth = 1.1,
  point.size = 2,
  ...
)

Arguments

x

An object of class mtrank.

swd

A numeric vector of SWD values to be used for the sensitivity analysis.

swd.ref

A numeric SWD value to be used as the reference for sorting treatments in the final graph. This value must be included in swd.

small.values

A character string specifying whether small treatment effects indicate a beneficial ("desirable") or harmful ("undesirable") effect; can be abbreviated.

type

The metric to be used for plotting the results of the sensitivity analysis. Two options are available: the default is "probability", which plots results in terms of normalized abilities; the alternative is "ability", which plots results in terms of ability estimates. Both options can be abbreviated.

k

A numeric value indicating the number of treatments to be plotted. By default, all available treatments are shown. For large networks, it is advisable to limit the number of treatments to improve readability. If specified, the first k treatments based on the hierarchy at swd.ref will be plotted.

backtransf

A logical value indicating whether to display log-ability estimates (FALSE, default) or back-transformed ability estimates on the natural scale (TRUE). This argument is ignored if type = "probability".

linewidth

A numeric value specifying the width of the lines (default: 1.1).

point.size

A numeric value specifying the size of the points (default: 2).

...

Additional arguments passed to mtrank.

Details

This function creates a line graph to visualize probability or ability estimates obtained from mtrank across different SWD values. The order of treatments in the graph is based on their hierarchy at the reference SWD value (swd.ref).

Value

A ggplot object.

References

Evrenoglou T, Nikolakopoulou A, Schwarzer G, Ruecker G, Chaimani A (2024): Producing treatment hierarchies in network meta-analysis using probabilistic models and treatment-choice criteria, https://arxiv.org/abs/2406.10612

Examples

data("antidepressants")
#
pw <- pairwise(studlab = studyid, treat = drug_name,
  n = ntotal, event = responders,
  data = antidepressants, sm = "OR")
# Use subset to reduce runtime
pw <- subset(pw, studyid < 60)
#
net <- netmeta(pw, reference.group = "tra")
#
ranks <- tcc(net, swd = 1.20, small.values = "undesirable")
#
fit <- mtrank(ranks)
#
# Perform a sensitivity analysis across different SWD values assuming that
# 1.20 is the reference value
swd.vec <- seq(1.10, 1.50, by = 0.10)
swd.ref <- 1.20
# plot all the treatments in the network
linegraph(fit, swd = swd.vec, swd.ref = swd.ref)

# plot only the first three treatments in the order appearing at the
# 'swd.ref' value
linegraph(fit, swd = swd.vec, swd.ref = swd.ref, k = 3)
# plot in terms of ability estimates 
linegraph(fit, swd = swd.vec, swd.ref = swd.ref, type = "ability")

  

mtrank documentation built on June 8, 2025, 11:12 a.m.