Measures of association in R — Kendall's tau-b and tau-c

前端 未结 9 860

Are there any R packages for the calculation of Kendall\'s tau-b and tau-c, and their associated standard errors? My searches on Google and Rseek have turned up nothing, but su

9条回答
  •  太阳男子
    2021-01-30 10:12

    Doug's answer here is incorrect. Package Kendall can be used to calculate Tau b.

    The Kendall package function Kendall (and it would also seem cor(x,y,method="kendall")) calculate ties using the formula for Tau-b. However, for vectors with ties, the Kendall package has the more correct p-value. See page 4 of the documentation for Kendall, from https://cran.r-project.org/web/packages/Kendall/Kendall.pdf page 4, with D referencing the denominator of the Kendall calculation:

    and D = n(n − 1)/2. S is called the score and D, the denominator, is the maximum possible value of S. When there are ties, the formula for D is more complicated (Kendall, 1974, Ch. 3) and this general forumla for ties in both reankings is implemented in our function.The p-value of tau under the null hypothesis of no association is computed by in the case of no ties using an exact algorithm given by Best and Gipps (1974). When ties are present, a normal approximation with continuity correction is used by taking S as normally distributed with mean zero and variance var(S), where var(S) is given byKendall (1976, eqn 4.4, p.55). Unless ties are very extensive and/or the data is very short, this approximation is adequate. If extensive ties are present then the bootstrap provides an expedient solution (Davis and Hinkley, 1997). Alternatively an exact method based on exhaustive enumeration is also available (Valz and Thompson, 1994) but this is not implemented in this package.

    I originally made an edit to Doug's answer regarding this, but it was rejected for 'being directed at the author and more appropriate as an answer or a comment'. I would have left this as a comment on the answer, but my reputation is not yet high enough to comment.

提交回复
热议问题