mahaldis
Mahalanobis Distance
mahaldis
measures the pairwise Mahalanobis (1936) distances between individual objects.
 Keywords
 multivariate
Usage
mahaldis(x)
Arguments
 x
 matrix containing the variables.
NA
s are not tolerated.
Details
mahaldis
computes the Mahalanobis (1936) distances between individual objects. The Mahalanobis distance takes into account correlations among variables and does not depend on the scales of the variables.
mahaldis
builds on the fact that typeII principal component analysis (PCA) preserves the Mahalanobis distance among objects (Legendre and Legendre 2012). Therefore, mahaldis
first performs a typeII PCA on standardized variables, and then computes the Euclidean distances among (repositioned) objects whose positions are given in the matrix $G$. This is equivalent to the Mahalanobis distances in the space of the original variables (Legendre and Legendre 2012).
Value

an object of class
dist
.
References
Legendre, P. and L. Legendre (2012) Numerical Ecology. 3nd English edition. Amsterdam: Elsevier.
See Also
mahalanobis
computes the Mahalanobis distances among groups of objects, not individual objects.
Examples
mat < matrix(rnorm(100), 50, 20)
ex1 < mahaldis(mat)
# check attributes
attributes(ex1)