Help with Mahalanobis distance

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Help with Mahalanobis distance

Alex Cao
I am trying to figure out how to calculate the mahalanobis distance
for a 2 group, 2 variable simple case for a program I am writing.
My matrix is:
[1             1               3
 1             2               2
 1             3               1
 2             8               7
 2             8               6]

Column 1 is the group # and 2 & 3 are the variables.

SPSS has the casewise mahalanobis distance (smallest is listed) as:
[0.113
0.000
0.113
1.387
1.387]

My program is calculating the smallest Mahal distance as:
[1.5
0
1.5
1.5
1.5]

Can anyone help me explain where I am going wrong in this simple case?  Thanks.

Alex