Learn R Programming

pcnetmeta (version 2.3)

nma.networkplot: Plotting the Network

Description

nma.networkplot plots a visual network presenting treatment comparisons.

Usage

nma.networkplot(s.id, t.id, data, title = "", trtname, alphabetic = TRUE,
                weight.edge = TRUE, adjust.thick = 5,
                weight.node = TRUE, adjust.node.size = 10,
                node.col = "orange", edge.col = "black", text.cex = 1,
                adjust.figsizex = 1.1, adjust.figsizey = 1.1)

Arguments

s.id
a numeric or character vector indicating study ID, or the corresponding column name in the argument data.
t.id
a numeric or character vector indicating treatment ID, or the corresponding column name in the argument data.
data
an optional data frame containing the dataset for network meta-analysis. If data is specified, the previous arguments, s.id and t.id, should be specified as the corresponding column names in data; otherw
title
a character string indicating plot title.
trtname
a vector of character strings indicating the treatment names for the corresponding treatment IDs according their order in t.id. If not specified, t.id is used as treatment names.
alphabetic
a logical value indicating whether to sort treatment nodes alphabetically in the network plot. The default is TRUE. If FALSE, treatment nodes are sorted by the treatment IDs specified in t.id.
weight.edge
a logical value indicating whether to draw the edges proportionally to the number of direct treatment comparisons. The default is TRUE.
adjust.thick
a positive integer indicating the maximum thickness of the edge when weight is TRUE. The default is 5.
weight.node
a logical value indicating whether node size is proportional to the number of direct treatment comparisons which include that node. The default is TRUE.
adjust.node.size
a positive number to adjust the node sizes when weight.node is TRUE. The default is 10.
node.col
a character string indicating the color of treatment nodes. The default is "orange".
edge.col
a character string indicating the color of edges between treatments nodes. The default is "black".
text.cex
a positive integer indicating the sizes of treatment names placed around/on the corresponding nodes. The default is 1.
adjust.figsizex
a positive number used to adjust the plot width. The default is 1.1.
adjust.figsizey
a positive number used to adjust the plot height. The default is 1.1.

Value

  • A network plot is generated. Each node represents a treatment, and the edges indicate the direct comparisons between the two treatments in various studies.

Examples

Run this code
data(smoke)
nma.networkplot(s.id, t.id, data = smoke, title = "Smoke Cessation",
  trtname = c("NC", "SH", "IC", "GC"))
# NC: No contact; SH: Self-help
# IC: individual counselling; GC: group counselling

data(diabetes)
nma.networkplot(s.id, t.id, data = diabetes, title = "Diabetes",
  trtname = c("Diuretic", "Placebo", "b-blocker", "CCB", "ACE inhibitor",
  "ARB"))

Run the code above in your browser using DataLab