## What is the Pearson Correlation Coefficient Formula?

The relationship between the two variables is measured with the help of the correlation coefficient and Pearson’s correlation coefficient is one of the correlation coefficients used in linear regression. The formula for Pearson’s correlation coefficient is:

Where r is the Pearson correlation coefficient,

- n is a number of pairs of variables,
- ∑xy is the sum of the product of variables,
- ∑x is the sum of values of x variable,
- ∑y is the sum of values of y variable,
- ∑x
^{2}is the sum of squares of values of the x variable - ∑y
^{2}is the sum of squares of values of the y variable

### Explanation

**Step 1:** Find out the number of pairs of variables, which is denoted by n. Let us presume x consists of 3 variables – 6, 8, 10. Let us presume that y consists of corresponding 3 variables 12, 10, 20.

**Step 2:** List down the variables in two columns.

**Step 3: **Find out the product of x and y in the 3^{rd} column.

**Step 4:** Find out the sum of values of all x variables and all y variables. Write the results at the bottom of 1^{st} and 2^{nd} column. Write the sum of x*y in the 3^{rd} column.

**Step 5:** Find out x^{2 }and y^{2 }in the 4^{th} and 5^{th} columns and their sum at the bottom of the columns.

**Step 6:** Insert the values found above in the formula and solve it.

r = 3*352-24*42/√(3*200-24^{2})*(3*644-42^{2})

= 0.7559

### Examples of the Pearson Correlation Coefficient Formula

Given below are the examples for the calculation of the Pearson Correlation Coefficient formula.

#### Example #1

**The values for x and y variable are as under. Calculate the Pearson correlation coefficient.**

**Solution:**

First, we will calculate the following values.

The calculation of pearson’s correlation coefficient is as follows,

- r = (4*2407)-(65*169)/((4*1193-(65)^2)*(4*8095-(169)^2))^0.5
- = -0.9389

Therefore, Pearson correlation coefficient is -0.93888.

#### Example #2

**Miss Smith, a teacher was explaining the concepts of height and weight to her students. She wanted to explain that in general, when the height increases, weight also increases. She decided to use Pearson’s correlation coefficient to explain this relation. She decided to obtain the height and weight of 6 students in her class, which are as under:**

**Calculate the Pearson correlation coefficient with the help of the above data.**

**Solution:**

First, we will calculate the following values.

The calculation of pearson’s correlation coefficient is as follows,

- r = (6*17206-321*317)/((6*17323-(321)^2)*(6*17183-(317)^2))^0.5
**=**0.9668

Therefore Pearson correlation coefficient between height and weight is 0.9668.

#### Example #3

**There are 2 stocks – A and B. Their share prices on particular days are as follows:**

**Find out the Pearson correlation coefficient from the above data.**

**Solution:**

First, we will calculate the following values.

The calculation of the Pearson correlation coefficient is as follows,

- r =
- = -0.9088

Therefore the Pearson correlation coefficient between the two stocks is -0.9088.

### Relevance and Use

Pearson’s correlation coefficient returns a value between -1 and 1. The interpretation of the correlation coefficient is as under:

- If the correlation coefficient is -1, it indicates a strong negative relationship. It implies a perfect negative relationship between the variables.
- If the correlation coefficient is 0, it indicates no relationship.
- If the correlation coefficient is 1, it indicates a strong positive relationship. It implies a perfect positive relationship between the variables.

A higher absolute value of the correlation coefficient indicates a stronger relationship between variables. Thus, a correlation coefficient of 0.78 indicates a stronger positive correlation as compared to a value of say 0.36. Similarly, a correlation coefficient of -0.87 indicates a stronger negative correlation as compared to a correlation coefficient of say -0.40.

Correlation allows a researcher to see whether there is a relationship between variables. When the value of one variable increases and the value of the other variable also increases, the correlation is said to be positive. When the value of one variable increases and the other decreases, the correlation is said to be negative.

The underlying assumption in correlation is that the relationship between variables is linear. Another assumption is that the variables are independent. There is a difference between correlation and causation. Thus, a correlation between variables x and y does not imply that x caused y. When there are small samples, the correlation may not be a reliable measure. Similarly, outliers can have a significant impact on the computation of correlation.

### Pearson Correlation Coefficient Formula in Excel

A teacher wanted to find out if there was any relation between the number of hours of TV watched per day and the GMAT score. He gets the data of 6 students.

**Solution: **There is an inbuilt formula in excel for finding out the correlation between a set of two variables. The formula is =CORREL(array 1, array 2).

Insert the excel formula =CORREL(B2:B7, C2:C7) in cell C9.

So we got the result as,

The Pearson correlation coefficient is -0.9022.

### Recommended Articles

This has been a guide to the Pearson Correlation Coefficient Formula. Here we discuss the formula for the calculation of pearson correlation coefficient along with the examples. You can learn more from the following articles –

- Formula of EBITDA Margin
- What is Gross Margin Formula?
- Formula of Correlation
- Compare – Correlation vs Covariance
- Examples of Correlation
- Create a Correlation Matrix in Excel

- 16 Courses
- 15+ Projects
- 90+ Hours
- Full Lifetime Access
- Certificate of Completion