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.
# S3 method for default
netconnection(
data = NULL,
treat1,
treat2,
studlab = NULL,
subset = NULL,
sep.trts = ":",
nchar.trts = 666,
title = "",
details.disconnected = FALSE,
warn = FALSE,
...
)# S3 method for pairwise
netconnection(
data,
treat1,
treat2,
studlab = NULL,
subset = NULL,
sep.trts = ":",
drop.NA = TRUE,
nchar.trts = 666,
title = "",
details.disconnected = FALSE,
warn = FALSE,
...
)
# S3 method for netmeta
netconnection(
data,
sep.trts = data$sep.trts,
nchar.trts = data$nchar.trts,
title = data$title,
details.disconnected = FALSE,
warn = FALSE,
...
)
# S3 method for netcomb
netconnection(
data,
sep.trts = data$sep.trts,
nchar.trts,
title = data$title,
details.disconnected = FALSE,
warn = FALSE,
...
)
# S3 method for netconnection
print(
x,
digits = max(4, .Options$digits - 3),
nchar.trts = x$nchar.trts,
details = FALSE,
details.disconnected = x$details.disconnected,
...
)
netconnection(data, ...)
An object of class netconnection
with corresponding
print
function. The object is a list containing the
following components:
As defined above.
Total number of studies.
Total number of pairwise comparisons.
Total number of treatments.
Number of subnetworks; equal to 1 for a fully connected network.
Distance matrix.
Adjacency matrix.
Laplace matrix.
Function call.
Version of R package netmeta used to create object.
A data frame, e.g., created with
pairwise
.
Label / number for first treatment (ignored if
data
was created with pairwise
).
Label / number for second treatment (ignored if
data
was created with pairwise
).
Study labels (ignored if data
was created
with pairwise
).
An optional vector specifying a subset of studies to be used.
A character used in comparison names as separator between treatment labels.
A numeric defining the minimum number of characters used to create unique treatment names.
Title of meta-analysis / systematic review.
A logical indicating whether to print more details for disconnected networks.
A logical indicating whether warnings should be printed.
Additional arguments (ignored at the moment)
A logical indicating whether comparisons with missing treatment estimates or standard errors should be considered.
An object of class netconnection
.
Minimal number of significant digits, see
print.default
.
A logical indicating whether to print the distance matrix.
Gerta Rücker gerta.ruecker@uniklinik-freiburg.de, Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de
netmeta
, netdistance
,
discomb
# \donttest{
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)
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
# }
Run the code above in your browser using DataLab