cmdscale {stats} | R Documentation |
Classical multidimensional scaling of a data matrix. Also known as principal coordinates analysis (Gower, 1966).
cmdscale(d, k = 2, eig = FALSE, add = FALSE, x.ret = FALSE)
d |
a distance structure such as that returned by |
k |
the dimension of the space which the data are to be
represented in; must be in |
eig |
indicates whether eigenvalues should be returned. |
add |
logical indicating if an additive constant |
x.ret |
indicates whether the doubly centred symmetric distance matrix should be returned. |
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.
When add = TRUE
, an additive constant c*
is computed, and
the dissimilarities d_{ij} + c*
are used instead of
the original d_{ij}
's.
Whereas S (Becker et al., 1988) computes this constant using an approximation suggested by Torgerson, R uses the analytical solution of Cailliez (1983), see also Cox and Cox (1994).
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 |
eig |
the |
x |
the doubly centered distance matrix if |
GOF |
a numeric vector of length 2, equal to say
|
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Cailliez, F. (1983) The analytical solution of the additive constant problem. Psychometrika 48, 343–349.
Cox, T. F. and Cox, M. A. A. (1994) Multidimensional Scaling. Chapman and Hall.
Gower, J. C. (1966) Some distance properties of latent root and vector methods used in multivariate analysis. Biometrika 53, 325–328.
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.
dist
.
Also isoMDS
and sammon
in package MASS.
require(graphics)
loc <- cmdscale(eurodist)
x <- loc[,1]
y <- -loc[,2]
plot(x, y, type="n", xlab="", ylab="", main="cmdscale(eurodist)")
text(x, y, rownames(loc), cex=0.8)
cmdsE <- cmdscale(eurodist, k=20, add = TRUE, eig = TRUE, x.ret = TRUE)
utils::str(cmdsE)