**Definition 1:** Let *x _{1}, …, x_{n} *be a sample for random variable

*x*and let y

_{1}, …, y

*be a sample for random variable y of the same size*

_{n}*n*. There are

*C*(

*n*, 2) possible ways of selecting distinct pairs (

*x*, y

_{i}*) and (*

_{i}*x*, y

_{j}*). For any such assignment of pairs, define each pair as concordant, discordant or neither as follows:*

_{j}- concordant if (
*x*and y_{i}> x_{j}> y_{i}) or (_{j}*x*and y_{i}< x_{j}< y_{i})_{j} - discordant if (
*x*and y_{i}> x_{j}< y_{i}) or (_{j}*x*and y_{i}< x_{j}> y_{i})_{j} - neither if
*x*or y_{i}= x_{j}= y_{i}(i.e. ties are not counted)._{j}

Now let *C* = the number of concordant pairs and *D* = the number of discordant pairs. Then define tau as

**Observation**: If there are no ties, then *C*(*n*, 2) = *C + D*. Thus

**Observation**: To facilitate the calculation of *C – D* it is best to first put all the *x* data elements in ascending order. If *x* and y are perfectly positively correlated, then all the values of y would be in ascending order too, and so if there are no ties then *C* = *C*(*n*, 2) and *τ* = 1.

Otherwise, there will be some inversions. For each *i*, count the number of *j > i* for which *x _{j} < x_{i}*. This sum is

*D*. If

*x*and y are perfectly negatively correlated, then all the values of y would be in descending order, and so if there are no ties then

*D*=

*C*(

*n*, 2) and

*τ*= -1.

Proof: This is a result of the fact that there are *C*(*n*, 2) pairings with *C*(*n*, 2) = *C + D + T* where *T *= the number of tied pairs. Thus

*τ* is maximum when* D = T* = 0 and so *τ* = 1. *τ* is minimum when *C = T* = 0 and so *τ* = -1.

I think c9 should be 9 not 7

and k7 should be I4-I5-I6 not I11

don’t you think so?

LB,

Thanks for catching the mistake in cell C9. There was a mistake in the formula, which I have now corrected. The value should be 9 as you stated. Regarding cell K7 its value was already =I4-I5-I6. Thanks for your help.

Charles

Actually…LB is correct. K7 is shown as “=I4-I5-I11” in Figure 1 and should be “=I4-I5-I6”. Take a look.

Thanks GTL,

The formula used in cell I7 was correct, but the description of the formula written in cell K7 was incorrect as you and LB correctly pointed out. I have now corrected this on the website. Thanks for your help.

Charles

Hi Charles,

Can you please generalize the formula to calculate standard error?

Thanking You

Swapna

Hi Swapna,

The formula for standard error is given in cell K10 of Figure 1. I am sure what you mean by generalizing this formula.

Charles

Thank you Charles.

I am having some confusion kindly help me to sort it out.The range of Kendall Tau’s test is from -1 to +1. I do not know why but, in my case the result showing (-) ve tau-value are only significant otherwise (+) ve value are not showing significant why?

If only the negative values will shows the significant in the test then what is the purpose of (+) and (-) rank correlation calculation.

I have analysed 15 different sets of data 4 are (-) ve and 11 are (+) result. All 4 results are significant only due to they are having negative value other 11 result are not significant. I have tried to explain you in detail what problem exactly I am having, So kindly have some idea to solve this.

Best regards

SWAPNA

Swapna,

I don’t really understand your question. Can you send me an example which you believe will help me understand?

Charles

Hi Charles

Thank you so much for your kind attention. By this time, I have come over that problem of confusion and got the expected result which was suppose to be from my data, so no need to worry.

Regards

SWAPNA

Hi Charles,

I think the p-value calculation shown in your first example (Fig. 1, with no ties) should be =NORMSDIST(I11) not F11?

Thanks, KEH

Hi KEH,

Thanks for catching this typo. I have now changed the formula on the webpage as you have suggested.

Charles

Hey Charles,

This is a great resource, do you have a source for the equations you gathered here?

-Joe

Thanks Joe,

The information comes from a few sources, but principally from [Ho] and [IB] in the Bibliography of the website.

Charles

dear charles ,

thanks for your site may i ask you send me a formula for ties in ranking

other than arithmetic mean , if possible

best regards

See the webpage Kendall’s Tau with Ties.

Charles