This is a test for correlation between a sequence of pairs of values. Using ranks eliminates the sensitivity of the correlation test to the function linking the pairs of values. In particular, the standard correlation test is used to find linear relations between test pairs, but the rank correlation test is not restricted in this way.
Given pairs of observations, , the values are assigned a rank value and, separately, the values are assigned a rank. For each pair , the corresponding difference, between the and ranks is found. The value is: