## 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