Linear Regression & Correlation
Math
From pairs of x and y values, works out the least-squares regression line, the correlation coefficient (r) and the coefficient of determination (R²), and predicts y for a new x.
y = a + b × x
b = Σ((x - x̄)(y - ȳ)) ÷ Σ(x - x̄)², a = ȳ - b × x̄
| |r| | Relationship |
|---|---|
| 0.7 - 1 | Strong |
| 0.4 - 0.7 | Moderate |
| 0 - 0.4 | Weak |
R² shows how much of the variation in y the line explains: R² = 0.81 means 81% of it.
Correlation isn't causation. The line predicts reliably only within the range of your data; extrapolating beyond it can mislead.
Results are for information only. For tax, salary, loan or health decisions, check official sources or ask a professional.