I am trying to plot the distance between 20 dyads from a 20×20 matrix by using the cmdscale function, but the resulting plot does not match the matrix : some of my dyads are the closest on the plot while there are in fact not the closest when I am looking at the distances in the matrix (e.g 15 and 7 or 24 and 8).
The matrix is a mean of several distances by dyad, could the issue come from that, i.e. could it be linked to how MDS attempt to model similarity or dissimilarity of my data?
Thank you in advance for your help!
This is my matrix :
Columns 1 through 8
0 2.9653 3.2230 2.8584 3.1432 3.2808 3.0862 2.9497
2.9653 0 3.0887 3.1811 2.6100 2.8237 2.4911 2.7203
3.2230 3.0887 0 3.5408 3.3518 2.9686 2.9160 2.8658
2.8584 3.1811 3.5408 0 2.9473 3.2303 3.3080 3.0548
3.1432 2.6100 3.3518 2.9473 0 2.6647 3.3269 3.0144
3.2808 2.8237 2.9686 3.2303 2.6647 0 3.0047 3.0691
3.0862 2.4911 2.9160 3.3080 3.3269 3.0047 0 3.0322
2.9497 2.7203 2.8658 3.0548 3.0144 3.0691 3.0322 0
3.1762 3.0108 3.3194 3.1150 3.2592 3.1145 3.1722 3.0799
3.1882 2.9232 3.0836 3.3319 3.2622 3.2148 3.0828 3.2406
2.4554 2.7071 3.0788 3.1644 2.7968 3.0855 3.0433 2.7806
3.2932 2.8705 3.1786 3.4448 3.3172 3.2933 2.8854 3.2879
3.1120 3.1188 2.6459 3.2080 3.2328 3.1568 3.1785 3.1437
3.3260 3.1060 2.6544 3.1201 3.1650 3.0548 2.8884 2.8402
3.2803 2.5523 3.2278 3.2217 2.9949 2.7493 2.7412 3.1340
3.1909 2.8943 3.3254 3.0940 3.0320 3.2344 3.3345 2.9592
3.0632 3.0596 3.2684 3.0824 3.0228 2.9901 3.2752 2.9603
2.5344 2.9183 3.2891 3.0900 3.4848 3.3236 3.1210 2.9667
2.9851 3.0473 2.9082 2.8537 2.8224 2.9758 3.4063 2.9222
2.6194 2.9375 3.0021 3.1546 3.1915 3.1921 3.2581 3.0678
Columns 9 through 16
3.1762 3.1882 2.4554 3.2932 3.1120 3.3260 3.2803 3.1909
3.0108 2.9232 2.7071 2.8705 3.1188 3.1060 2.5523 2.8943
3.3194 3.0836 3.0788 3.1786 2.6459 2.6544 3.2278 3.3254
3.1150 3.3319 3.1644 3.4448 3.2080 3.1201 3.2217 3.0940
3.2592 3.2622 2.7968 3.3172 3.2328 3.1650 2.9949 3.0320
3.1145 3.2148 3.0855 3.2933 3.1568 3.0548 2.7493 3.2344
3.1722 3.0828 3.0433 2.8854 3.1785 2.8884 2.7412 3.3345
3.0799 3.2406 2.7806 3.2879 3.1437 2.8402 3.1340 2.9592
0 3.2420 3.2435 3.5123 2.9707 2.6942 3.2396 3.3114
3.2420 0 3.0433 2.9127 3.1470 3.3033 3.2497 3.1586
3.2435 3.0433 0 3.1954 3.0412 3.2604 3.0496 2.9285
3.5123 2.9127 3.1954 0 3.2678 3.2255 3.2575 3.1056
2.9707 3.1470 3.0412 3.2678 0 3.3503 3.5184 3.5914
2.6942 3.3033 3.2604 3.2255 3.3503 0 3.0475 2.7524
3.2396 3.2497 3.0496 3.2575 3.5184 3.0475 0 3.2534
3.3114 3.1586 2.9285 3.1056 3.5914 2.7524 3.2534 0
3.1723 3.3090 2.1651 3.5620 3.3848 3.1173 3.1470 2.6516
3.2338 3.0103 2.9089 3.2281 2.6424 3.0992 3.4654 3.0025
3.1500 2.9570 3.1055 3.0921 2.9609 2.9692 3.1632 3.0927
3.0246 3.2398 2.0885 3.4584 2.9437 3.3885 3.1736 3.4367
Columns 17 through 20
3.0632 2.5344 2.9851 2.6194
3.0596 2.9183 3.0473 2.9375
3.2684 3.2891 2.9082 3.0021
3.0824 3.0900 2.8537 3.1546
3.0228 3.4848 2.8224 3.1915
2.9901 3.3236 2.9758 3.1921
3.2752 3.1210 3.4063 3.2581
2.9603 2.9667 2.9222 3.0678
3.1723 3.2338 3.1500 3.0246
3.3090 3.0103 2.9570 3.2398
2.1651 2.9089 3.1055 2.0885
3.5620 3.2281 3.0921 3.4584
3.3848 2.6424 2.9609 2.9437
3.1173 3.0992 2.9692 3.3885
3.1470 3.4654 3.1632 3.1736
2.6516 3.0025 3.0927 3.4367
0 2.9237 2.8699 2.8729
2.9237 0 3.1148 2.6957
2.8699 3.1148 0 3.1689
2.8729 2.6957 3.1689 0
This is my code :
figure
[Y,eigvals] = cmdscale(mtrx_to_plot*100);
plot(Y(:,1),Y(:,2),’.’,’MarkerSize’,20)
text(Y(:,1), Y(:,2), arrayfun(@num2str, node_labels_G, ‘UniformOutput’, false), ‘VerticalAlignment’,’bottom’,’HorizontalAlignment’,’right’)
xlabel(‘km’)
ylabel(‘km’)
**This is the resulting plot **:
enter image description here
Marge Paris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.