cmdscale                package:stats                R Documentation

_C_l_a_s_s_i_c_a_l (_M_e_t_r_i_c) _M_u_l_t_i_d_i_m_e_n_s_i_o_n_a_l _S_c_a_l_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     Classical multidimensional scaling of a data matrix. Also known as
     _principal coordinates analysis_ (Gower, 1966).

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

       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.

_D_e_t_a_i_l_s:

     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[i,j] + c* are used instead of the original
     d[i,j]'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).

_V_a_l_u_e:

     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) = abs(v), and T.2(v) = max(v, 0). 

_R_e_f_e_r_e_n_c_e_s:

     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.

_S_e_e _A_l_s_o:

     'dist'. Also 'isoMDS' and 'sammon' in package 'MASS'.

_E_x_a_m_p_l_e_s:

     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)
     str(cmdsE)

