netconnection: Get information on network connectivity (number of...

View source: R/netconnection.R

netconnection.defaultR Documentation

Get information on network connectivity (number of subnetworks, distance matrix)

Description

To determine the network structure and to test whether a given network is fully connected. Network information is provided as a triple of vectors treat1, treat2, and studlab where each row corresponds to an existing pairwise treatment comparison (treat1, treat2) in a study (studlab). The function calculates the number of subnetworks (connectivity components; value of 1 corresponds to a fully connected network) and the distance matrix (in block-diagonal form in the case of subnetworks). If some treatments are combinations of other treatments or have common components, an analysis based on the additive network meta-analysis model might be possible, see discomb function.

Usage

## Default S3 method:
netconnection(
  data = NULL,
  treat1,
  treat2,
  studlab = NULL,
  subset = NULL,
  sep.trts = ":",
  nchar.trts = 666,
  title = "",
  details.disconnected = FALSE,
  warn = FALSE,
  ...
)

## S3 method for class 'pairwise'
netconnection(
  data,
  treat1,
  treat2,
  studlab = NULL,
  subset = NULL,
  sep.trts = ":",
  nchar.trts = 666,
  title = "",
  details.disconnected = FALSE,
  warn = FALSE,
  ...
)

## S3 method for class 'netconnection'
print(
  x,
  digits = max(4, .Options$digits - 3),
  nchar.trts = x$nchar.trts,
  details = FALSE,
  details.disconnected = x$details.disconnected,
  ...
)

netconnection(data, ...)

Arguments

data

A data frame, e.g., created with pairwise.

treat1

Label / number for first treatment (ignored if data was created with pairwise).

treat2

Label / number for second treatment (ignored if data was created with pairwise).

studlab

Study labels (ignored if data was created with pairwise).

subset

An optional vector specifying a subset of studies to be used.

sep.trts

A character used in comparison names as separator between treatment labels.

nchar.trts

A numeric defining the minimum number of characters used to create unique treatment names.

title

Title of meta-analysis / systematic review.

details.disconnected

A logical indicating whether to print more details for disconnected networks.

warn

A logical indicating whether warnings should be printed.

...

Additional arguments (ignored at the moment)

x

An object of class netconnection.

digits

Minimal number of significant digits, see print.default.

details

A logical indicating whether to print the distance matrix.

Value

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

treat1, treat2, studlab, title, warn, nchar.trts

As defined above.

k

Total number of studies.

m

Total number of pairwise comparisons.

n

Total number of treatments.

n.subnets

Number of subnetworks; equal to 1 for a fully connected network.

D.matrix

Distance matrix.

A.matrix

Adjacency matrix.

L.matrix

Laplace matrix.

call

Function call.

version

Version of R package netmeta used to create object.

Author(s)

Gerta Rücker gerta.ruecker@uniklinik-freiburg.de, Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de

See Also

netmeta, netdistance, discomb

Examples

data(Senn2013)

nc1 <- netconnection(treat1, treat2, studlab, data = Senn2013)
nc1

# Extract number of (sub)networks
#
nc1$n.subnets

# Extract distance matrix
#
nc1$D.matrix

## Not run: 
# Conduct network meta-analysis (results not shown)
#
net1 <- netmeta(TE, seTE, treat1, treat2, studlab, data = Senn2013)

# Artificial example with two subnetworks
#
t1 <- c("G", "B", "B", "D", "A", "F")
t2 <- c("B", "C", "E", "E", "H", "A")
#
nc2 <- netconnection(t1, t2)
print(nc2, details = TRUE)

# Number of subnetworks
#
nc2$n.subnets

# Extract distance matrix
#
nc2$D.matrix

# Conduct network meta-analysis (results in an error message due to
# unconnected network)
try(net2 <- netmeta(1:6, 1:6, t1, t2, 1:6))

# Conduct network meta-analysis on first subnetwork
#
net2.1 <- netmeta(1:6, 1:6, t1, t2, 1:6, subset = nc2$subnet == 1)

# Conduct network meta-analysis on second subnetwork
#
net2.2 <- netmeta(1:6, 1:6, t1, t2, 1:6, subset = nc2$subnet == 2)

net2.1
net2.2

## End(Not run)  


netmeta documentation built on June 23, 2024, 9:06 a.m.