How to calculate correlation between two distance matrices?
Show older comments
Hello everyone,
I have quite a naive question about correlations - which method is appropriate for establishing a correlation between two distance matrices?
I have data in the format of distance matrices (10 x 10, zeros on diagonal, examples attached), and I'd like to compare whether two such matrices are correlated with one another. The data comes from similarity ratings of pairs of 10 items and MDS analyses of the stimuli they were rating and, as such, can also be represented as similarity matrices or sets of coordinates in 2-dimensional space. What I want to do, is to check if there is any correlation between these two distance matrices.
As a first intuition, I've used Matlab corrcoef/corr2 function to compute a correlation coefficient between the two matrices, but it has been pointed out that I should use Spearman's rho instead. As far as I can tell, the function corr calculating Spearman's rho returns a matrix of values which I'm not sure how to interpret (what each of these values tells me about the overall correlation between the two matrices?) or how to convert these results into a single value that compares the two matrices.
I thought that perhaps my data is not in an appropriate format, so I tried converting it into condensed vectors (using the squareform function and transposing it into a column vector), but I'm not sure if that's the correct way of doing it. After doing this, the corr function produces dramatically lower correlation coefficients (from highly significant Spearman's r = 0.4468 to non-significant rho = 0.03). Other functions called spearman and spear produce the same results.
On the other hand, if I understand correctly, none of these methods (neither Pearson's nor Spearman's) is actually appropriate for capturing non-linear relationships in the data like this.
I've also been reading about Distance Correlation and Mantel's Test as more appropriate methods for calculating correlations between distances. I found the distcorr function, but it calculates only the r coefficient, not the significance measure. I haven't found any reliable source for Mantel's Test calculation.
As you can see, a simple correlation question confused me a bit, and I've been quite puzzled about what I should be doing, why and how to appropriately prepare my data for analysis. Do you have any suggestions about the best approach here? Any advice would be super appreciated, thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Particle & Nuclear Physics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!