Skip main navigation

Pearson’s correlation coefficient

Pearson's correlation coefficient ($$r$$) is used to describe the correlation between two variables with a linear relationship.

Pearson’s correlation coefficient ((r)) is used to describe the correlation between two variables with a linear relationship. (r) varies from -1 to +1, where:

  • -1 represents a strong, negative correlation

  • 0 represents no linear relationship between variables

  • +1 represents a strong positive correlation

The image below shows how (r) varies depending on the relationship.

Calculating r

You can calculate r manually using the following commonly used formula:

[r=frac{nleft(sum xyright)-left(sum xright)left(sum yright)}{sqrt{[nsum x^2 – left(sum xright)^2][nsum y^2 – left(sum yright)^2]}}]

But this can be quite time consuming. Thankfully tools like Excel and Tableau provide functionality to calculate this for us.

Next, you’ll learn about calculating correlations with spreadsheets.

This article is from the free online

SQL for Data Analysis

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now