# Spearman's rank correlation coefficient

## Spearman’s Rank Correlation Coefficient

• Spearman’s rank correlation coefficient, also known as Spearman’s rho, is a non-parametric measure of rank correlation.
• It assesses how well an arbitrary monotonic function could describe the relationship between two variables, without making any assumptions about the frequency distribution of the variables.
• This statistical measure is a unit-free measure of association and ranges from -1 to +1.

## Calculation of Spearman’s Rho

• To calculate Spearman’s rank correlation coefficient, each of the variables should be ranked individually.
• Once ranks have been assigned, the difference d between the ranks of each observation on the two variables is calculated.
• Spearman’s rho is then calculated using the formula: `ρ = 1 - [(6 Σd²) / (n³ - n)]` Where:
• ρ is Spearman’s rho
• Σ refers to the sum of
• d is the difference in the ranks
• n is the count of observations

## Interpretation of Spearman’s Rho

• A Spearman correlation of 1 results when each of the variables is a perfect monotone function of the other.
• A Spearman correlation of 0 means that there is no such monotonic function.
• A Spearman correlation of -1 results when one variable is a perfect monotone decreasing function of the other.
• The closer the coefficient is to either -1 or 1, the stronger the correlation between the ranks of the variables.

## Assumptions for using Spearman’s Rho

• Ordinal scale: Both variables are ordinal or continuous and can be ranked like exam results.
• Mutually dependent pairs: Each observation in the data set consists of a pair of mutually dependent values.

## Limitations

• Spearman’s rank correlation coefficient is not a full-proof statistical tool. It is based on a rank-order relationship, so if the data doesn’t rank perfectly, you’ll get misleading results.
• It doesn’t measure the linear relationship between variables. It can be used to identify monotonic relationships, but it doesn’t tell you how steep the relationship is.
• This method can only detect a monotonic relationship between two variables, not more complex relationships.
• Like all correlation methods, spearman’s rho does not imply causation. Correlation is simply a measure of association, not causality.