# Kendall’s Tau Basic Concepts

Definition 1: Let x1, …, xn be a sample for random variable x and let y1, …, yn be a sample for random variable y of the same size n. There are C(n, 2) possible ways of selecting distinct pairs (xi, yi) and (xj, yj). For any such assignment of pairs, define each pair as concordant, discordant or neither as follows:

• concordant if (xi > xj and yi > yj) or (xi < xj and yi < yj)
• discordant if (xi > xj and yi < yj) or (xi < xj and yi > yj)
• neither if xi = xj or yi = yj (i.e. ties are not counted).

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

Alternatively

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 xj < xi. 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.

Property 1:

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

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

### 15 Responses to Kendall’s Tau Basic Concepts

1. LB says:

I think c9 should be 9 not 7

and k7 should be I4-I5-I6 not I11

don’t you think so?

• Charles says:

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

• GTL says:

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

• Charles says:

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

2. Swapna says:

Hi Charles,
Can you please generalize the formula to calculate standard error?

Thanking You
Swapna

• Charles says:

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

3. Swapna says:

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

• Charles says:

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

• Swapna says:

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

4. KEH says:

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

• Charles says:

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

5. Joe says:

Hey Charles,

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

-Joe

• Charles says:

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

6. ghalavand says:

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