Pearson Correlation Coefficient

The Pearson correlation coefficient is a measure of the linear correlation between two variables X and Y, giving a value between +1 and -1, inclusive,

where

The formula for Pearson correlation coefficient is:

where

The Pearson correlation coefficient can be expressed as:

where

or


Example

X: (1 2 3 4 6 7 9)
Y: (4 5 6 5 6 7 9)

We can organize the data set in the form of table:

No XY
114
225
336
445
566
677
799
Sum3242

From this table, we can find the sample mean:

Here is another table:

No X2Y2XY
11164
242510
393618
4162520
5363636
6494949
7818181
Sum196268218

From this table we can find SS values:

Therefore, the Pearson correlation coefficient will be:

From this we can find coefficient of determination (r2):