Pearson Correlation Calculator (2024)

This Pearson correlation calculator helps you determine Pearson's r for any given two variable dataset. Below, we explain what Pearson correlation is, give you the mathematical formula, and teach how to calculate the Pearson correlation by hand. You can also discover the link between Pearson's r and linear regression, as well as finally understanding what that common saying, "correlation does not equal causation", means.

Interested in other correlation coefficients? Visit Omni's Spearman's rank correlation calculator!

What is the Pearson correlation coefficient?

The Pearson correlation measures the strength and direction of the linear relation between two random variables, or bivariate data. Linearity means that one variable changes by the same amount whenever the other variable changes by 1 unit, no matter whether it changes e.g., from 111 to 222, or from 111111 to 121212.

A simple real-life example is the relationship between parent's height and their offspring's height - the taller people are, the taller their children tend to be.

The Pearson correlation coefficient is most often denoted by r (and so this coefficient is also referred to as Pearson's r).

Interpretation of the Pearson correlation

  • The sign of the Pearson correlation gives the direction of the relationship:

    • If r is positive, it means that as one variable increases, the other tends to increase as well; and
    • If r is negative, then one variable tends to decrease as the other increases.
  • The absolute value gives the strength of the relationship:

    • Pearson's r ranges from 1-11 to +1+1+1;
    • The closer it is to ±1\pm 1±1, the stronger the relationship between the variables;
    • If r equals 1-11 or +1+1+1, then the linear fit is perfect: all data points lie on one line; and
    • If r equal 000, it means that no linear relationship is present in the data.
Pearson Correlation Calculator (1)

Remember that Pearson correlation detects only a linear relationship! For coefficients that can detect other types of relationship, see our correlation calculator.

This means that a low (or even null) correlation doesn't mean that there is no relationship at all! Take a look at the eight data sets below: they all have a Pearson correlation coefficient equal to zero.

Pearson Correlation Calculator (2)

How to use this Pearson correlation calculator

Just input your data into the rows. When at least three points (both an x and y coordinate) are in place, our Pearson correlation calculator will give you your result, along with an interpretation.

The verbal description of the strength of correlation returned in this calculator employs Evan's scale (1996) for the absolute value of r:

  • 0.8r1.00.8 \le |r| \le 1.00.8r1.0 very strong

  • 0.6r<0.80.6 \le |r| \lt 0.80.6r<0.8 strong

  • 0.4r<0.60.4 \le |r| \lt 0.60.4r<0.6 moderate

  • 0.2r<0.40.2 \le |r| \lt 0.40.2r<0.4 weak

  • 0.0r<0.20.0 \le |r| \lt 0.20.0r<0.2 very weak

You may encounter many other guidelines for the interpretation of the Pearson correlation coefficient. Bear in mind that all such descriptions and interpretations are arbitrary and depend on context.

Pearson correlation formula and properties

It is high time we gave the mathematical formula for the Pearson correlation. Formally, Pearson's r is defined as the covariance of two variables divided by the product of their respective standard deviations. This translates into the following formula:

rxy ⁣= ⁣i=1n(xixˉ)(yiyˉ) ⁣ ⁣i=1n ⁣(xi ⁣ ⁣xˉ)2 ⁣i=1n ⁣(yi ⁣ ⁣yˉ)2\smallr_{xy} \! = \! \frac{\sum_{i=1}^n (x_i - \bar x) (y_i - \bar y)}{\!\! \sqrt{\sum_{i=1}^n \! (x_i \! - \! \bar x)^2} \! \sqrt{\sum_{i=1}^n \! (y_i \! - \! \bar y)^2}}rxy=i=1n(xixˉ)2i=1n(yiyˉ)2i=1n(xixˉ)(yiyˉ)

which can be further rewritten as:

rxy=xiyinxˉyˉxi2nxˉ2yi2nyˉ2\smallr_{xy} = \frac{\sum x_i y_i - n \bar x \bar y}{\sqrt{\sum x_i ^2 - n \bar x^2} \sqrt{\sum y_i ^2 - n \bar y^2}}rxy=xi2nxˉ2yi2nyˉ2xiyinxˉyˉ

  1. It can be proven (via the Cauchy–Schwarz inequality) that the absolute value of the correlation coefficient never exceeds 111.

  2. Note that the correlation is symmetric, i.e., the correlation between XXX and YYY is the same as between YYY and XXX.

  3. Correlation vs. independence. If the variables are independent, their correlation is 000, but, in general, the converse is not true! There is, however, a special case: when XXX and YYY are jointly normal (i.e., the random vector (X,Y)(X, Y)(X,Y) follows a bivariate normal distribution) and uncorrelated, then independence follows.

Since we have mentioned covariance, you can visit the covariance calculator for more insights regarding this statistical quantity.

How to calculate Pearson correlation by hand

In case you wanted to better understand how the Pearson correlation formula works, we have prepared a way for you to compute Pearson's r by hand. Suppose we have the data set:

(1,1),(3,2),(3,3),(5,4)(1, 1), (3, 2), (3, 3), (5, 4)(1,1),(3,2),(3,3),(5,4),

so the x-values are 1,3,3,51, 3, 3, 51,3,3,5, and the respective y-values are 1,2,3,41, 2, 3, 41,2,3,4.

  1. Count how many points there are: 444
  2. Calculate the mean (arithmetic average) of the xxx and yyy values with our average calculator or manually:

xˉ=(1+3+3+5)/4=12/4=3\begin{split}\bar x =& (1 + 3 + 3 + 5)/4 = \\[0.5em]&12 / 4 = 3\end{split}xˉ=(1+3+3+5)/4=12/4=3

yˉ=(1+2+3+4)/4=10/4=2.5\begin{split}\bar y =& (1 + 2 + 3 + 4)/4 = \\[0.5em] &10 / 4 = 2.5\end{split}yˉ=(1+2+3+4)/4=10/4=2.5

  1. Calculate the sums of the squares of xxx and yyy, and their dot-products:

xi2=12+32+32+52=44\sum x_i^2 = 1^2 + 3^2 + 3^2 + 5^2 = 44xi2=12+32+32+52=44

yi2=12+22+32+42=30\sum y_i^2 = 1^2 + 2^2 + 3^2 + 4^2 = 30yi2=12+22+32+42=30

xiyi=1×1+3×2+3×3+5×4=36\begin{split}\sum x_i y_i &= 1 \times 1 + 3 \times 2 \\[0.5em]&+ 3 \times 3 + 5 \times 4 = 36\end{split}xiyi=1×1+3×2+3×3+5×4=36

  1. We have all the values needed to apply the formula:

rxy=xiyinxˉyˉxi2nxˉ2yi2nyˉ2\smallr_{xy} = \frac{\sum x_i y_i - n \bar x \bar y}{\sqrt{\sum x_i ^2 - n \bar x^2} \sqrt{\sum y_i ^2 - n \bar y^2}}rxy=xi2nxˉ2yi2nyˉ2xiyinxˉyˉ

numerator=xiyinxˉyˉ=36 ⁣ ⁣4 ⁣× ⁣3 ⁣×2.5 ⁣= ⁣6\begin{split}\mathrm{numerator} = & \sum x_i y_i - n \bar x \bar y = \\[0.5em]& 36 \! - \! 4 \! \times \! 3 \! \times 2.5 \! = \! 6 \\[0.5em]\end{split}numerator=xiyinxˉyˉ=364×3×2.5=6

denominator=8×5=406.32\begin{split}\mathrm{denominator} =& \sqrt 8 \times \sqrt 5 = \\[0.5em]&\sqrt 40 \approx 6.32\end{split}denominator=8×5=406.32

because

xi2nxˉ2=444×32=8\sum x_i ^2 - n \bar x^2 \\[0.5em]\quad = 44 - 4 \times 3^2 = 8xi2nxˉ2=444×32=8

and

yi2nyˉ2=304×2.52=5\sum y_i ^2 - n \bar y^2 \\[0.5em]\quad = 30 - 4 \times 2.5^2 = 5yi2nyˉ2=304×2.52=5

  1. Finally, we can compute the value of the Pearson correlation coefficient:

r=66.320.95r = \frac{6}{6.32} \approx 0.95r=6.3260.95

Pearson's r and R-squared in simple linear regression

In simple linear regression (YaX+bY \sim aX + bYaX+b), the Pearson correlation is directly linked to the coefficient of determination (R-squared), which expresses the fraction of the variance in YYY that is explained by XXX:

  1. The R-squared can be calculated by simply squaring the Pearson correlation coefficient.

  2. The slope aaa of the fitted regression line can be found, as the Pearson correlation between YYY and XXX multiplied by the ratio of their respective standard deviations gives the gradient: a=r(sy/sx)a = r (s_y / s_x)a=r(sy/sx).

If you want to perform linear regression on your data, check the least squares regression line calculator to find the best fit of aaa and bbb parameters.

"Correlation does not equal causation"

Always remember that even a very strong correlation between two variables does not mean there's a causal link between the variables. It could be random chance, or there may be some other intervening variable that affects both your variables.

For example, the demand for sunglasses is strongly positively correlated with the rate of people drowning. This does not mean that sunglasses force anybody underwater! Instead, we rather suspect that hot weather causes both of these variables to increase.

Click here to read about other mind-blowing examples of crazy correlations.

Pearson Correlation Calculator (2024)
Top Articles
Spider-Man: No Way Home — The 10 Best Superhero Tropes In The Movie
10 Most Enjoyable Movie Tropes And Cliches
Worcester Weather Underground
Www.1Tamilmv.cafe
Urist Mcenforcer
Form V/Legends
Chelsea player who left on a free is now worth more than Palmer & Caicedo
Optimal Perks Rs3
Www.megaredrewards.com
Gameday Red Sox
How to Watch Braves vs. Dodgers: TV Channel & Live Stream - September 15
Missing 2023 Showtimes Near Landmark Cinemas Peoria
Little Rock Arkansas Craigslist
Enderal:Ausrüstung – Sureai
Fredericksburg Free Lance Star Obituaries
Google Feud Unblocked 6969
Daily Voice Tarrytown
12 Top-Rated Things to Do in Muskegon, MI
Jenna Ortega’s Height, Age, Net Worth & Biography
Rochester Ny Missed Connections
The Many Faces of the Craigslist Killer
Rapv Springfield Ma
Penn State Service Management
Southtown 101 Menu
Wells Fargo Bank Florida Locations
Smayperu
3 Bedroom 1 Bath House For Sale
Grandstand 13 Fenway
47 Orchid Varieties: Different Types of Orchids (With Pictures)
Gerber Federal Credit
How to Get Into UCLA: Admissions Stats + Tips
404-459-1280
Telegram update adds quote formatting and new linking options
Wsbtv Fish And Game Report
Aliciabibs
Mohave County Jobs Craigslist
Low Tide In Twilight Manga Chapter 53
Suffix With Pent Crossword Clue
Directions To Cvs Pharmacy
[Teen Titans] Starfire In Heat - Chapter 1 - Umbrelloid - Teen Titans
Embry Riddle Prescott Academic Calendar
N33.Ultipro
Lebron James Name Soundalikes
Erica Mena Net Worth Forbes
1990 cold case: Who killed Cheryl Henry and Andy Atkinson on Lovers Lane in west Houston?
Pulpo Yonke Houston Tx
Sdn Dds
Access One Ummc
How to Find Mugshots: 11 Steps (with Pictures) - wikiHow
Land of Samurai: One Piece’s Wano Kuni Arc Explained
Texas Lottery Daily 4 Winning Numbers
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 5373

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.