# How To Calculate The Correlation Between Two Variables

The correlation between two variables describes the likelihood that a change in one variable will cause a proportional change in the other variable. A high correlation between two variables suggests they share a common cause or a change in one of the variables is directly responsible for a change in the other variable. Pearson's r value is used to quantify the correlation between two discrete variables.

### Step 1

Label the variable that you believe is causing the change to the other variable as x (the independent variable) and the other variable y (the dependent variable).

### Step 2

Construct a table with five columns and as many rows as there are data points for x and y. Label the columns A through E from left to right.

### Step 3

Fill in each row with the following values for each (x,y) data point in the first column — the value of x in Column A, the value of x squared in Column B, the value of y in Column C, the value of y squared in Column D and the value x times y in Column E.

### Step 4

Make a final row at the very bottom of the table and put the sum of all the values of each column in its corresponding cell.

### Step 5

Compute the product of the final cells in Column A and C.

### Step 6

Multiply the final cell in Column E by the number of data points.

### Step 7

Subtract the value obtained in Step 5 from the value obtained in Step 6 and underline the answer.

### Step 8

Multiply the final cell of Column B by the number of data points. Subtract from this value the square of the value of the final cell of Column A.

### Step 9

Multiply the final cell of Column D by the number of data points and subtract the square of the value of the final cell of Column C.

### Step 10

Multiply the values found in Step 8 and 9 together and then take the square root of the result.

### Step 11

Divide the value obtained in Step 7 (it should be underlined) by the value obtained in Step 10. This is Pearson's r, also known as the correlation coefficient. If r is close to 1, there is a strong positive correlation. If r is close to -1, there is a strong negative correlation. If r is close to 0, there is a weak correlation.

### Cite This Article

#### MLA

Wallulis, Karl. "How To Calculate The Correlation Between Two Variables" *sciencing.com*, https://www.sciencing.com/calculate-correlation-between-two-variables-8197292/. 24 April 2017.

#### APA

Wallulis, Karl. (2017, April 24). How To Calculate The Correlation Between Two Variables. *sciencing.com*. Retrieved from https://www.sciencing.com/calculate-correlation-between-two-variables-8197292/

#### Chicago

Wallulis, Karl. How To Calculate The Correlation Between Two Variables last modified March 24, 2022. https://www.sciencing.com/calculate-correlation-between-two-variables-8197292/