# Pearson Correlation Calculator

Pearson correlation is defined as a way of establishing the relationship between two variables. In other words, the Pearson correlation coefficient formula helps in calculating the correlation coefficient which measures the dependency of one variable on the other variable.

## What is Pearson Correlation Calculator?

'Cuemath's Pearson Correlation Calculator' is an online tool that helps to calculate the value of the correlation coefficient for a given data. Cuemath's online Pearson Correlation Calculator helps you to calculate the value of the correlation coefficient for a given data in a few seconds.

NOTE: The length of data set values of both x and y should be equal.

## How to Use Pearson Correlation Calculator?

Please follow the steps below on how to use the calculator:

**Step 1:**Enter the numbers separated by commas in the given input box.**Step 2:**Click on the**"Calculate"**button to find the value of the correlation coefficient for a given data.**Step 3:**Click on the**"Reset"**button to clear the fields and enter new numbers.

## How to Find Pearson Correlation Calculator?

**Pearson correlation** is measured numerically using the correlation coefficient. The correlation coefficient lies between -1 and 1. This means that any value beyond this range will be the result of an error in correlation measurement.

A positive correlation coefficient indicates that the value of one variable depends on the other variable directly.

A negative correlation coefficient indicates that the relationship between two variables is inverse.

A zero-correlation coefficient indicates that there is no correlation between both variables.

The formula used to calculate the person correlation coefficient is given by:

**\(r = \dfrac{n(\Sigma xy) - (\Sigma x)(\Sigma y) }{\sqrt{[n \Sigma x^2 - (\Sigma x)^2][n\Sigma y^2 - (\Sigma y)^2]}}\)**

Where 'n' is the total number of observation in a particular data set, Σx is the sum of all values of variable x, Σy is the sum of all values of variable y, Σxy is sum of the product of x and y, Σx^{2} is the sum of squares of the variable x, and Σy^{2} is the sum of squares of the variable y.

**Solved Example:**

Find pearson correlation coefficient for given data set x = {4, 8 ,12, 16} and y ={7, 14, 21, 28}

**Solution:**

\(r = \dfrac{n(\Sigma xy) - (\Sigma x)(\Sigma y) }{\sqrt{[n \Sigma x^2 - (\Sigma x)^2][n\Sigma y^2 - (\Sigma y)^2]}}\)

Σx = 4 + 8 + 12 +16 = 40

Σy = 7 + 14 + 21 + 28 = 70

Σx^{2} = 16 + 64 + 144 + 256 = 480

Σy^{2} = 49 + 196 + 441 + 784 = 1470

Σxy = 28 + 112 + 252 + 448 = 840

\(\begin{align*} r &= \frac{ 4\times 840 - (40)(70) }{\sqrt{[4 \times 480 - (40)^2][4 \times 1,470 - (70)^2]}} \\ &= \frac{3,360 - 2,800}{ \sqrt{[1,920 - 1,600][5,880 - 4,900]}} \\ &= \frac{560}{560} \\ &= 1 \end{align*}\)

Therefore, the pearson correlation value for the given data set values is 1

Similarly, you can try the calculator to find the value of the Pearson correlation for the following data sets:

- x = {5, 8, 11, 2, 7, 9} and y = {7, 6, 4, 2, 5, 8}
- x = {15, 10, 1, 12, 2, 19} and y = {4, 16,14, 12,3, 7}