Learn R Programming

smacof (version 2.1-7)

bootmds: SMACOF Bootstrap

Description

Performs a bootstrap on a SMACOF solution. It works for derived dissimilarities only. The original data matrix needs to be provided, as well as the type of dissimilarity measure used to compute the input dissimilarities.

Usage

# S3 method for smacofB
bootmds(object, data,  method.dat = "pearson", nrep = 100, 
alpha = 0.05, verbose = FALSE, ...)

# S3 method for smacofboot plot(x, plot.dim = c(1,2), col = 1, label.conf = list(label = TRUE, pos = 3, cex = 0.8), ell = list(lty = 1, lwd = 1, col = "gray"), main, xlab, ylab, xlim, ylim, asp = 1, type = "p", pch = 20, ...)

Value

cov

Covariances for ellipse computation

bootconf

Configurations bootstrap samples

stressvec

Bootstrap stress values

bootci

Stress bootstrap percentile confidence interval

stab

Stability coefficient

Arguments

object

Object of class "smacofB", i.e., an MDS solution from mds().

data

Initial data (before dissimilarity computation).

method.dat

Dissimilarity computation used as MDS input. This must be one of "pearson", "spearman", "kendall", "euclidean", "maximum", "manhattan", "canberra", "binary". For unfolding models it is either "full" for full permutations or "rows" for permutations within rows.

nrep

Number of bootstrap replications.

alpha

Alpha level for confidence ellipsoids.

verbose

If TRUE, bootstrap index is printed out.

...

Additional arguments needed for dissimilarity computation as specified in sim2diss().

x

Object of class "smacofboot"

plot.dim

Vector with dimensions to be plotted.

col

Color for points.

label.conf

List with arguments for plotting the labels of the configurations in a configuration plot (logical value whether to plot labels or not, label position). If pos = 5 labels are placed away from the nearest point.

ell

List with arguments for plotting ellipses: line type, line width, color.

main

Plot title.

xlab

Label of x-axis.

ylab

Label of y-axis.

xlim

Scale x-axis.

ylim

Scale y-axis.

asp

Aspect ratio.

pch

Plotting symbol for object point.

type

Type of plot.

Details

In order to examine the stability solution of an MDS, a bootstrap on the raw data can be performed. This results in confidence ellipses in the configuration plot. The ellipses are returned as list which allows users to produce (and further customize) the plot by hand.

References

Jacoby, W. G., & Armstrong, D. A. (2014). Bootstrap confidence regions for multidimensional scaling solutions. American Journal of Political Science, 58, 264-278.

Mair, P., Groenen, P. J. F., De Leeuw, J. (2022). More on multidimensional scaling in R: smacof version 2, Journal of Statistical Software, 102(10), 1-47. tools:::Rd_expr_doi("10.18637/jss.v102.i10")

See Also

jackmds

Examples

Run this code

## Example using Euclidean distances
data <- na.omit(PVQ40[,1:5])
diss <- dist(t(data))   ## Euclidean distances 
fit <- mds(diss)        ## 2D interval MDS

set.seed(123)
resboot <- bootmds(fit, data, method.dat = "euclidean", nrep = 50)
resboot
plot(resboot)

## Example using Pearson correlations 
sim <- cor(data)
diss <- sim2diss(sim, method = 1)  ## subtract from 1 (method needs to be passed to bootmds)
fit <- mds(diss, type = "ratio", ndim = 3)        ## 3D ratio MDS

set.seed(123)
resboot <- bootmds(fit, data, method.dat = "pearson", nrep = 50, alpha = 0.1, method = 1)
resboot
## plot 1st against 3rd dimension
ellipses <- plot(resboot, plot.dim = c(1,3), ell = list(lty = 2, col = "gray", lwd = 0.8))
str(ellipses)  ## list of ellipse coordinates for each object

Run the code above in your browser using DataLab