You are on page 1of 31

18MAB301T - Probability and Statistics

Unit - IV :
Spearmans rank correlation coefficient

Dr. E. Suresh,
Assistant Professor, Department of Mathematics,
SRM Institute of Science and Technology,
Kattankulathur - 603203.
Spearman Rank Correlation

pioneer of factor analysis, and for


Spearman’s rank correlation
coefficient. The Spearman correlation
between two variables is equal to the
Pearson correlation between the rank
values of those two variables; while
Pearson’s correlation assesses linear
relationships, Spearman’s correlation
assesses monotonic relationships
(whether linear or not). If there are no
repeated data values, a perfect
Spearman correlation of +1 or 1
Charles Edward Spearman (1863 - occurs when each of the variables is a
1945) was an English psychologist perfect monotone function of the
known for work in statistics, as a other.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Definitions

Spearman Rank Correlation

The coefficient of rank correlation is based on


the various values of the variates and is denoted
by r .
It is applied to the problems in which data
cannot be measured quantitatively but
qualitative assessment is possible such as
beauty, honesty etc.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Rank Correlation Co-efficient (or)
Spearmans rank correlation coefficient

Definition:
The rank correlation co-efficient between the variables X and Y is
defined as
6 d2
P
r =1− 3
(n − n)
where di is the difference between ranks xi & yi and n is the
number of items.
Note:
(i) The rank correlation coefficient lies between - 1 and 1. (or)

−1 ≤ r ≤ 1

(ii)when the ranks are same, r = 1.


Dr. E.Suresh 18MAB301T - Probability and Statistics
Rank Correlation Co-efficient (or)
Spearsons rank correlation coefficient

(iii)For repeated ranks, we add the correction factor (C.F)

m3 − m

X
C .F . = to d2
12
where m is the number of times an item is repeated. This
correction factor (C.F) is to be added for each repeated ranks in
both the X series and Y series. That is
P 2 
6 d + C F1 + C F2 + C F3 + ....
r =1−
(n3 − n)

Dr. E.Suresh 18MAB301T - Probability and Statistics


Spearmans rank correlation coefficient

Non - Repeated Ranks

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1
Problem No. 1
The following are the ranks obtained by 10 students in statistics
and mathematics. Find the rank correlation between the two
subjects.

Statistics : 1 2 3 4 5 6 7 8 9 10
Maths : 2 4 1 5 3 9 7 10 6 8

Solution:
The rank correlation co-efficient between the variables X and Y is
defined as
6 d2
P
r =1− 3
(n − n)
where di is the difference between ranks xi & yi and n is the
number of items.
Dr. E.Suresh 18MAB301T - Probability and Statistics
Problem No. 1

Rank in Rank in d =x −y d2
statistics(x) mathematics(y)
1 2
2 4
3 1
4 5
5 3
6 9
7 7
8 10
9 6
10 8
Total

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1

Rank in Rank in d =x −y d2
statistics(x) mathematics(y)
1 2 -1
2 4 -2
3 1 2
4 5 -1
5 3 2
6 9 -3
7 7 0
8 10 -2
9 6 3
10 8 2
d 2 = 40
P
Total

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1

Rank in Rank in d =x −y d2
statistics(x) mathematics(y)
1 2 -1 1
2 4 -2 4
3 1 2 4
4 5 -1 1
5 3 2 4
6 9 -3 9
7 7 0 0
8 10 -2 4
9 6 3 9
10 8 2 4
P 2
Total d = 40

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1

Here n = 10
The rank correlation coefficient between X and Y is
6 d2
P
6 × 40
r =1− 3 =1−
103 − 10

(n − n)

240 240
=1− =1− = 1 − 0.2424 = 0.76
10 × 99 990

r = 0.76.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 2

Problem No. 2
Find the rank correlation coefficient from the following data:

Rank in X : 1 2 3 4 5 6 7
Rank in Y : 4 3 1 2 6 5 7

Solution:
The rank correlation co-efficient between the variables X and Y is
defined as
6 d2
P
r =1− 3
(n − n)
where di is the difference between ranks xi & yi and n is the
number of items.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 2

Rank in Rank in d =x −y d2
(x) (y)
1 4 -3 9
2 3 -1 1
3 1 2 4
4 2 2 4
5 6 -1 1
6 5 1 1
7 7 0 0
Total 20

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 2

Here n = 7
The rank correlation coefficient between X and Y is
6 d2
P
6 × 20
r =1− 3 =1− 3
(n − n) (7 − 7)

120 120
=1− =1− = 1 − 0.357 = 0.643
7 × 48 336

r = 0.643.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 3

Problem No. 3
Find the rank correlation coefficient from the following data:

X : 53 98 95 81 75 61 59 55
Y : 47 25 32 37 30 40 39 45

Solution: The rank correlation co-efficient between the variables X


and Y is defined as
6 d2
P
r =1− 3
(n − n)
where di is the difference between ranks xi & yi and n is the
number of items.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 3

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
53 47
98 25
95 32
81 37
75 30
61 40
59 39
55 45
Total

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 3

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
53 47 8
98 25 1
95 32 2
81 37 3
75 30 4
61 40 5
59 39 6
55 45 7
Total

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 3

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
53 47 8
98 25 1
95 32 2
81 37 3
75 30 4
61 40 5
59 39 6
55 45 7
Total

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 3

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
53 47 8 1
98 25 1 8
95 32 2 6
81 37 3 5
75 30 4 7
61 40 5 3
59 39 6 4
55 45 7 2
Total

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 3

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
53 47 8 1 7 49
98 25 1 8 -7 49
95 32 2 6 -4 16
81 37 3 5 -2 4
75 30 4 7 -3 9
61 40 5 3 2 4
59 39 6 4 2 4
55 45 7 2 5 25
Total 160

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 3

Here n = 8
The rank correlation coefficient between X and Y is
6 d2
P
6 × 160
r =1− 3 =1− 3
(n − n) (8 − 8)

960 960
=1− =1− = 1 − 1.9048 = −0.9048
8 × 63 504

r = −0.9048.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Spearmans rank correlation
coefficient
Repeated Ranks

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1
From the following data of the marks obtained by 8 students in the
computer science and statistics. Find the rank correlation
coefficient.

Marks in Computer : 15 20 28 12 40 60 20 80
Marks in Statistics : 40 30 50 30 20 10 30 60

Solution:
The data is repeated in
Marks in Computer and Marks in Statistics
The rank correlation co-efficient between the variables X and Y is
defined as
P 2 
6 d + C .F1 + C .F2 + · · ·
r =1−
(n3 − n)
where di is the difference between ranks xi & yi and n is the
number of items.
Dr. E.Suresh 18MAB301T - Probability and Statistics
Problem No. 1

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
15 40
20 30
28 50
12 30
40 20
60 10
20 30
80 60
Total

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
15 40 7 3 4 16
20 30 5.5 5 0.5 0.25
28 50 4 2 2 4
12 30 8 5 3 9
40 20 3 7 -4 16
60 10 2 8 -6 36
20 30 5.5 5 0.5 0.25
80 60 1 1 0 0
Total 81.5

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1

Here n = 8
Correction factor for X - series:
The item 20 is repeated 2 times, m1 = 2

m13 − m1

6
C .F1 = = = 0.5
12 12
Correction factor for Y - series:
The item 30 is repeated 3 times, m2 = 3

m23 − m2

24
C .F2 = = =2
12 12

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 1

The rank correlation coefficient between X and Y is


P 2 
6 d + C .F1 + C .F2 6 [81.5 + 0.5 + 2]
r =1− 3
=1−
(n − n) (83 − 8)

504
=1− =1−1=0
504

r = 0.

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 2

Problem No. 2
Find the rank correlation coefficient from the following data

X : 68 64 75 50 64 80 75 40 55 64
Y : 62 58 68 45 81 60 68 48 50 70

Solution:
The data is repeated in X and Y Series.
The rank correlation co-efficient between the variables X and Y is
defined as
P 2 
6 d + C .F1 + C .F2 + · · ·
r =1−
(n3 − n)

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 2

Assign the ranks from largest to small


X Y Rank R1 Rank R2 d = R1 − R2 d2
68 62 4 5 -1 1
64 58 6 7 -1 1
75 68 2.5 3.5 -1 1
50 45 9 10 -1 1
64 81 6 1 5 25
80 60 1 6 -5 25
75 68 2.5 3.5 -1 1
40 48 10 9 1 1
55 50 8 8 0 0
64 70 6 2 4 16
Total 72

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 2
Here n = 10
Correction factor for X - series:
The item 75 is repeated 2 times, m1 = 2

m13 − m1

6
C .F1 = = = 0.5
12 12
The item 64 is repeated 3 times, m2 = 3

m23 − m2

24
C .F2 = = =2
12 12
Correction factor for Y - series:
The item 68 is repeated 2 times, m3 = 2

m33 − m3

6
C .F3 = = = 0.5
12 12

Dr. E.Suresh 18MAB301T - Probability and Statistics


Problem No. 2

The rank correlation coefficient between X and Y is


P 2 
6 d + C .F1 + C .F2 + C .F3
r =1−
(n3 − n)

6 [72 + 0.5 + 2 + 0.5] 450


=1− 3
 =1−
10 − 10 990

= 1 − 0.4545 = 0.5455

r = 0.5455.

Dr. E.Suresh 18MAB301T - Probability and Statistics

You might also like