Re: [R] Bug in Kendall for n<4?

From: Stavros Macrakis <macrakis_at_alum.mit.edu>
Date: Sat, 22 Nov 2008 14:50:52 -0500

On Sat, Nov 22, 2008 at 9:04 AM, Martin Maechler <maechler_at_stat.math.ethz.ch> wrote:
> SM> I believe Kendall tau is well-defined for this case...
>
> The real question is *WHY* there needs to be a separate package 'Kendall' when R itself does everything you want and does not show any problems?

Thanks for pointing me to cor(...,method="kendall"), which I did not know about; I used the Kendall CRAN package out of pure ignorance.

In my defense, I think it is excusable ignorance, as Search on the R Project home page finds the Kendall package (which only mentions cor as a "See Also"). I only more recently discovered the advantages of help.search.

By the way, is Kendall well-defined when the arguments are not permutations of each other? cor seems to return results even in this case:

   a<-factor(c("Alice","Bob","Chris"))
   b<-a[1:2]
   c<-a[2:3]
   cor(a,b,method="kendall")
       =>  1

apparently interpreting b as c(1,2) and c as c(1,2) based on alphabetical order (even though it is an UNordered factor), which seems to make the value depend on the subjects' names, which I'd think was wrong for a rank-order statistic.

Thanks again,

           -s



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 22 Nov 2008 - 19:53:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 23 Nov 2008 - 05:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive