Description Usage Arguments Details Value Author(s) See Also Examples
Returns a square matrix of Mahalanobis distances by doing a pairwise comparison of group means using the correlation between variables.
1 |
x |
vector or matrix of data with N observations and D variables. If grouping is not specified, the first column is used for grouping observations. |
grouping |
vector of characters or values designating group classification for observations. |
cov |
Covariance matrix (DxD) of the distribution |
inverted |
logical. If TRUE, cov is the inverse of the covariance matrix. |
digits |
number of decimals to keep for the means, cov and distance values |
... |
passed to mahalanobis for computing the inverse of the covariance matrix (if inverted is false). |
To determine the distance between group i and group j, the difference of group means for each variable are compared. For a (NxD) data matrix with m groups, a matrix of mxD means and a correlation matrix of DxD values are calculated. pairwise.mahalanobis calculates the mahalanobis distance for all possible group combinations and results in a mxm square distance matrix with m choose 2 distinct pairwise measures.
means |
(mxD) matrix of group means for each variable |
cov |
(DxD) covariance matrix of centered and scaled data, so it's actually the correlation matrix |
distance |
(mxm) matrix of squared mahalanobis distances |
Lisa McFerrin
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.