Skip to calculators
calcmintly

Simple Linear Regression

Fit y=intercept+slope×x and predict y at an editable x.

Add to workspace

Your numbers

Local calculations. Results are estimates, not professional advice.

Slope

—

Ordinary least squares with an intercept. Extrapolation beyond the observed x range can be unreliable.

Formula

Use b = Σ(xᵢ−x̄)(yᵢ−ȳ)/Σ(xᵢ−x̄)² and a = ȳ−bx̄. xᵢ and yᵢ are paired observations, bars denote means, b is slope, and a is intercept. Prediction at the entered target is a+bx.

Fit y=intercept+slope×x and predict y at an editable x.

Worked example

x observations
1, 2, 3, 4
y observations
2, 4, 5, 4
Prediction x
5
Slope
0.7
Intercept
2
Predicted y
5.5

Scope and limitations

Ordinary least squares with an intercept. Extrapolation beyond the observed x range can be unreliable.

Inputs are checked for missing values and allowed ranges. A result outside the finite numeric range is not displayed. Rounding affects display, while the calculation uses the model’s numeric precision.

Check your units and assumptions before relying on a result. Changing a label does not convert a currency or physical unit.

Formula version: 04164298c724 · Example checked:

Methodology

Related tools