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
- 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.
- 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
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| Syy Sum of squares of y | 1 to 1,000 | 0.3795 | 12 | 11.62 | +10% | −4.65 % |
| Sxx Sum of squares of x | 1 to 1,000 | 0.253 | 8 | 7.747 | +10% | −4.65 % |
| Sxy Sum of cross-products | −300 to 300 | −2 | 2 | 4 | +12 | +10 % |
Sweep of Sum of cross-products
| Sum of cross-products | Correlation r |
|---|---|
| −300 | −2 |
| −225 | −1.5 |
| −150 | −1 |
| −75 | −0.5 |
| 0 | 0 |
| 75 | 0.5 |
| 150 | 1 |
| 225 | 1.5 |
| 300 | 2 |
Sweep one variable
Variables and how each one contributes
Correlation r
What the equation gives you. Everything else feeds it.
Sum of cross-products
The sum of the products of the x and y deviations. Directly proportional; its sign gives the sign of the correlation.
Sum of squares of x
The sum of squared deviations of x. Inverse square root: more spread in x lowers r for the same S_xy.
Sum of squares of y
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
- Product of the sums of squares: 100 × 225 = 22,500; square root 150.
- Divide the cross-products: 120 / 150.
- 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