Regression Calculator

Perform simple linear regression to find slope, y-intercept, and equation (y = mx + b). Predict Y values, analyze residuals, and get R², F-statistic, and sum of squares.

Slope (m)
Y-Intercept (b)
Equation
R² (Fit Quality)
Extended More scenarios, charts & detailed breakdown
Slope (m)
Y-Intercept (b)
Equation (y = mx + b)
Professional Full parameters & maximum detail

Regression Coefficients

Slope
Intercept
Standard Error of Estimate

Significance Tests

F-Statistic
t-Statistic (slope)

Sum of Squares

SST (Total)
SSR (Regression)
SSE (Error)

Autocorrelation

Durbin-Watson (approx)

How to Use This Calculator

  1. Enter X values as comma-separated numbers (e.g., 1,2,3,4,5).
  2. Enter matching Y values in the same order.
  3. Click Calculate to get slope, intercept, equation, and R².
  4. Use the Predict tab to forecast Y for a new X value with a confidence interval.
  5. The Professional tab adds F-statistic, t-statistic, SST/SSR/SSE decomposition, and Durbin-Watson.

Formula

Slope (m) = Σ[(x−x̄)(y−ȳ)] / Σ(x−x̄)²  |  Intercept (b) = ȳ − m·x̄

Example

X: 1,2,3,4,5 | Y: 2,4,5,4,5 → y = 0.6x + 2.2, R² ≈ 0.81.

Frequently Asked Questions

  • Linear regression finds the line y = mx + b that best fits your data by minimizing the sum of squared residuals (errors). The slope m tells how much Y changes per unit of X, and b is the Y value when X=0.
  • R² (coefficient of determination) measures how well the regression line fits the data. R²=1 means a perfect fit; R²=0 means the line explains none of the variation. R²=0.8 means 80% of Y variation is explained by X.
  • Correlation measures the strength of a relationship. Regression finds the actual equation of the line so you can make predictions. You can have strong correlation without a meaningful regression line.
  • A residual is the difference between an actual Y value and the predicted Y from the regression line: residual = actual − predicted. Small residuals mean a better fit.
  • The Durbin-Watson statistic tests for autocorrelation in residuals. Values near 2 suggest no autocorrelation; values near 0 indicate positive autocorrelation; values near 4 indicate negative autocorrelation.

Related Calculators