plot.bsmds: Plot method for objects of class bsmds

Description Usage Arguments Details Value Author(s) References Examples

View source: R/plot.bsmds.R

Description

This method plots either the configuration with bootstrap confidence ellipses or a set of diagnostic measures to investigate the solution.

Usage

1
2
## S3 method for class 'bsmds'
plot(x, ..., parametric = TRUE, col = NULL, lwd = 1, center.cex = 1, id = c("colors", "text", "number", "pch", "none"), confidence.level = 0.95, key.side = "top", key.ncol = 3, srt = 0, loc = NULL, interactive.label.placement = FALSE, text.cex = 1, type = "config")

Arguments

x

An object of class bsmds

...

Optional arguments to be passed to plot.

parametric

Logical argument whether normal-theory confidence ellipses are plotted (if TRUE) or convex hulls are drawn (if FALSE).

col

A vector of colors used to identify the different ellipses.

lwd

Width of the lines used to draw the ellipses or hulls.

center.cex

The size of the point in the middle of the ellipse or hull.

id

String indicating how the ellipses should be identified. There are a number of options including "colors" in which case the ellipses are drawn with an optionally user-provided vector of colors, "text" in which case the stimulus identifiers will be plotted in the middle of the ellipses, "number" in which case a number is printed in the middle of the ellipse and identified in the key to the plot, "pch" in which case different plotting symbols are used and "none" in which case no identifier is used.

confidence.level

The confidence level of the ellipse or hull to be plotted.

key.side

The side on which the key should to the graph should be placed.

key.ncol

The number of columns in the key.

srt

An optional vector indicating the number of degrees each label should be rotated.

loc

An optional vector of locations for the identifying text to be plotted.

interactive.label.placement

If set to TRUE, allows the user to interactively (re)position the text labels for the ellipses.

text.cex

An optional vector of values that indicates the character expansion for the text identifiers.

type

If "config", the configuration with bootstrap confidence regions is printed. If "diag" a series of diagnostics are plotted. See ‘Details’ for more information.

Details

When parametric confidence regions are plotted, the ellipse function from the package of the same name is used. Otherwise, when non-parametric regions are desired, the chull function from the grDevices package is used to find the convex hull for the 100(confidence.level)% of points with the smallest euclidian distance to the original configuration point.

The interactive label placement feature provides a menu-driven interface where users can place the label and then optionally reposition it if they choose. If loc is NULL and interactive.label.placement is FALSE, the pointLabel function from the maptools package is used to find optimal placement of the labels with the smallest amount of overlap.

If the user requests type = "diag", then three diagnostic plots are printed. First, the between-cluster SS as a proportion of total SS from 1:km.thresh are printed for each bootstrap sample. Those iterations identified as degenerate are plotted in red. Second, a box-plot of stress (either metric or non-metric, as appropriate) is plotted for both the valid and degenerate solutions. Finally, a scatterplot of correlations is printed where the x-axis represents the correlation between the target (the original MDS configuration) and the un-transformed bootstrap configuration and the y-axis represents the correlation between the target and the optimally transformed bootstrap configuration. The plotting symbols are the dimension numbers. The values used to make the plot are in the cors element of the bsmds object if further inspection is required.

Value

plot

The lattice object is returned if type = "config"

loc

If type = "config", then the location of the text labels (if appropriate) is returned

Author(s)

Dave Armstrong and William Jacoby

References

Jacoby, W.G. and D. Armstrong. 2011 Bootstrap Confidence Regions for Multidimensional Scaling Solutions. Unpublished Manuscript.

Examples

1
2
3
4
5
data(thermometers2004)
out <- bsmds(thermometers2004, dist.fun = "dist", dist.data.arg="x",
    dist.args=list(method="euclidian"), R=25)
plot(out, type="diag")
plot(out, type="config", id="number")

davidaarmstrong/bsmds documentation built on May 6, 2019, 8:32 p.m.