View source: R/bootmds.smacofB.R
bootmds | R Documentation |
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.
## S3 method for class 'smacofB'
bootmds(object, data, method.dat = "pearson", nrep = 100,
alpha = 0.05, verbose = FALSE, ...)
## S3 method for class '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, ...)
object |
Object of class |
data |
Initial data (before dissimilarity computation). |
method.dat |
Dissimilarity computation used as MDS input. This must be one of |
nrep |
Number of bootstrap replications. |
alpha |
Alpha level for confidence ellipsoids. |
verbose |
If |
... |
Additional arguments needed for dissimilarity computation as specified in |
x |
Object of class |
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 |
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. |
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.
cov |
Covariances for ellipse computation |
bootconf |
Configurations bootstrap samples |
stressvec |
Bootstrap stress values |
bootci |
Stress bootstrap percentile confidence interval |
stab |
Stability coefficient |
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v102.i10")}
jackmds
## 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.