Your Equation

Library / Statistics / STA-06

Statistics

Pearson correlation coefficient

Strength of the straight-line relationship between two variables, from −1 (perfect negative) to +1 (perfect positive).

Ref
STA-06
Rev
v1
Field
Statistics
Result
r

S_xy = Σ(x − x̄)(y − ȳ) is the sum of cross-products, S_xx = Σ(x − x̄)² and S_yy = Σ(y − ȳ)² are the sums of squares about the means. r always lies between −1 and 1. It measures straight-line association only, not cause.

Strength of the straight-line relationship between two variables, from −1 (perfect negative) to +1 (perfect positive). Zero means no linear relationship.

Calculator

Solve for
−300300
11,000
11,000
  • Share of variation explained, r²0.64
  • Regression slope S_xy / S_xx1.2

What drives the result

Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.

Correlation r () current value 0.8
SyySum of squares of yKey driver
0.37912
SxxSum of squares of x
0.2538
SxySum of cross-products
−22
  • The default r = 0.8 means 64 % of the variation in y is explained by a straight-line link to x.
  • r = 0 means no linear relationship, but a strong curved relationship can still exist.
Chart data as tables

Ranked variables

VariableTypical rangeLowest resultHighest resultSwing ()Local stepChange in result
Syy Sum of squares of y1 to 1,000 0.37951211.62+10%−4.65 %
Sxx Sum of squares of x1 to 1,000 0.25387.747+10%−4.65 %
Sxy Sum of cross-products−300 to 300 −224+12 +10 %

Sweep of Sum of cross-products

Sum of cross-productsCorrelation r
−300−2
−225−1.5
−150−1
−75−0.5
00
750.5
1501
2251.5
3002

Sweep one variable

Correlation r ()Hover, touch, or use the arrow keys on the chart
−2−1012 −300−200−1000100200300 Sum of cross-products now 0.8

Variables and how each one contributes

r

Correlation r

Result ·

What the equation gives you. Everything else feeds it.

Sxy

Sum of cross-products

· typical −300 to 300

The sum of the products of the x and y deviations. Directly proportional; its sign gives the sign of the correlation.

Sxx

Sum of squares of x

· typical 1 to 1,000

The sum of squared deviations of x. Inverse square root: more spread in x lowers r for the same S_xy.

Syy

Sum of squares of y

· typical 1 to 1,000

The sum of squared deviations of y. Inverse square root: more spread in y lowers r for the same S_xy.

Worked example with the values above

  1. Product of the sums of squares: 100 × 225 = 22,500; square root 150.
  2. Divide the cross-products: 120 / 150.
  3. r = 0.8.

Assumptions and limits

  • Roughly linear relationship between the variables.
  • Pairs of readings are independent and measured on the same units.

Common mistakes

  • Reading a high r as proof that x causes y.
  • Quoting r for data with outliers, which can create or hide a correlation.

Statistics and uncertainty

r measures linear association only. Test whether it differs from zero with t = r√(n − 2)/√(1 − r²); with small n a high r can still arise by chance, and correlation does not show cause.

Where it is used

  • Checking whether two measured quantities, such as temperature and burn rate, move together.
  • Choosing predictors for a regression line.

Maths you need

  • Mean and deviations: differences from the mean
  • Sums of squares: S_xx and S_yy

Related formulas

Practise this formula