**The**

*Spearman*Rho allows to detect a correlation or not between variable.## Introduction

Called *Spearman rank correlation coefficient*, rated ρ, it is a non-parametric correlation measure. It is used to determine a relationship between two sets of data. It is used for quantitative or ordinal data.

It was Charles Spearman, an English psychologist, who developed it in 1904 as part of a study on parameters for improving performance on various intellectual tasks.

## The principle

Basically, the coefficient of Spearman is a special case of the Pearson coefficient. For each value of our 2 variables, it is assigned a rank. We then calculate the difference of the ranks between the rows of the same value pair. Then we carry out the ratio with our number of value pairs.

## Step 1: Assumptions

Spearman Rho is a bilateral or unilateral test. The assumptions are:

**For a bilateral case:**

**H0:**The X and y are mutually independent, there is no correlation.**H1:**The X and Y are dependent, there is a correlation.

**For a right-sided case:**

**H0:**The X and y are mutually independent, there is no correlation.**H1:**The X and Y are dependent, there is a positive correlation.

**For a left unilateral case:**

**H0:**The X and y are mutually independent, there is no correlation.**H1:**The X and Y are dependent, there is a negative correlation.

## Step 2: Identify the ranks

For each of the 2 sets of values one determines their respective rank in its series. Thus, the smallest figure in the series will have the rank of 1 up to the highest value which will then have the highest rank.

## Step 3: Take into account the Ex-Aequo

In some cases there are several identical values and therefore have the same rank. For her, we take the average rank to which she should be. For example :

- If two values are equal and should be ranked 4 and 5, then they will be given the rank of 4.5, the lower value of 3 and the higher the value of 6.
- If 3 values are equal and should be ranked 4, 5 and 6, then they will be given the rank of 5.

## Step 4: Calculate our variances

In principle, the Rho de Spearman consists in comparing the difference between the ranks. For each pair, we calculate this difference:

**D ^{2} = (rank X1 – rank X2)^{2}**

## Step 5: Calculation of the Rho of Spearman

Finally, the value of the Rho of Spearman is calculated. We find two versions depending on whether we have a tie or not. As well:

In case there is no duplicate

**n:** Sample size

**ΣD ^{2}**

**:**Sum of square differences

**The more the Rho tends towards 1 or-1, the more there is a correlation. We consider that between 0.7 and 1 we have a positive correlation. Between-0.7 and-1, we have a negative correlation.**

## Step 6: Calculating the practical value

Calculating the practical value depends on the number of pairs of values we have. As well:

## Step 7: Calculating the critical value

The critical value also depends on the number of pairs of values:

**n****≤ 10:**We will use the exact table of Spearman**10 < n****≤ 30:**We will use**Student’s law**for N-2 dof**n > 30:**We’ll use the**normal law**

## Step 8: Calculating the P-Value

The **P-Value** also depends on the number of pairs of variables we have:

**n****≤ 10:**It is not possible to calculate a P-Value, having enough data to be sufficiently robust**10 < n****≤ 30:**P-Value follows a law of student at 2 degrees of freedom**n > 30:**P-Value follows a normal law

## Step 9: Interpretation

Test direction | Result | Statistical conclusion | Practical conclusion |
---|---|---|---|

Bilateral | Practical value ≤ Critical value and Practical value ≥ - Critical value | We retain H0 | There is no correlation between the 2 samples |

Practical value ≥ Critical value and Practical value ≤ - Critical value | We reject H0 | There is a correlation between the 2 samples | |

Unilateral right | Practical value ≤ Critical value | We retain H0 | There is no positive correlation |

Practical value ≥ Critical value | We reject H0 | There is a positive correlation between the 2 samples | |

Unilateral left | Practical value ≥ Critical value | We retain H0 | There is no negative correlation |

Practical value ≤ Critical value | We reject H0 | There is a negative correlation between the 2 samples |

Result | Statistical conclusion | Practical conclusion |
---|---|---|

p-value > α | We retain H0 | We conclude that our 2 series of data have no correlation with a risk of being wrong with p-value% |

p-Value < α | We reject H0 | Our 2 data series have a correlation with a risk of being wrong with p-value% |