Learn R Programming

smacof (version 2.1-7)

randomstress: Stress Calculation for Random Dissimilarities

Description

Creates random dissimilarity matrices (n objects), fits an MDS, and returns the stress values of each MDS fit.

Usage

randomstress(n, ndim, nrep = 100, type = c("ratio", "interval", "ordinal", "mspline"))

Value

Returns a vector with stress values.

Arguments

n

Number of objects

ndim

Number of dimensions for MDS

nrep

Number of random samples

type

MDS type

Details

The random dissimilarities are drawn from a U(0,1) distribution.

References

Spence I., Ogilvie, J.C. (1973). A table of expected stress values for random rankings in nonmetric multidimensional scaling. Multivariate Behavioral Research, 8, 511-517.

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")

Examples

Run this code
## 8 objects, 2 dimensions, interval MDS (50 replications)
stressvec <- randomstress(n = 8, ndim = 2, nrep = 50, type = "interval")
mean(stressvec)

Run the code above in your browser using DataLab