How to explain tie-correction for Spearman's Rank Correlation? In Mathematics at my college we are being taught correlation in which when there are ties in ranks we take average rank for all of the ties and then total correction factor is added summation of square of difference in ranks.
The formula for correction factor is $$\frac{m(m^2 - 1)}{12}.$$

Where did this correction factor formula came from ? How is it derived?

I can't get my mind around it.
 A: I don't think there is an easy explanation. Based on some googling, here is what I can say. The tie-corrected formula for Spearman's $\rho$ is due to Kendall, and was published in his 1955 book Rank Correlation Methods, Second Edition, Revised. This is according to Wilson Taylor, who wrote this article on the topic for the Journal of the American Statistical Association in 1964. Wilson's article doesn't appear to be available online, but maybe you can get it through your library.
According to Taylor, quoting Kendall, inserting the correction terms fits the assumption that “true ties in ranks do not occur, hence observed ties reflect the failure” of assessments to fully discern true differences (especially if the underlying variable is continuous). Another explanation I found noted that $\rho$ can never equal 1 or -1 without the correction, if ties exist. In a footnote, Kendall suggests that with this correction resolves the ties by averaging the uncorrected $\rho$ values over all possible true (without ties) rankings of the underlying variables. (If so, I’m surprised the correction ends up being so simple.)
Note that the entire correction needed is the sum of terms of the form $\frac{m(m^2 - 1)}{12}$, where there is one term for each group of $m$ ties in rank in either $X$ or $Y$. This is added to the sum of squared differences in rank. Your original question has a $2$ in it, not a $12$, but that may be correct in the larger context of how you insert this term into the complete formula for $\rho$, which has a 6 in the numerator.
