[R] Bug in Kendall for n<4?

From: Stavros Macrakis <macrakis_at_alum.mit.edu>
Date: Fri, 21 Nov 2008 14:44:37 -0500


> library(Kendall)
> Kendall(1:3,1:3)

WARNING: Error exit, tauk2. IFAULT = 12 <<<<<< tau = 1, 2-sided pvalue =1

I believe Kendall tau is well-defined for this case and the reported value is correct; isn't it a bug to give a warning? (And if, e.g., the pvalue is not well-defined in this case, wouldn't it be better to return NA or NaN or something?) Also, shouldn't the error code be given in plain English -- or at least the meaning of "IFAULT = 12" documented on the help page?

A somewhat less clear case is Kendall(1:2,1:2), which gives the same error. Though the usual formula for Kendall tau has a zero in the denominator in this case, I'd think the correct generalization is 1 if the two elements are in the same order, and -1 if they are not (the only possibilities). But perhaps I don't fully understand the interpretation of this statistic.

          -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 Fri 21 Nov 2008 - 19:48:03 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 Sat 22 Nov 2008 - 15:30:26 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