Learn R Programming

vegan (version 1.15-3)

wcmdscale: Weighted Classical (Metric) Multidimensional Scaling

Description

Weighted classical multidimensional scaling, also known as weighted principal coordinates analysis.

Usage

wcmdscale(d, k, eig = FALSE, add = FALSE, x.ret = FALSE, w)

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,\ldots,n-1}$. If missing, all dimensions with above zero eigenvalue.
eig
indicates whether eigenvalues should be returned.
add
logical indicating if an additive constant $c*$ should be computed, and added to the non-diagonal dissimilarities such that all $n-1$ eigenvalues are non-negative. Not implemented.
x.ret
indicates whether the doubly centred symmetric distance matrix should be returned.
w
Weights of points.

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, an object of class wcmdscale list containing the following components.

  • pointsa matrix with k columns whose rows give the coordinates of the points chosen to represent the dissimilarities.
  • eigthe $n-1$ eigenvalues computed during the scaling process if eig is true.
  • xthe doubly centred and weighted distance matrix if x.ret is true.
  • weightsWeights.

Details

Function wcmdscale is based on function cmdscale (package stats of base R), but it uses point weights. Points with high weights will have a stronger influence on the result than those with low weights. Setting equal weights w = 1 will give ordinary multidimensional scaling.

References

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.

See Also

cmdscale. Also isoMDS and sammon in package MASS.

Examples

Run this code
## Correspondence analysis as a weighted principal coordinates
## analysis of Euclidean distances of Chi-square transformed data
data(dune)
rs <- rowSums(dune)/sum(dune)
d <- dist(decostand(dune, "chi"))
ord <- wcmdscale(d, w = rs, eig = TRUE)
## Ordinary CA
ca <- cca(dune)
## Eigevalues are numerically similar
ca$CA$eig - ord$eig
## Configurations are similar when site scores are scaled by
## eigenvalues in CA
procrustes(ord, ca, choices=1:19, scaling = 1)
plot(procrustes(ord, ca, choices=1:2, scaling=1))

Run the code above in your browser using DataLab