1

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.

Arya McCarthy
  • 6,390
  • 1
  • 16
  • 47
Adifyr
  • 11
  • 3
  • 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$? – Dave Apr 05 '21 at 18:13
  • @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. – Adifyr Apr 05 '21 at 18:18
  • 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"). – Dave Apr 05 '21 at 18:24
  • What you're observing with the Bessel correction is because your sample size is small, so $n$ and $n-1$ are pretty different. – Dave Apr 05 '21 at 18:26
  • @Dave got it, thanks. I have no idea what Quantile Regression means though. :P. So I'll have to look it up a bit. – Adifyr Apr 05 '21 at 18:28

0 Answers0