1

If this is a snapshot of my dataset.

Row   Group   x      y      z        Survive
  1   1      0.0680 0.8701 0.0619    78.43507
  2   1      0.9984 0.0016 0.0000    89.55533
  3   1      0.4146 0.5787 0.0068    85.35468
  4   2      0.3910 0.6016 0.0074    67.49987
  5   2      0.3902 0.6023 0.0075    81.87669   
  6   2      0.0621 0.8701 0.0678    27.26777

How do I compute the Mahalanobis distance between each row /observation in Group1 with that of every observation in Group 2 ?

Row1-Group1 { Row4-Group2 , Row5-Group2 , Row6-Group2 }

Row2-Group1 { Row4-Group2 , Row5-Group2 , Row6-Group2 }

Row3-Group1 { Row4-Group2 , Row5-Group2 , Row6-Group2 }

Something like this

         r4g2    r5g2    r6g2
r1g1    0.4235  0.4225  0.0083
r2g1    0.8538  0.8549  1.2789
r3g1    0.0329  0.0340  0.4614
Science11
  • 788
  • 1
  • 8
  • 24
  • This seems related: [Mahalanobis distance on R for more than 2 groups](https://stackoverflow.com/q/23538542/914686) – Werner Jan 25 '19 at 18:29

0 Answers0