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.

Linear Regression, r & R² Calculator inputs

Calculated locally. No account or input upload.

Result & working

Example

The calculator is loading. The worked example is also shown below.

The formula

slope m = Sxy/Sxx

intercept c = ȳ − mx̄

r = Sxy/√(SxxSyy)

R² = 1 − SSE/SST

What the variables mean
SymbolMeaning
rPearson correlation coefficient, from −1 to +1.
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.

  1. OLS fit: y = 2.01x + 0.05
  2. Pearson r = 0.9986784
  3. 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.