Skip to content

Ranks of Spearman's rank correlation coefficient

4 messages · Zanella Marco, Gabor Grothendieck

#
Dear Sirs,
I'm using cor() funcion with Spearman method to analyse correlation of timeseries. As you know Spearman method is based on ranks of timeseries, instead of their value. 

Well, what I'm not able to do is to extract the ranks of the timeseries used from cor() to compute the Spearman correlation coefficient (also called rho). 

For instance if I have this two timeseries
I obtain rho in this way
but how can I obtain ranks for the two timeseries? Of course, the same computed and used by previous cor().

Best,

Marco

____________________________________________________________
GET FREE 5GB EMAIL - Check out spam free email with many cool features!
Visit http://www.inbox.com/email to find out more!
#
On Sun, Jan 9, 2011 at 8:22 AM, Zanella Marco <marco.zanella at inbox.com> wrote:
Try this:
[1] 0.6
1 day later
#
Dear Gabor,
thank you for your suggestion. I've already verified the result via computation of cor() on ranked timeseries with rank(), and as you report the result is the same of cor() with spearman method on simple timeseries.

But, aren't there a way to extract the rank directly form cor() function, that of course computes ranks in order to give the result. I'm tinking in a way like "cor$ranks".

Tanks.

Marco
____________________________________________________________
Send your photos by email in seconds...
TRY FREE IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if3
Works in all emails, instant messengers, blogs, forums and social networks.
#
On Mon, Jan 10, 2011 at 5:37 PM, Zanella Marco <marco.zanella at inbox.com> wrote:
You can write your own version of cor.