HomeTemplatesCalculatorsVideosAcademySoftwareAboutContactLogin
Regression

Linear Regression Calculator

Fit a least-squares line to your data. Paste your X and Y columns to get the equation, R², adjusted R², the slope p-value, scatter and residual plots, and predictions — all client-side.

Was this useful?

Data entry

Paste two columns (one value per row)
Enter at least 3 numeric values, one per line
Same number of values as the X column
Enter a single numeric value
Advanced options — multiple regression
Each row must match the number of X/Y rows; values numeric with an equal column count.

Leave blank for simple regression. When filled, the tool fits Y on X₁ (your X column) plus these predictors and shows a full coefficient table with VIF.

📈

Ready to fit

Paste your X and Y columns and press Calculate to fit the regression line.

Watch: Simple Linear Regression: Quantifying Relationships

Simulation Lab

Linear Regression Lab

Does temperature actually drive yield, and by how much? Enter the lab to fit a line and read off the relationship.

How linear regression works

1

Paste your columns

Paste an X value (the input) and Y value (the output) on each row — row 1's X matches row 1's Y. You can also enter any X value to predict its Y.

2

Least-squares fit

The calculator draws the straight line that sits as close as possible to all your points — the line that minimizes the total squared distance from all points combined.

3

Fit, test and predict

You get R² scores showing how well the line fits, the standard error, a test and confidence range for the slope, scatter plots, a residual plot, and a prediction for any X value. Need more predictors? Open Advanced options for a full multi-variable model with coefficient tables and checks for variable overlap.

Complete guide

Linear Regression Guide

Linear regression fits a straight line through your data to model how a response (Y) changes with a predictor (X). It gives you a usable equation, a measure of how well the line fits (R²), a significance test for the slope, and the ability to predict new values — making it one of the most useful tools in the Analyse phase of any improvement project.

What it is

What is linear regression?

Simple linear regression models the relationship between one predictor (X) and one response (Y) with a straight line, Y = b₀ + b₁X. The slope b₁ tells you how much Y changes for each one-unit change in X, while the intercept b₀ is the predicted Y when X is zero. Unlike correlation, regression gives you a usable equation that can predict Y from any X within your data range.

Calculation logic

How the calculation works

Regression draws the single straight line that sits as close as possible to all your data points (it minimises the total squared distance from the line). The slope tells you how much the output changes for each one-unit change in the input, and the intercept is the predicted output when the input is zero. R² rates how well the line fits, from 0 to 1 — the share of the output's variation that the line explains. The p-value on the slope tells you whether the relationship is real, and the confidence interval gives a plausible range for the slope.

Worked example

Worked example: predicting output from oven temperature

A baker notices higher temperatures seem to give better product rise. They record temperature and rise height across 20 batches. Linear regression gives: Rise = 0.8 × Temperature − 280, with R² = 0.81.

R² of 0.81 means 81% of the variation in rise height is explained by temperature alone. Strong, consistent relationship.

What to do with this: Set a minimum temperature spec. If the oven drops below a certain point, you now know exactly what impact that will have on the product — before the batch is finished.

Why it matters

Operational impact

Regression turns a scatter of points into an actionable equation. It quantifies how a key input drives an output, lets you predict results at settings you have not yet run, and separates real relationships from noise — replacing "we think temperature matters" with "yield rises 0.21 % per degree, and we are confident it is real".

Decision making

When to use it

Use regression in the Analyse phase of DMAIC to confirm which X genuinely influences your Y, and in Improve to model the relationship and choose better settings. It suits continuous X-and-Y data with a roughly linear pattern; check the residual plot to confirm a straight line is appropriate before trusting the model.

Lean Six Sigma

Link to Six Sigma

Regression is the workhorse for establishing Y = f(X) relationships at the heart of Six Sigma. The slope p-value tells you whether an input matters, R² tells you how much of the variation it explains, and the equation feeds directly into process optimisation, transfer functions, and Design of Experiments follow-up studies.

Industry examples

Where linear regression is used

ManufacturingModel how temperature, speed, or pressure drives yield, dimension, or defect rate, then choose settings that hit the target.
HealthcareRelate dose, age, or BMI to a clinical outcome, or staffing levels to patient wait times, to plan capacity and treatment.
Product & R&DQuantify how a formulation variable or test condition affects strength, life, or performance to optimise the design.
Sales & servicesPredict demand, revenue, or handling time from a driver such as marketing spend, headcount, or call volume.
Common mistakes

Common linear regression mistakes

  • Assuming the relationship is linear without plotting the data first — always scatter-plot your variables before running regression. A curved relationship will give misleading results.
  • Using R² alone to judge model quality — a high R² doesn't mean the model is correct. Check the residual plot for patterns too.
  • Extrapolating the model well beyond the range of your data — the line might fit well between 150°C and 200°C but there's no evidence it holds at 250°C.
  • Adding more variables just to increase R² — each extra variable will raise R² even if it adds nothing useful. Use Adjusted R² instead.
  • Confusing correlation with causation — regression tells you how two things move together, not which one drives the other.
What to do next

After a significant fit

If the slope is significant, document the equation and its R² as your transfer function, and use it to set or predict the response at the levels you care about. Verify the model on fresh data before relying on it for control. To explore several inputs at once or find optimum settings, follow up with a Design of Experiments study. If the slope is not significant, the input may not drive the output — widen the X range, gather more data, or investigate other factors.

Resources

Templates, videos and learning

Combine regression with scatter plots, hypothesis tests, and a Design of Experiments study to build and validate your Y = f(X) models.

Frequently asked questions

What is the difference between regression and correlation?

Correlation (Pearson's r) measures the strength and direction of the linear relationship between two variables on a scale from −1 to +1, but it treats X and Y symmetrically and makes no prediction. Regression goes further: it fits an equation, Y = b₀ + b₁X, that lets you predict Y from X and quantifies how much Y changes per unit of X (the slope). In simple linear regression R² is simply the square of the correlation, so the two are closely related — but only regression gives you a usable predictive model.

What is adjusted R-squared?

R² is the proportion of the variation in Y explained by the model, from 0 to 1. The problem is that R² can only increase as you add terms, even if they add nothing useful. Adjusted R² corrects for this by penalising the number of predictors relative to the sample size. For a simple regression with one predictor it is 1 − (1 − R²)(n − 1)/(n − 2). It is the fairer figure to quote when comparing models and is always slightly lower than R².

How do I read a residual plot?

A residual is the gap between an observed Y value and the value the line predicts (residual = observed − fitted). Plotting residuals against the fitted values should show a random, formless cloud centred on zero. Patterns are warnings: a curved shape means the true relationship is non-linear; a funnel that widens or narrows means the variance is not constant (heteroscedasticity); and isolated points far from the rest are outliers worth investigating. A tidy, patternless residual plot is the best evidence that a straight-line model is appropriate.

Can I predict beyond the range of my data?

Predicting outside the range of X values you actually measured is called extrapolation, and it is risky. The fitted line is only supported by evidence within the range you observed; beyond it you are assuming the same straight-line relationship continues, which often is not true — the response may curve, plateau or reverse. Prediction intervals also widen rapidly as you move away from the mean of X, so estimates become far less certain. Treat extrapolated predictions as rough guesses at best.

Can this calculator do multiple regression?

Yes. Open Advanced options and paste your extra predictor columns (X₂, X₃ …), one row per observation in the same row order as your X and Y columns. The calculator fits Y on all predictors at once using ordinary least squares and reports the full coefficient table — each coefficient with its standard error, t-statistic, p-value and 95% confidence interval — plus R², adjusted R², the overall F-test, and the variance inflation factor (VIF) for every predictor. A VIF above roughly 5–10 means two or more predictors are strongly correlated, which inflates the standard errors and makes the individual coefficients hard to interpret.

Next steps

Turn insight into action

A significant regression model reveals how your inputs drive your outputs. Structured training shows you how to build, validate, and act on these relationships.

Explore Lean Six Sigma Training
Learn regression, hypothesis testing, and Design of Experiments with structured training.
Get the DMAIC Assistant
Step-by-step project guidance for improvement teams.
FreeTemplates & Toolkits
Free Lean and Six Sigma templates, checklists, and tools.

Want to model how your inputs drive your outputs inside a full DMAIC project? The Black Belt course covers advanced statistics, hypothesis testing, and the full analytical toolkit.

View Black Belt →