Formula verified · Deterministic calculation

Linear Regression Calculator

Enter paired X and Y datasets to calculate the regression slope, intercept, correlation and R².

Slope2
CalcuMint Pro

Advanced Analysis

Compare plans
Advanced chartsExplore the result across time and assumptions.
Scenario comparisonCompare multiple assumptions side by side.
Sensitivity analysisSee which assumptions change the outcome most.
Goal SolverSolve backwards from the outcome you want.
Result methodology

Deterministic calculation using the displayed formula and supplied inputs.

Solution steps
  1. n = 4; mean(x) = 2.5; mean(y) = 5
  2. ŷ = 0 + 2x
  3. R² = 0.9999999999999996

How this calculator works

The ordinary least-squares line is ŷ=a+bx, with slope based on paired deviations.

Formula

ŷ=a+bx; b=Σ((x−x̄)(y−ȳ))/Σ((x−x̄)²); a=ȳ−bx̄

Fits the ordinary least-squares line of y on x.

Worked example

Line through doubled values is a verified test case used by the calculation engine.

Assumptions and limitations

  • Datasets are paired and equal length.
  • At least two observations are required.
  • X cannot be constant.
  • Regression describes the supplied data and does not establish causation.

Methodology & sources

This calculator uses deterministic, versioned calculation logic. The formula and verified examples above are part of the calculation definition used by CalcuMint.

  • CalcuMint deterministic statistics engine

Frequently asked questions

What does R² represent?

R² is the squared Pearson correlation for this simple linear regression and summarizes the proportion of linear variation explained by the fitted line.

Can regression prove causation?

No. A fitted relationship does not by itself establish a causal relationship.

Related calculators