Spearman Rank Correlation Calculator

Calculate Spearman Rank Correlation



Formula

To calculate the Spearman Rank Correlation:

\[ \rho = 1 - \frac{6 \sum d^2}{n(n^2 - 1)} \]

Where:

What is Spearman Rank Correlation?

Spearman Rank Correlation, also known as Spearman’s rho, is a non-parametric measure of statistical dependence between two variables. It assesses how well the relationship between two variables can be described using a monotonic function. In simpler terms, it measures the strength and direction of the association between two ranked variables. It is often used when the assumptions of Pearson’s correlation coefficient are not met, such as when data is not normally distributed or when there are outliers.

Example Calculation 1

Let's assume the following ranks:

Using the formula:

Calculate the differences and the squares of the differences:

Sum of the squares of the differences: \(16 + 16 + 16 + 16 + 4 = 68\)

Number of observations \(n = 5\)

Spearman Rank Correlation \(\rho\):

\[ \rho = 1 - \frac{6 \times 68}{5(5^2 - 1)} = 1 - \frac{408}{120} = 1 - 3.4 = -2.4 \]

The Spearman Rank Correlation is -2.4 (Note: Typically, the correlation coefficient ranges between -1 and 1; this example indicates a potential mistake in input ranks or calculation).

Example Calculation 2

Let's assume the following ranks:

Using the formula:

Calculate the differences and the squares of the differences:

Sum of the squares of the differences: \(4 + 0 + 4 = 8\)

Number of observations \(n = 3\)

Spearman Rank Correlation \(\rho\):

\[ \rho = 1 - \frac{6 \times 8}{3(3^2 - 1)} = 1 - \frac{48}{24} = 1 - 2 = -1 \]

The Spearman Rank Correlation is -1, indicating a perfect negative correlation.