This help topic is for R version 1.5.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/mva/html/cmdscale.html
cmdscale {mva}R Documentation

Classical (Metric) Multidimensional Scaling

Description

Classical multidimensional scaling of a data matrix.

Usage

cmdscale(d, k = 2, eig = FALSE, add = FALSE, x.ret = FALSE)

Arguments

d

a distance structure such as that returned by dist or a full symmetric matrix containing the dissimilarities.

k

the dimension of the space which the data are to be represented in; must be in \{1,2, .., n-1\}.

eig

indicates whether eigenvalues should be returned.

add

logical indicating if an additive constant c* should be computed, and added to the non-diagonal dissimilarites such that all n-1 eigenvalues are non-negative.

x.ret

indicates whether the doubly centered symmetric distance matrix should be returned.

Details

Multidimensional scaling takes a set of dissimilarities and returns a set of points such that the distances between the points are approximately equal to the dissimilarities.

The functions isoMDS and sammon in package ‘MASS’ provide alternative ordination techniques.

Value

If eig = FALSE and x.ret = FALSE (default), a matrix with k columns whose rows give the coordinates of the points chosen to represent the dissimilarities.

Otherwise, a list containing the following components.

points

a matrix with k columns whose rows give the coordinates of the points chosen to represent the dissimilarities.

eig

the n-1 eigenvalues computed during the scaling process if eig is true.

x

the doubly centered distance matrix if x.ret is true.

GOF

a numeric vector of length 2, equal to say (g_1,g_2), where g_i = (\sum_{j=1}^k \lambda_j)/ (\sum_{j=1}^n T_i(\lambda_j)), where \lambda_j are the eigenvalues (sorted decreasingly), T_1(v) = \left| v \right|, and T_2(v) = max( v, 0 ).

References

Cox, T. F. and Cox, M. A. A. (1994) Multidimensional Scaling. Chapman and Hall.

Mardia, K. V., Kent, J. T. and Bibby, J. M. (1979). Chapter 14 of Multivariate Analysis, London: Academic Press.

Seber, G. A. F. (1984). Multivariate Observations. New York: Wiley.

Torgerson, W. S. (1958). Theory and Methods of Scaling. New York: Wiley.

Cailliez, F. (1983) The analytical solution of the additive constant problem. Psychometrika 48, 343–349.

See Also

dist. Also isoMDS and sammon in package ‘MASS’.

Examples

data(eurodist)
loc <- cmdscale(eurodist)
x <- loc[,1]
y <- -loc[,2]
plot(x, y, type="n", xlab="", ylab="", main="cmdscale(eurodist)")
text(x, y, names(eurodist), cex=0.8)

cmdsE <- cmdscale(eurodist, k=20, add = TRUE, eig = TRUE, x.ret = TRUE)
str(cmdsE)