Spearman's rank correlation coefficient

In mathematics and statistics, Spearman's rank correlation coefficient is a measure of correlation. It is named after its maker, Charles Spearman. It is written in short as the Greek letter rho () or sometimes as . It is a number that shows how closely two sets of data are linked. It only can be used for data which can be put in order, such as highest to lowest.

The general formula for  is .

For example, if you have data for how expensive different computers are, and data for how fast the computers are, you could see if they are linked, and how closely they are linked, using .

 Working it out 
 Step one 
To work out  you first have to rank each piece of data. We are going to use the example from the intro of computers and their speed.

So, the computer with the lowest price would be rank 1. The one higher than that would have 2. Then, it goes up until it is all ranked. You have to do this to both sets of data.

PCPrice ($)Speed (GHz) A20011.802 B27521.601 C30032.204 D35042.103 E60054.005

 Step two 
Next, we have to find the difference between the two ranks. Then, you multiply the difference by itself, which is called squaring. The difference is called , and the number you get when you square  is called .

 12-11 2111 34-11 4311 5500

 Step three 
Count how much data we have. This data has ranks 1 to 5, so we have 5 pieces of data. This number is called .

 Step four 
Finally, use everything we have worked out so far in this formula: .

 means that we take the total of all the numbers that were in the column . This is because  means total.

So,  is  which is 4. The formula says multiply it by 6, which is 24.

 is  which is 120.

So, to find out , we simply do .

Therefore, Spearman's rank correlation coefficient is 0.8 for this set of data.

 What the numbers mean 

For example, for the data that we did above,  was 0.8. So this means that there is a positive correlation. Because it is close to 1, it means that the link is strong between the two sets of data. So, we can say that those two sets of data are linked, and go up together. If it was −0.8, we could say it was linked and as one goes up, the other goes down.

 If two numbers are the same 
Sometimes, when ranking data, there are two or more numbers that are the same. When this happens in , we take the mean or average of the ranks that are the same. These are called tied ranks. To do this, we rank the tied numbers as if they were not tied. Then, we add up all the ranks that they would have, and divide it by how many there are.Spearman's Rank at www.statistics4u.info  For example, say we were ranking how well different people did in a spelling test.

Test scoreRankRank (with tied) 411 62 63 64 85 86

These numbers are used in exactly the same way as normal ranks.

Related pages
Correlation

 Notes and references 

Category:Statistical tests