I am trying to calculate Pearson's Correlation Coefficient using the product of the Mean Absolute Deviations (MADs) of my two lists as denominators instead of the Standard Deviations. Effectively, here's the formula I'm currently using:

$$\frac{ \sum_{i=1}^n \left(x_i - \overline{x}\right) \left(y_i - \overline{y}\right) }{ \left(\sum_{i=1}^n |x_i - \overline{x}|\right) \left(\sum_{i=1}^n |y_i - \overline{y}|\right) }$$

List 1: [1532, 1488, 1343, 928, 615] List 2: [58, 35, 75, 41, 17]

  • My Covariance is correct, it comes to: 5803.2000.
  • However, my Correlation Coefficient comes to 1.0390632788677392.

As you can see, it's greater than 1, which shouldn't be the case. I'd like to know what changes should I make to my formula to get the correct Correlation Coefficient using MAD. Thank you.

  • $\begingroup$ Interesting question, so +1, but why shouldn't it be $1$, just because the usual correlation shouldn't exceed a magnitude of $1$? That fact comes from the way covariance relates to the standard deviations of the marginal variables, so there is no reason to believe that it would be true when $MAD$ is in the denominator. // Could this be an $XY$ problem where you have problem $X$ and think you can solve it with $Y$ ($MAD$ in the denominator), so you ask about $Y$ instead of $X$? $\endgroup$
    – Dave
    Apr 5, 2021 at 18:13
  • $\begingroup$ @Dave yes, probably. But, I'd like to stick with it. I already know how to calculate Pearson's Correlation Coefficient using SD. I would really like to explore if I could find a reliable formula for calculating correlation using Mean Absolute Deviation. I'm no statistician, so would like some help. $\endgroup$
    – Adifyr
    Apr 5, 2021 at 18:18
  • $\begingroup$ Koenker gives a variant of $R^2$ for quantile regression that might get you part of the way there. I don't know which of his papers gives it, but it's probably his first paper on quantile regression (title along the lines of "Regression quantiles"). $\endgroup$
    – Dave
    Apr 5, 2021 at 18:24
  • $\begingroup$ What you're observing with the Bessel correction is because your sample size is small, so $n$ and $n-1$ are pretty different. $\endgroup$
    – Dave
    Apr 5, 2021 at 18:26
  • $\begingroup$ @Dave got it, thanks. I have no idea what Quantile Regression means though. :P. So I'll have to look it up a bit. $\endgroup$
    – Adifyr
    Apr 5, 2021 at 18:28


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.