Question 1: A computer while calculating correlation coefficient between two
variables X and Y from 25 pairs of observations obtained the following
results.
n = 25, $\sum$ x = 125, $\sum$ y = 100, $\sum$ $x^{2}$ =
650 $\sum$ $y^{2}$ = 460, $\sum$ xy = 508. At the time of checking two
pairs of observations were not correctly copied they were taken as (6,
14) and (8, 6) while the corrected values where (8, 12) and (6, 8).
Prove that the correct value of the correlation coefficient should be
$\frac{2}{3}$.
Solution:
Corrected $\sum$ x = 125  6  8 + 8 + 6 = 125
Corrected $\sum$ y = 100  14  6 + 12 + 8 = 100
Corrected $\sum$ $x^{2}$ = 650  $6^{2}$  $8^{2}$ + $6^{2}$ + $8^{2}$ = 650
Corrected $\sum$ $y^{2}$ = 460  $14^{2}$  $6^{2}$ + $12^{2}$ + $8^{2}$ = 436
Corrected $\sum$ xy = 508  6 $\times$ 14  8 $\times$ 6 + 8 $\times$ 12 + 6 $\times$ 8 = 520
The formula for Pearson product moment correlation is
r = $\frac{N\sum xy(\sum x)(\sum y)}{\sqrt{[N\sum x^{2}(\sum x)^{2}] [N\sum y^{2}(\sum y)^{2}]}}$
= $\frac{25 \times 520  125 \times 100 }{\sqrt{[25 \times 650  (125)^{2}] [25 \times 436  (100)^{2}]}}$
= $\frac{13000  12500 }{\sqrt{[16250  15625] [10900 10000]}}$
= $\frac{500 }{\sqrt{[625] [900]}}$
= $\frac{500 }{[25] [30]}$
= $\frac{2}{3}$
Question 2: The ranks of 15 students in two subjects A and B are given below. The
two numbers with the brackets denoting the ranks of the same student in A
and B respectively.
(1, 10), (2, 7), (3, 2), (4, 6), (5, 4), (6, 8),
(7, 3), (8, 1), (9, 11), (10, 15)(11, 9), (12, 5), (13, 14), (14, 12),
(15, 13).
Use spearman's formula to find rank correlation coefficient.
Solution:
To find the deviations consider the table
Ranks in A ($x_{i}$) 
Ranks in B($x_{i}$) 
$d_{i}$ = $x_{i}  y_{i}$

$d_{i}^{2}$

1 
10 
9 
81 
2 
7 
5 
25 
3 
2 
1 
1 
4 
6 
2 
4 
5 
4 
1 
1 
6 
8 
2 
4 
7 
3 
4 
16 
8 
1 
7 
49 
9 
11 
2 
4 
10 
15 
5 
25 
11 
9 
2 
4 
12 
5 
7 
49 
13 
14 
1 
1 
14 
12 
2 
4 
15 
13 
2 
4 
  $\sum$ d = 0  $\sum$ $d_{i}^{2}$ = 272 
Spearman's rank correlation coefficient is
$\rho$ = 1 
$\frac{6\sum\ d^{2}}{n(n^{2}1)}$
$\rho$ = 1 
$\frac{6\times 272}{15(2251)}$
$\rho$ = 1 
$\frac{1632}{3360}$
$\rho$ =0.52
Therefore the rank correlation coefficient is 0.52.