# [R] Ranking correlation with R

Peter Ehlers ehlers at ucalgary.ca
Thu Apr 15 10:31:39 CEST 2010

```On 2010-04-14 16:04, David Nemer wrote:
> Hello Guys, thank you all very much for the help!
>
> Sorry for my total lack of knowledge in R... so I did the correlation.. and
> got these results:
>
>> cor(A, C, method = "spearman")
>> [1] 0.4922165
>> cor(B, C, method = "spearman")
>> [1] 0.1922412
>> cor(A, B, method = "spearman")
>> [1] -0.00889328
>
> I don't know how to interpret them... so the correlation is good when it is
> really close to 1 or to 0? What about negative correlation??

Your questions suggest that it's time to do some studying.
Crack open a stats book (or at least check Wikipedia). There is
no such thing as a 'good' or 'bad' correlation. Everything
depends on context. You shouldn't use a statistic if you don't
understand it.

-Peter Ehlers

>
> Cheers,
> --
> David Nemer
>
>
> On Sat, Apr 10, 2010 at 2:58 PM, Gabor Grothendieck<ggrothendieck at gmail.com
>> wrote:
>
>> Try this:
>>
>>> A<- c("file1.java", "file3.java", "file2.java")
>>> B<- c("file2.java", "file4.java", "file1.java")
>>> cor(A, B, method = "spearman")
>> [1] 0.5
>>
>>
>> On Fri, Apr 9, 2010 at 11:22 AM, David Nemer<davidnemer at gmail.com>  wrote:
>>> Hey Everyone,
>>>
>>> Im fresh new in R, and Im supposed to write a code to give me a
>> correlation
>>> between two rankings. So I have two ranking lists, which contain file
>> names,
>>> e.g.:
>>>
>>> Ranking list 1:
>>> file1.java
>>> file3.java
>>> file2.java
>>>
>>> Ranking list 2:
>>> fiile2.java
>>> file4.java
>>> file1.java
>>>
>>> I need to see how much are these two ranking lists are alike, get a
>>> correlation between them. I dont even know where to start. Can anyone
>> bring
>>> me some light or tips? Thank you in advance.
>>>
>>> Cheers,
>>> --
>>> David Nemer
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help