Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Statistics formulas

Pearson correlation

Measure strength and direction of a linear sample relationship.

Statistics · Association
$$r=\frac{\sum(x_i-\bar x)(y_i-\bar y)}{\sqrt{\sum(x_i-\bar x)^2\sum(y_i-\bar y)^2}}$$

Pearson correlation is one of 2 association formulas in the statistics section of this library, and it is used at ap · university level.

Why pearson correlation works

The numerator is the covariance and the denominator rescales it by the spread of each variable, which cancels both sets of units. What is left is the average product of standardised deviations, and that quantity is mathematically trapped between -1 and 1, with the ends reached only by a perfect straight line.

What each symbol means

$r$ is unitless and lies between $-1$ and $1$.

Pearson correlation: when it holds

Both variables must vary; correlation does not establish causation and describes linear association.

When it stops applying

It measures straight-line association only, so a high value does not confirm a line is the right model. For x values 1 through 5 paired with their squares, the correlation is about 0.981 even though the true relationship is visibly curved. Always look at the scatterplot before trusting the number.

Pearson correlation: a worked example

$r$ near $1$ indicates a strong positive linear association.

The mistake to avoid

What people do: Treating a strong correlation as evidence that one variable causes the other.

Why it goes wrong: Two variables can move together because a third one drives both, or by pure coincidence in a small sample. Correlation orders the association; it says nothing about the direction of any influence.

Do this instead: Ask what else could explain the pattern, and remember that only a controlled experiment with randomised assignment supports a causal claim.

Pearson correlation: step by step

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $r$ is unitless and lies between $-1$ and $1$.
  3. Check the conditions before substituting. Both variables must vary; correlation does not establish causation and describes linear association.
  4. Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most statistics slips.

Where this formula fits

Subject
Statistics formulas — 21 entries in this library
Topic
Association
Level
AP · University

Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where pearson correlation comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.

Questions about pearson correlation

What does r squared add that r does not?

It converts the association into a share of variation accounted for. A correlation of 0.8 sounds like most of the story but corresponds to 0.64, meaning 64 percent of the variation in y is explained.

Does swapping which variable is x change the value?

No, the formula is symmetric in the two variables. That is a clue that correlation cannot indicate direction of cause, since it cannot even tell the two roles apart.

How strong does r have to be to matter?

It depends entirely on the field. In physics 0.9 might signal a problem with the equipment, while in social research 0.3 can be a genuinely important finding worth reporting.

Can r be exactly 1 for data that is not a straight line?

No. The value 1 is achieved only when every point sits exactly on a rising line, which is why an exact 1 in real data usually means one variable was computed from the other.

Stuck on a problem?

Work a pearson correlation problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.