Calculating Spearman's Rho Value Matrix for 6x6 Matrix

  • Context: Undergrad 
  • Thread starter Thread starter swartzism
  • Start date Start date
  • Tags Tags
    Value
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 2K views
swartzism
Messages
103
Reaction score
0
So I'm interested in calculating the Spearman correlation matrix, but I am running into some issues. All of the examples I have found only calculate rho scores between two columns. I am trying to replicate results from a white paper (http://www.tandfonline.com/doi/abs/10.1080/03610918208812265?journalCode=lssp20) and they generate a 6x6 correlation matrix T for a 15x6 matrix R. I cannot figure out how they do this!

I know how to calculate Pearson's correlation coefficient in matrix form by performing R'*R and working on the resultant 6x6 matrix, but Spearman's doesn't seem clear how to produce this T matrix.

Any help on how I would go about generating this Spearman rank correlation matrix would be greatly appreciated!
 
Physics news on Phys.org
I've also discovered that this is not a Spearman's rank correlation, although they claim it is. If you do the the Spearman's coefficient calculation between columns, you do not get the T matrix given. It is in fact the Pearson's coefficient matrix of R! I had a bug in my correlation calculation. I am now getting

1.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.09688 1.00000 0.00000 0.00000 0.00000 0.00000
-0.46671 -0.31292 1.00000 0.00000 0.00000 0.00000
-0.23352 0.07098 0.33767 1.00000 0.00000 0.00000
0.26142 0.48383 -0.19696 -0.04125 1.00000 0.00000
0.17479 -0.22700 0.19021 -0.02984 0.05223 1.00000

As expected.