# Video: MATH-STATS-2018-S1-Q11

A set of data involving two variables, π₯ and π¦, has been collected. The π₯-values are ranked according to their values; the smallest value is rank 1, the next smallest value is rank 2, and so on. The π¦-values are ranked in the same way. π· is the difference between the ranks of π₯ and π¦ within each pair of variables (π₯, π¦). Given that βπ·Β² = 0, find the correlation coefficient π between π₯ and π¦.

02:39

### Video Transcript

A set of data involving two variables, π₯ and π¦, has been collected. The π₯-values are ranked according to their values. The smallest value is rank one, the next smallest value is rank two, and so on. The π¦-values are ranked in the same way. π· is the difference between the ranks of π₯ and π¦ within each pair of variables π₯, π¦. Given that the sum of π· squared equals zero, find the correlation coefficient π between π₯ and π¦.

As the data that weβre looking to calculate the correlation between has been ranked, this means that the correlation coefficient we need to use is the Spearmanβs rank correlation coefficient. The formula for calculating this is one minus six multiplied by the sum of π· squared over π multiplied by π squared minus one, where π represents the number of pairs of data that we have. Do be careful with this. A common mistake is to think that the whole of the expression is over that denominator of π multiplied by π squared minus one; it isnβt. The one is not part of the fraction.

Now, you may be wondering how weβre supposed to calculate this, as we havenβt been given the value of π in the question. But letβs look at what we have been given. Weβve been told that the sum of π· squared is equal to zero. This means that we have a zero in the numerator of the fraction. Six multiplied by zero is still zero. And dividing zero by a number is also still zero. So, in fact, we didnβt need to know the value of π at all. Our calculation of the correlation coefficient is one minus zero, which is equal to one.

Now, letβs just briefly think about why this is the case? If the sum of π· squared is equal to zero, then this means that each of the individual π·-squared values must also be equal to zero. As π· squared, a square value, is nonnegative. So to sum to zero, all the individual values must be zero. Taking the square root of each side of this equation means that π· must also be equal to zero. π· is the difference between the ranks of π₯ and π¦ within each pair of variables. So if each individual difference is equal to zero, then this means that each pair of π₯, π¦ values has the same rank as each other.

This means that there is perfect positive rank correlation between π₯ and π¦. And this is reflected by the Spearmanβs rank correlation coefficient value of one, which is the greatest value that the Spearmanβs rank correlation coefficient can take.