Fit the ordinary least-squares line ŷ = b₀ + b₁x from paired X and Y data — slope, intercept, R², SEE, residuals, prediction, and a scatter plot with the line of best fit.
Comma, space, or newline separated
Same length as X
Optional — leave blank to skip prediction
Simple linear regression finds the straight line that best describes how Y changes with X. This calculator uses ordinary least squares: it chooses intercept b₀ and slope b₁ so that the sum of squared vertical residuals is as small as possible. Enter X and Y as two lists of equal length, or paste two columns (one pair per line). Optionally predict ŷ for any x — including values outside the observed range. Results include the equation, R², the standard error of estimate, a residual table, and an inline scatter plot of the points with the fitted line.
Separate comma/space-separated lists, or pasted columns of x y pairs. Need at least two pairs with non-constant X.
Any finite x; ŷ = b₀ + b₁x is evaluated at that point and marked on the graph.
Use this tool for homework line-of-best-fit problems, quick trend checks on small datasets, residual inspection before a report, or predicting a next value from a simple linear trend. Pair it with correlation when you care about association strength, or with a t-test when you need formal inference on means.
b₁ = Sxy / Sxx b₀ = ȳ − b₁ x̄ ŷ = b₀ + b₁ x R² = 1 − SSE / SST SEE = √(SSE / (n − 2)) (n > 2) where Sxx = Σ(xᵢ − x̄)², Sxy = Σ(xᵢ − x̄)(yᵢ − ȳ), SSE = Σ(yᵢ − ŷᵢ)², SST = Σ(yᵢ − ȳ)²
Slope (change in ŷ per unit x)
Y-intercept (ŷ when x = 0)
Coefficient of determination
Standard error of the estimate
yᵢ − ŷᵢ for each observation
x̄ = 3, ȳ = 4, Sxx = 10, Sxy = 6 → slope b₁ = 0.6, intercept b₀ = 2.2, so ŷ = 2.2 + 0.6x. R² = 0.6. Predicting at x = 6 gives ŷ = 2.2 + 0.6×6 = 5.8.
Ordinary least squares chooses the intercept b₀ and slope b₁ that minimize the sum of squared vertical residuals Σ(yᵢ − ŷᵢ)². The fitted equation is ŷ = b₀ + b₁x.
With means x̄ and ȳ, slope b₁ = Sxy / Sxx where Sxx = Σ(xᵢ − x̄)² and Sxy = Σ(xᵢ − x̄)(yᵢ − ȳ). Intercept b₀ = ȳ − b₁x̄. You need at least two points and non-zero variance in X.
R² = 1 − SSE/SST is the proportion of Y variance explained by the linear fit. R² = 1 means perfect fit; R² = 0 means the line predicts no better than ȳ. R² near 1 does not prove causation.
SEE = √(SSE / (n − 2)) estimates the typical size of residuals around the regression line (for n > 2). Smaller SEE means points hug the line more tightly.
Yes — the calculator evaluates ŷ = b₀ + b₁x at any finite x you enter. Extrapolation beyond the observed X range is mathematically fine but statistically riskier because the linear pattern may not continue.
If every x is identical, Sxx = 0 and the slope is undefined — there is no unique best-fit line through a vertical stack of points. Spread out X or add more distinct x-values.
© 2025-2026 PromathTools. All rights reserved.
Built by KruskalCode – SaaS & Automation Experts · EverydayDevTools