netmeta (version 0.9-5)

netconnection: 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).

Usage

netconnection(treat1, treat2, studlab, data = NULL, subset = NULL,
              title = "", warn = FALSE)

# S3 method for netconnection print(x, digits = max(4, .Options$digits - 3), ...)

Arguments

treat1

Label/Number for first treatment.

treat2

Label/Number for second treatment.

studlab

An optional - but important! - vector with study labels (see Details).

data

An optional data frame containing the study information.

subset

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

title

Title of meta-analysis / systematic review.

warn

A logical indicating whether warnings should be printed.

x

An object of class netconnection.

digits

Minimal number of significant digits, see print.default.

...

Additional arguments (ignored at the moment)

Value

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

treat1, treat2, studlab, title, warn

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.

See Also

netmeta, netdistance

Examples

Run this code
# NOT RUN {
data(Senn2013)

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

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

# Extract distance matrix
nc1$D.matrix

# 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)
nc2

# 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 = (t1 %in% c("A", "F", "H") & t2 %in% c("A", "F", "H")))

# Conduct network meta-analysis on first subnetwork
net2.2 <- netmeta(1:6, 1:6, t1, t2, 1:6,
                  subset = !(t1 %in% c("A", "F", "H") & t2 %in% c("A", "F", "H")))

summary(net2.1)
summary(net2.2)
# }

Run the code above in your browser using DataCamp Workspace