Rank Correlation
Rank Correlation
Rank Correlation
When the variables under analysis are not measurable, rather they are attributes which can be
ranked; correlation analysis is done by Rank correlation method. The most common measure of
rank correlation is Spearman’s Rank Correlation Coefficient
6 ∑ D2
r= 1–{ 2 }
n(n −1)
D- Difference of ranks for each pair
n- no of pairs
Examples:
1. Given the ranks assigned on the Price and Features of 10 brands of phones; compute the
rank correlation coefficient between these variables.
Phone A B C D E F G H I J
Rank on price 10 5 4 8 9 1 3 2 6 7
Rank on features 4 5 10 9 7 6 3 1 2 8
Phon R1 R2 D D2
e
A 10 4 6 36
B 5 5 0 0
C 4 10 -6 36
D 8 9 -1 1
E 9 7 2 4
F 1 6 -5 25
G 3 3 0 0
H 2 1 1 1
I 6 2 4 16
J 7 8 -1 1
0 120
6 ∑ D2
r= 1–{ }
n(n 2−1)
6∗120
= 1–{ }=
10(100−1)
72
= 1–{ } = 0.2727
99
Low positive rank correlation; satisfaction on price and features of mobiles are not having
high correlated
Example 2: Given the data on wages and number of hours of work; find if there is a correlation
using Spearman’s rank correlation
Job No of hours of work/week Salary lacs / annum Rank1 Rank2 D D2
Software devop 54 12 6 2 4 16
Networks 60 14 5 1 4 16
Accounts 66 9 4 5 -1 1
Marketing 84 9.5 1 4 -3 9
HR 68 8 3 6 -3 9
Analytics 70 10 2 3 -1 1
Total 0 52
6 ∑ D2
r= 1–{ 2 }
n(n −1)
6∗52 52
= 1–{ } =1 - = -0.4857
6(36−1) 35
Moderate negative correlation between the two ranks; implies, less time of work leads to more
payment in this scenario
6[∑ D2 +CF ]
r= 1–{ }
n(n 2−1)
∑ m(m2−1)
CF- Correction Factor =
12
Where m- number of repetitions of a rank
Ex.3 Compute the rank correlation of the two variables X and Y
X Y Rx Ry D D2
25 54 4.5 1 3.5 12.25
35 49 3 6 -3 9
36 51 2 3 -1 1
21 50 6 5 1 1
20 51 7 3 4 16
25 48 4.5 7 -2.5 6.25
38 51 1 3 -2 4
0 49.5
Assigning ranks:
4th and 5th – average = 4.5
2 3 4- average - 3
∑ m(m2−1)
To find Correction Factor, CF =
12
Consider First series:
25 repeated twice ; m1 = 2
Consider second series:
51 repeated thrice; m2 = 3
2 ( 22 −1 ) 3 ( 32−1 )
CF = + =0.5+2=2.5
12 12
6[∑ D2 +CF ] 6[∑49.5+2.5 ] 6∗52
r= 1–{ 2 }=1–{ 2 }=1- = 1- 0.9285 = 0.071; negligible positive
n(n −1) 7 (7 −1) 7∗48
correlation
Ex 4. Given the profits and market share of 8 companies; compute the rank correlation and
interpret the relation between the two variables.
Compan Profi Market share R Profit R Market share D D2
y t
A 12 3 8 5 3 9
B 18 2 4 7.5 -3.5 12.25
C 16 8 6 2 4 16
D 17 9 5 1 4 16
E 21 4 2 3 -1 1
F 20 3 3 5 -2 4
G 25 2 1 7.5 -6.5 42.25
H 14 3 7 5 2 4
0 104.5
To find the correction factor:
First series – no repetitions
Second series:
3 repeated thrice- m1=3
2 repeated twice - m2=2
2 ( 22 −1 ) 3 ( 32−1 )
CF = + =0.5+2=2.5
12 12
There seems to be a low and negative rank correlation between Profit and Market shares
Ex 5. Compute the rank correlation between the two series:
I Series I Series II R I R D D2
D II
A 125 241 8 7 1 1
B 122 240 9 8 1 1
C 133 287 5 2 3 9
D 140 221 2 9 -7 49
E 137 248 3 6 -3 9
F 133 256 5 4 1 1
G 159 250 1 5 -4 16
H 130 294 7 1 6 36
I 133 267 5 3 2 4
J 119 200 10 10 0 0
0 126
First series:
133 repeated thrice- m1=3
3 ( 32−1 )
CF = =2
12
6[∑ D2 +CF ] 6 [126+2] 6∗128
r= 1–{ 2 }=1–{ 2 }=1- = 1- 0.7757= 0.2243
n(n −1) 10(10 −1) 10∗99
There exists a Low positive rank correlation between the two series
7. For a pair of 8 observations two series, the ∑D2 = 48, and there was a repetition of a rank three
times; find the coefficient of rank correlation
A rank repeated thrice- m1=3
3 ( 32−1 )
CF = =2
12
6[∑ D2 +CF ] 6[48+2]
r= 1–{ }=1–{ } = 1- 300/504 =
2
n(n −1) 8(8 2−1)
8. Three evaluators A, B and C, have judged a competition to test the articulation skills of 12
participants and the ranks given by them are analysed to see which two judges think more alike:
RAB = 0.26, RBC = 0.49 and RAC = -0.41. Comment.
Solution:
(A and B) as well as (B and C) think alike, since there is a positive correlation between them. But B
and C think more alike since they have higher correlation coefficient 0.49 > 0.26.
9. Three evaluators A, B and C, have judged an elocution competition; there were 10 participants
and the ranks given by them are analysed to see which two judges agree more to each other
A B C D E F G H I J
Judge A 10 4 8 7 5 2 1 3 6 9
Judge B 5 7 4 8 10 6 3 2 1 9
Judge C 9 5 7 8 6 2 1 4 3 10
Find out using rank correlation which two judges agree more to each other
Solution
Find the rank correlation between all the pairs – A&B, B& C, A&C
The pair with largest positive correlation coefficient will the two judges who agree more to each
other
D2 (AB) = 122
D2 (BC) = 74
D2 (AC) = 16
The highest positive correlation is between A and C; hence two judges agree more to each other are
A and C