Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

netmatrix

Create a matrix with additional information for pairwise comparisons


Description

Auxiliary function to create a matrix with additional information for pairwise comparisons

Usage

netmatrix(
  x,
  var,
  levels,
  labels = levels,
  func = "mode",
  ties.method = "random"
)

Arguments

x

A netmeta object.

var

Variable with additional information.

levels

An optional vector of the values that var might have taken (see factor).

labels

An optional vector with labels for var (see factor).

func

A character string with the function name to summarize values within pairwise comparisons; see Details.

ties.method

A character string describing how ties are handled if func = "mode"; see Details.

Details

For each pairwise comparison, unique values will be calculated for the variable var based on the argument func: "mode" (most common value), "min" (minimum value), "max", "mean", "median", and "sum". In order to determine the most common value, the argument ties.method can be used in the case of ties with "first" meaning that the first / smallest value will be selected; similar for "last" (last / largest value) and "random" (random selection).

Value

A matrix with the same row and column names as the adjacency matrix x$A.matrix.

Author(s)

Guido Schwarzer sc@imbi.uni-freiburg.de

See Also

Examples

data(smokingcessation)
# Add variable with (fictious) risk of bias values
# with 1 = "low risk" and 2 = "high risk"
#
smokingcessation$rob <- rep(1:2, 12)

p1 <- pairwise(list(treat1, treat2, treat3),
               event = list(event1, event2, event3),
               n = list(n1, n2, n3),
               data = smokingcessation,
               sm = "OR")
net1 <- netmeta(p1, comb.fixed = FALSE, ref = "A")

# Generate network graph with information on risk of bias
#
col.rob <- netmatrix(net1, rob, ties.method = "last",
                     levels = 1:2,
                     labels = c("green", "yellow"))
#
netgraph(net1, col = col.rob,
         plastic = FALSE, thickness = "number.of.studies", multi = FALSE)

n.trts <- net1$n.trts
labs <- paste(net1$trts, " (n=", n.trts, ")", sep = "")
#
netgraph(net1, col = col.rob,
         plastic = FALSE, thickness = "number.of.studies", multi = FALSE,
         points = TRUE, col.points = "blue",
         cex.points = 6 * sqrt(n.trts / max(n.trts)),
         labels = labs)

netmeta

Network Meta-Analysis using Frequentist Methods

v1.4-0
GPL (>= 2)
Authors
Gerta Rücker [aut] (<https://orcid.org/0000-0002-2192-2560>), Ulrike Krahn [aut], Jochem König [aut] (<https://orcid.org/0000-0003-4683-0360>), Orestis Efthimiou [aut] (<https://orcid.org/0000-0002-0955-7572>), Guido Schwarzer [aut, cre] (<https://orcid.org/0000-0001-6214-9087>)
Initial release
2021-05-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.