ranking i: {3, 1, 2}
ranking j: {2, 1, 3}
I am referring to the Wikipedia page here, and to calculate the Kendall distance, I just need to count the number of times the values in ranking i are in the opposite order of the values in ranking j.
3 < 1 in ranking i, but 3 > 1 in ranking j
3 < 2 in ranking i, but 3 > 2 in ranking j
1 < 2 in ranking i, but 1 > 2 in ranking j
There are 3 switches, so the Kendall distance is 3. However when I call a function to calculate the Kendall's distance in R, it returns 1. What's the correct Kendall's distance between these 2 rankings?
i(3>1) and j(2>1) = concordant
;i(1<2) and j(1<3)
= concordant;i(3>2) but j(2<3) = discordant
. One discordant pair. $\endgroup$