Statistics & graphs · SL/HL
Regression, r & R²
Fit a straight line to paired measurements.
Your values
Number formats & units
Use decimal dots in datasets. Single values also accept decimal commas and scientific notation such as 1.2e-3 or 1.2 × 10⁻³.
Calculated locally. No account or input upload.
Result & working
ExampleThe calculator is loading. The worked example is also shown below.
Download results
Excel and CSV files can be imported into Google Sheets.
More results
Show calculation steps
Interpretation & assumptions
Copy & export
Formula & example
The relationship
What the variables mean
| Symbol | Meaning |
|---|---|
| Pearson correlation coefficient, from −1 to +1. | |
| Coefficient of determination for the fitted trend. |
Worked example
- X data
- 1 2 3 4 5
- Y data
- 2.1 4.2 5.8 8.1 10.2
- X-axis label
- Independent variable
- Y-axis label
- Dependent variable
y = 2.01x + 0.05
Follow the example steps
- OLS fit: y = 2.01x + 0.05
- Pearson r = 0.9986784
- R² = 0.9973585
Common mistakes
Keep each x paired with the y measured with it.
Incorrect approach
Original pairs (1, 5), (2, 3): sort y alone to get (1, 3), (2, 5).
Correct approach
Keep (1, 5), (2, 3): the fitted gradient is −2.
More checks before you submit
- A high R² does not prove the chosen model is biologically correct.
- Do not use linear regression blindly on strongly curved relationships.
Method notes
Correlation describes association; it does not by itself demonstrate causation. Inspect the graph and biological context.