Sec. 7.5 RANK CORRELATION 227 



ranked second in his class in statistics on the final examination, but 

 ranked fifth in the final examination in mathematics of finance. 



Student 

 12 3 4 5 6 7 8 9 10 11 12 13 14 15 16 



X (statistics) : 2 7 4 1 10 8 15 9 16 5 6 12 11 13 3 14 



y (finance): 5 4 3 2 9 7 16 6 15 12 8 11 10 13 1 14 



Change in rank (d):3311111317211020 



It is seen from these data that there is a general but imperfect 

 tendency for a student's grades to rank about the same in both sub- 

 jects, that is, a student's grade in statistics has some relation to his 

 grade in mathematics of finance. If the relationship is basically lin- 

 ear, it can be measured rather simply and satisfactorily by means of 

 the following formula for what is called the Spearman, or rank- 

 difference, coefficient of correlation : 



62 (d 2 ) 

 (7.51) r s = 1 - 



n(n 2 — 1) 



where d is the difference between successive pairs of ranks (in the 

 above illustration) or, in general, between the ranks of Xi and Y t , i 

 varying from 1 to n. For the data on ranks in statistics and in mathe- 

 matics of finance, 



d 1 = 2 - 5 = -3, d 2 = 7 - 4 = +3, • • •, d l6 = 14 - 14 = 0; 



hence, S(d 2 ) = 92, and r s = 1 - 553/15(224) = 0.865. 



If there are ties for ranks, each X (or Y) so tied is given the mean 

 of the ranks involved in the tie. For example, if two X's are tied for 

 ranks 1 and 2, each X is given a rank of 1.5; if three Y's are tied 

 among themselves for ranks 1, 2, and 3, each is considered to have 

 rank 2. 



It can be shown that r s never has a size outside the range —1 to 

 + 1, regardless of the types of measurements involved or their sizes. 

 It is seen from formula 7.51 that, if each Y has exactly the same rank 

 as its corresponding A', all of the d's are and hence %(d'-) = and 

 r 8 = 1. If the ranks are perfectly reversed (1 with 16, 2 with 15, 

 etc.), r s = -1. 



Kendall discusses such matters as confidence intervals for rank- 

 correlation coefficients in his book (reference above) as well as intro- 

 ducing the coefficient tau (t), which he prefers to the Spearman co- 

 efficient, r 8 . These matters will not be discussed further here, but 



