Statistics & graphs · SL/HL
Linear Regression, r & R² Calculator
Paste matching x and y values. Ordinary least squares treats x as the predictor.
Your values
Start with the example or enter your own values. Use a dot for decimals and e for scientific notation.
Calculated locally. No account or input upload.
Result & working
ExampleThe calculator is loading. The worked example is also shown below.
Step-by-step working
The formula
slope m = Sxy/Sxx
intercept c = ȳ − mx̄
r = Sxy/√(SxxSyy)
R² = 1 − SSE/SST
| Symbol | Meaning |
|---|---|
| r | Pearson correlation coefficient, from −1 to +1. |
| R² | Coefficient of determination for the fitted trend. |
When to use this calculator
Correlation describes association; it does not by itself demonstrate causation. Inspect the graph and biological context.
Worked example
The page opens with these example values. The result below is pre-generated for reference.
- OLS fit: y = 2.01x + 0.05
- Pearson r = 0.9986784
- R² = 0.9973585
y = 2.01x + 0.05
Common mistakes
- A high R² does not prove the chosen model is biologically correct.
- Do not use linear regression blindly on strongly curved relationships.