plot.netposet: Scatter plot or biplot showing partially order of treatment...

View source: R/plot.netposet.R

plot.netposetR Documentation

Scatter plot or biplot showing partially order of treatment ranks

Description

This function generates a scatter plot or biplot of P-scores with an overlay describing partial order of treatment ranks.

Usage

## S3 method for class 'netposet'
plot(
  x,
  plottype = "scatter",
  pooled = ifelse(x$random, "random", "common"),
  dim = "2d",
  sel.x = 1,
  sel.y = 2,
  sel.z = 3,
  cex = 1,
  col = "black",
  cex.text = cex,
  col.text = col,
  adj.x = 0,
  adj.y = 1,
  offset.x = 0.005,
  offset.y = -0.005,
  pch = NULL,
  cex.points = cex,
  col.points = col,
  col.lines = "black",
  lty.lines = 1,
  lwd.lines = 1,
  arrows = FALSE,
  length = 0.05,
  grid = TRUE,
  col.grid = "gray",
  lty.grid = 2,
  lwd.grid = 1,
  ...
)

Arguments

x

An object of class netmeta (mandatory).

plottype

A character string indicating whether a scatter plot or biplot should be produced, either "scatter" or "biplot". Can be abbreviated.

pooled

A character string indicating whether scatter plot should be drawn for common ("common") or random effects model ("random"). Can be abbreviated.

dim

A character string indicating whether a 2- or 3-dimensional plot should be produced, either "2d" or "3d". Can be abbreviated.

sel.x

A numeric specifying number of outcome to use for the x-axis in a scatterplot (argument is not considered for a biplot).

sel.y

A numeric specifying number of outcome to use for the y-axis in a scatterplot (argument is not considered for a biplot).

sel.z

A numeric specifying number of outcome to use for the z-axis in a scatterplot (argument is not considered for a biplot).

cex

The magnification to be used for treatment labels and points.

col

Colour(s) of treatment labels and points.

cex.text

The magnification to be used for treatment labels.

col.text

Colour(s) of treatment labels.

adj.x

Value(s) in [0, 1] to specify adjustment of treatment labels on x-axis (only considered in 2-D plots); see text.

adj.y

Value(s) in [0, 1] to specify adjustment of treatment labels on y-axis (only considered in 2-D plots); see text.

offset.x

Offset(s) of treatment labels on x-axis (only considered in 2-D plots).

offset.y

Offset(s) of treatment labels on y-axis (only considered in 2-D plots).

pch

Plot symbol(s) for points; no points printed if equal to NULL.

cex.points

Magnification(s) to be used for points.

col.points

Colour(s) of points.

col.lines

Line colour.

lty.lines

Line type.

lwd.lines

Line width.

arrows

A logical indicating whether arrows should be printed (only considered in 2-D plots).

length

Length of arrows; see arrows.

grid

A logical indicating whether grid lines should be added to plot.

col.grid

Colour of grid lines.

lty.grid

Line type of grid lines.

lwd.grid

Line width of grid lines.

...

Additional graphical arguments.

Details

By default (arguments plottype = "scatter" and dim = "2d"), a scatter plot is created showing P-scores (see netrank) for the first two outcomes considered in the generation of a partially ordered set of treatment ranks (using netposet). In addition to the P-scores, the partially order of treatment ranks is shown as lines connecting treatments which is analogous to a Hasse diagram. If argument dim = "3d"), a 3-D scatter plot is generated showing P-scores for the first three outcomes.

To overcome the restriction of two or three dimension, a biplot (Gabriel, 1971) can be generated using argument plottype = "biplot". This is essentially a scatter plot using the first two (dim = "2d") or three (dim = "3d") components in a principal components analysis (using prcomp). Note, if only two / three outcomes are considered in a netposet object, a 2-D / 3-D scatter plot is generated instead of a biplot as a principal component analysis is superfluous in such a situation.

Arguments sel.x and sel.y can be used to select different outcomes to show on x- and y-axis in a 2-D scatter plot; argument sel.z can be used accordingly in a 3-D scatter plot. These arguments are ignored for a biplot.

Note, in order to generate 3-D plots (argument dim = "3d"), R package rgl is necessary. Note, under macOS the X.Org X Window System must be available (see https://www.xquartz.org).

Author(s)

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

References

Carlsen L, Bruggemann R (2014): Partial order methodology: a valuable tool in chemometrics. Journal of Chemometrics, 28, 226–34

Gabriel KR (1971): The biplot graphic display of matrices with application to principal component analysis. Biometrika, 58, 453–67

See Also

netposet, hasse, netrank, netmeta

Examples

## Not run: 
data(Linde2015)

# Define order of treatments
#
trts <- c("TCA", "SSRI", "SNRI", "NRI",
  "Low-dose SARI", "NaSSa", "rMAO-A", "Hypericum", "Placebo")
#
# Outcome labels
#
outcomes <- c("Early response", "Early remission")

# (1) Early response
#
p1 <- pairwise(treat = list(treatment1, treatment2, treatment3),
  event = list(resp1, resp2, resp3), n = list(n1, n2, n3),
  studlab = id, data = Linde2015, sm = "OR")
#
net1 <- netmeta(p1, common = FALSE,
  seq = trts, ref = "Placebo", small.values = "undesirable")

# (2) Early remission
#
p2 <- pairwise(treat = list(treatment1, treatment2, treatment3),
  event = list(remi1, remi2, remi3), n = list(n1, n2, n3),
  studlab = id, data = Linde2015, sm = "OR")
#
net2 <- netmeta(p2, common = FALSE,
  seq = trts, ref = "Placebo", small.values = "undesirable")

# Partial order of treatment rankings
#
po2 <- netposet(netrank(net1), netrank(net2), outcomes = outcomes)

# Scatter plot
#
plot(po2)

# Same scatter plot as only two outcomes considered in netposet()
#
plot(po2, "biplot")


# Consider three outcomes
#
# Outcome labels
#
outcomes <- c("Early response", "Early remission", "Lost to follow-up")

# (3) Loss to follow-up
#
p3 <- pairwise(treat = list(treatment1, treatment2, treatment3),
  event = list(loss1, loss2, loss3), n = list(n1, n2, n3),
  studlab = id, data = Linde2015, sm = "OR")
#
net3 <- netmeta(p3, common = FALSE,
  seq = trts, ref = "Placebo", small.values = "desirable")

# Partial order of treatment rankings (with three outcomes) 
#
po3 <- netposet(netrank(net1), netrank(net2), netrank(net3),
  outcomes = outcomes)

# Hasse diagram
#
hasse(po3)

# Scatter plot
#
plot(po3)

# Biplot (reverse limits of y-axis as biplot is upside down)
#
plot(po3, "bi", xlim = c(-1, 1.7), ylim = c(2.5, -2.5))

## End(Not run)


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