Está en la página 1de 4

Spearman rank Formula and one example

of spearman rank
The spearmans rank formula
Spearman's rank correlation is a nonparametric measure of the correlation that uses the rank of
observations in its calculation, rather than the original numeric values. It measures
the monotonic relationship between two variables X and Y. That is, if Y tends to increase
as X increases, the Spearman correlation coefficient is positive. If Y tends to decrease
as X increases, the Spearman correlation coefficient is negative. A value of zero indicates that there
is no tendency for Y to either increase or decrease when X increases. The Spearman correlation
measurement makes no assumptions about the distribution of the data.

There are two methods to calculate Spearman's correlation depending on whether: (1) your data
does not have tied ranks or (2) your data has tied ranks. The formula for when there are no tied
ranks is:

where di = difference in paired ranks and n = number of cases. The formula to use when there are
tied ranks is:

While usually formula one is used both methods tied and not tied method like the following
instruction see below
The formula for the Spearman rank correlation coefficient when there are no tied ranks is:

Example of spearmans rank formula


The scores for nine students in physics and math are as follows:
Physics: 35, 23, 47, 17, 10, 43, 9, 6, 28
Mathematics: 30, 33, 45, 23, 8, 49, 12, 4, 31
Compute the students ranks in the two subjects and compute the Spearman rank correlation.

Step 1
Find the ranks for each individual subject. I used the to find the ranks. If you want to rank by
hand, order the scores from greatest to smallest; assign the rank 1 to the highest score, 2 to the
next highest and so on:
Step 2:
Add a third column, d, to your data. The d is the difference between ranks. For example, the first
students physics rank is 3 and math rank is 5, so the difference is 3 points. In a fourth column,
square your d values.

Step 4:
Sum (add up) all of your d-squared values.
4 + 4 + 1 + 0 + 1 + 1 + 1 + 0 + 0 = 12. Youll need this for the formula (the d2 is just the sum of d-
squared values).

Step 5:
Insert the values into the formula. These ranks are not tied, so use the first formula:

= 1 (6*12)/(9(81-1))
= 1 72/720
= 1-0.1
= 0.9
The Spearman Rank Correlation for this set of data is 0.9.
Spearman Rank Correlation: Worked Example (Tied Ranks)
Tied ranks are where two items in a column have the same rank. A couple of different formulas
exist for dealing with tied ranks. Perhaps the easiest way is to use the mean of the tied ranks.

Lets say two items in the above example tied for ranks 5 and 6. You would assign each data
point a mean rank of 5.5:

Use the same formula, this time inserting the d-squared value for the tied ranks (14.5 from the
new data):

= 1 (6*14.5)/(9(81-1))
= 1 87/720
= 1 0.120833333
= 0.879

The end

También podría gustarte