.BG
.FN cmdscale
.TL
Classical Metric Multi-dimensional Scaling
.CS
cmdscale(d, k=2, eig=FALSE, add=FALSE)
.AG d
distance matrix structure of the form returned by `dist' or a full, symmetric
matrix.  Data is assumed to be dissimilarities or relative distances.
.AG k
desired dimensionality of the output space.
.AG eig
if `TRUE', return the eigenvalues computed by the algorithm.
They can be used as an aid in determining the appropriate
dimensionality of the solution.
.AG add
if `TRUE', compute the additive constant
(see component `ac' below).
.RT
a structure potentially with three
components named `points', `eig' and `ac'.
.SP
.RC points
a matrix with `k' columns and as many rows as there were
objects whose distances were given in `d'.  Row i gives the
coordinates in `k'-space of the i-th object.
.RC eig
vector of eigenvalues (as many as original data points), returned only
if argument `eig' is `TRUE'.
.RC ac
constant added to all data values in `d' to transform dissimilarities
(or relative distances) into absolute distances.
The Unidimensional Subspace procedure,
(Torgerson, 1958, p. 276) is used to determine the additive constant.
.SH REFERENCE
Warren S. Torgerson,
.ul
Theory and Methods of Scaling,
pp. 247-297, Wiley, 1958.
.EX
x<-cmdscale(dist)  #default 2-space
coord1<-x[,1]; coord2<-x[,2]
par( pty="s" )  #set up square plot
r<-range(x)   #get overall max, min
plot(coord1,coord2,type="n",xlim=r,ylim=r) #set up plot
   # note units per inch same on x and y axes
text(coord1,coord2,seq(coord1))  #plot integers
.KW multivariate
.KW array
.WR
