randomstress: Stress Calculation for Random Dissimilarities

Description Usage Arguments Details Value References Examples

View source: R/randomstress.R

Description

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

Usage

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

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.

Value

Returns a vector with stress values.

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.

Examples

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

Example output

Loading required package: plotrix

Attaching package: 'smacof'

The following object is masked from 'package:base':

    transform

[1] 0.1998597

smacof documentation built on Feb. 11, 2021, 3 a.m.