Forum Discussion

anMSuser's avatar
anMSuser
Copper Contributor
Mar 24, 2020

How to calculate Pearson correlation coefficient with 2-property arrays?

I have the following data:

        A         B           C
1               Group 1     Group 2
2   Property 1     56         651
3   Property 2     97       1,380

According to the https://www.mathsisfun.com/data/chi-square-calculator.html at Math Is Fun, these data have a Pearson correlation coefficient ("p") of 0.2463. But when I use Excel's function pearson() on them:

=pearson(B2:B3, C2:C3)

I get the result 1. I found an explanation of why this is happening in a https://stackoverflow.com/a/16064573/5803910 about a calculation in Python. But that answer seems to be saying that there is no way to get a Pearson of other than 1 with just two property values. But that doesn't seem to be correct, since the calculator linked above is doing it. So it may be that for some reason the function pearson() can't do it, but is there another way in Excel, perhaps using VBA?

6 Replies

Resources