Correlation Coefficient Formula

The correlation coefficient (Pearson's r) is a number between −1 and 1 that measures both the strength and direction of the linear relationship between two quantitative variables.

The Formula

r=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2∑(yi−yˉ)2

Ask yourself: Do you need one signed, unitless number between −1 and 1 for how tightly paired data follow a straight line?

Quick example

Height and weight: r ≈ 0.7, a moderate positive correlation — taller people tend to weigh more.

What this formula means

The correlation coefficient (Pearson's r) is a number between −1 and 1 that measures both the strength and direction of the linear relationship between two quantitative variables. A value of 1 indicates a perfect positive linear relationship, −1 a perfect negative linear relationship, and 0 no linear relationship at all.

The correlation coefficient scores how well a crowd keeps to a single file: ±1 means everyone stands exactly on one straight line, 0 means no line at all, and the sign says whether the file runs uphill or downhill. A crowd standing in a perfect circle scores 0, even though it is very orderly.

Formal view

For paired observations (xi,yi), Pearson's correlation coefficient is r=∑i=1n(xi−xˉ)(yi−yˉ)∑i=1n(xi−xˉ)2⋅∑i=1n(yi−yˉ)2, where r∈[−1,1].

Worked examples

Example 1

medium
Given r=0.6, compute R2 and interpret it.
Show solution

Answer

R2=0.36, 36% of variance explained

First step

1.
R2=r2=0.36.

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Free: full solutions on 3 topics a day. No card.

Every topic, every day: the Family plan

Example 2

medium
Five points: (1,2),(2,4),(3,6),(4,8),(5,10). Compute r without a formula.

Example 3

medium
Given R2=0.49 and a positive scatterplot slope, find r.

Common mistakes

  • Assuming r measures nonlinear relationships
  • Confusing correlation with causation
  • Ignoring outliers that inflate or deflate r

Why this formula matters

With r, strength becomes comparable across studies: sleep and quiz scores at r=0.77 are more closely linked than apps installed and hours online at r=0.14. It also unlocks regression, since the least-squares slope equals rsysx and r2 is the share of variation a line explains. Read without a plot, though, r can be inflated by one outlier or miss a strong curve.

Frequently asked questions

What is the Correlation Coefficient formula?

The correlation coefficient (Pearson's r) is a number between −1 and 1 that measures both the strength and direction of the linear relationship between two quantitative variables. A value of 1 indicates a perfect positive linear relationship, −1 a perfect negative linear relationship, and 0 no linear relationship at all.

How do you use the Correlation Coefficient formula?

Compute r when both variables are quantitative, the scatter plot is roughly linear, and the question asks how strong the relationship is or wants one number for direction and strength. Look at the plot first: if it curves, r understates the relationship; if one point sits far from the rest, report r with and without it. For predictions, use the regression line; for the share of variation explained, use r2; for categorical variables, use a two-way table.

Why is the Correlation Coefficient formula important in Statistics?

With r, strength becomes comparable across studies: sleep and quiz scores at r=0.77 are more closely linked than apps installed and hours online at r=0.14. It also unlocks regression, since the least-squares slope equals rsysx and r2 is the share of variation a line explains. Read without a plot, though, r can be inflated by one outlier or miss a strong curve.

What do students get wrong about Correlation Coefficient?

Students often know a procedure related to correlation coefficient but skip the recognition step: Do you need one signed, unitless number between −1 and 1 for how tightly paired data follow a straight line? That leads to a calculation or graph that looks reasonable but answers a different question.

What should I learn before the Correlation Coefficient formula?

Before studying the Correlation Coefficient formula, you should understand: correlation intro, line of best fit.