The Definitive Guide to Understand Spearman’s Rank Correlation

Correlation is a statistical measure that determines how closely two variables fluctuate.  A positive correlation shows the extent to which those variables increase or decrease in parallel. A negative correlation shows the range in which one variable increases as the other decreases. In this article, we will discuss one such correlation i.e Spearman’s Rank Correlation.

Elevate Your Data Analytics Career in 2024

PL-300 Microsoft Power BI Certification TrainingExplore Program
Elevate Your Data Analytics Career in 2024

What Is Monotonic Function?

To understand Spearman’s rank correlation, it is important to understand monotonic function. A monotonic function is one that either never increases or never decreases as its independent variable changes.

The following graph illustrates the monotonic function:

Spearman's_Rank_Correlation_1

  • Monotonically Increasing: As the variable X increases, the variable Y never decreases.
  • Monotonically Decreasing: As the variable X increases, the variable Y never increases.
  • Not Monotonic: As the X variable increases, the Y variable sometimes decreases and sometimes increases. 

Spearman’s Rank Correlation

Spearman’s rank correlation measures the strength and direction of association between two ranked variables. It basically gives the measure of monotonicity of the relation between two variables i.e. how well the relationship between two variables could be represented using a monotonic function.

The formula for Spearman’s rank coefficient is:

Spearman's_Rank_Correlation_2.

𝝆 = Spearman’s rank correlation coefficient

di = Difference between the two ranks of each observation

n = Number of observations

The Spearman Rank Correlation can take a value from +1 to -1 where,

  • A value of +1 means a perfect association of rank
  • A value of 0 means that there is no association between ranks
  • A value of -1 means a perfect negative association of rank

Let’s understand the concept better with the help of an example.

Master Gen AI Strategies for Businesses with

Generative AI for Business Transformation ProgramExplore Program
Master Gen AI Strategies for Businesses with

Example of Spearman’s Rank Correlation

Consider the score of 5 students in Maths and Science that are mentioned in the table.

Spearman's_Rank_Correlation_3

Step 1: Create a table for the given data.

Step 2: Rank both the data in descending order. The highest marks will get a rank of 1 and the lowest marks will get a rank of 5.

Step 3: Calculate the difference between the ranks (d) and the square value of d.

Step 4: Add all your d square values.

Spearman's_Rank_Correlation_4

Step 5: Insert these values into the formula.

Spearman's_Rank_Correlation_5.

= 1 - (6 * 14) / 5(25 - 1)

= 0.3

The Spearman’s Rank Correlation for the given data is 0.3. The value is near 0, which means that there is a weak correlation between the two ranks.

Our Data Analyst Master's Program will help you learn analytics tools and techniques to become a Data Analyst expert! It's the pefect course for you to jumpstart your career. Enroll now!

Conclusion

In this tutorial ‘The Definitive Guide To Understand Spearman’s Rank Correlation’, you saw the concept of Spearman’s Rank Correlation and how to find its rank coefficient. You also worked on an example to understand how you can find the association between the ranks of the given data.

If you are looking to pursue a career as a Data Analyst, Simplilearn’s Data Analyst course in collaboration with IBM is the program for you.

Was this tutorial on Spearman’s Rank Correlation useful to you? Do you have any doubts or questions for us? Mention them in this article's comments section, and we'll have our experts answer them for you at the earliest!

About the Author

Aryan GuptaAryan Gupta

Aryan is a tech enthusiast who likes to stay updated about trending technologies of today. He is passionate about all things technology, a keen researcher, and writes to inspire. Aside from technology, he is an active football player and a keen enthusiast of the game.

View More
  • Disclaimer
  • PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.