# Question on Spearman's Rank Correlation Coefficient

I'm doing some practice questions in my statistics book, and started doing this one:

Find Spearman's rank correlation coefficient between X and Y for this set of data:

$X$  $13$  $20$  $22$  $18$  $19$  $11$  $10$  $15$
$Y$  $17$  $19$  $23$  $16$  $20$  $10$  $11$  $18$

I set out the data in a table, and found the difference between each value.

$d$      $4$  $1$  $1$  $2$  $1$  $1$  $1$  $3$
$d^2$  $16$  $1$  $1$  $4$  $1$  $1$  $1$  $9$

From this we can see that $\Sigma d^2 = 34$

I then calculated $r_s$ using the formula $r_s = 1- \frac{6\Sigma d^2}{n(n^2 -1)}$:

$r_s = 1- \frac{6\Sigma d^2}{n(n^2 -1)}$

$=1 - \frac{6*34}{8*63}$

$= 1- \frac{204}{504}$

$\approx 0.5952$

However, in the book the answer is given as $0.881$. So, am I wrong or is the book wrong?

To calculate spearman's rank correlation coefficient, you need to first convert the values of X and Y into ranks. For example in the X values, you should replace the lowest value (10) with a 1, then the second lowest (11) with a 2 until the largest (22) is replaced with 8.

Once you have done this to both the X and Y values, you can proceed with the method as above.

Hope that helps!

It looks like you have looked at the differences in the tabulated values to work out the $d$ values. But you're supposed to rank the values and work out the differences in the rankings.

When you do this, you will find that the $d$ values are $$1,1,0,2,1, 1,1,1.$$

This will give the correct value for $r_s$

We shouldn't take difference of $X$ and $Y$ but rank the scores in $X$ and $Y$ then take a difference then the answer comes $0.88$ Ranking is done by assigning the lowest score rank $1$ and so on.

The first need is to rank the X and Y in an Ascending or Descending order. Then subtract the first rank and second rank for the answer of d, and then square the d, to get the d^2.

Spearman's Rank Correlation Coefficient is a statistical measure of the strength of a monotonic relatioship between paired data. In a sample it is denoted by the symbol rs. reference; www.statstutor.ac.uk>spearmans; accessed 13th March 2017.

Soultions

" Sav (x)" "Sav (y)" "Rank (x)" "Rank (y)" (difference, "d" of x-y) (difference of (x-y) squared") 13 17 3 4 (3-4) = -1 1 20 19 7 6 (7-6) = 1 1 22 23 8 8 (8-8) = 0 0 18 16 5 3 (5-3) = 2 4 19 20 6 7 (6-7) = -1 1 11 10 2 1 (2-1) = 1 1 10 11 1 2 (1-2) = -1 1 15 18 4 5 (4-5) = -1 1

Spearmans rank correlation coefficient is give the formula;

Rs= 1- 6 times (sum of difference of (x-y) squared) / number of observations times (number of observations squared minus 1.

The Maths solution!

We know that we have a total number of obervations of "8 vaules" (13, 20, 22, 18, 19, 11, 10, 15) We know that the sum of the difference squared from the table of results is "10" (1+1+0+4+1+1+1+1 = 10).

Therefore Spearman's rank correlation coefficient is; rs = 1-6(10)/8(8squared -1)

Rs= 37/42 = 0.8809523 = 0.881 (3 decimal places).

The vaule 0.881 suggests a strong correlation in which the data monotonically increases. So as the x variable increases, the y variable never decreases.

Other References; Youtube (Spearman's Rank correlation coefficient: Exam solutions Maths Revision). Accessed 13th March 2017

Saviours Ndau jr

I Think you calculation was wrong- the value of d^2 is 10 so, 1-{6*sigma D^2/ N[N^2-1]} IS

  1-{6*10/ 8[64-1]}

1-{60/8*63}

1-{60/504}

1-.119

.881 Ans