
What simple linear regression is
Simple linear regression fits a straight line to two variables to describe how a response (Y) changes when an input (X) changes. On the shop floor it answers questions like: how much does part strength rise for each extra degree in the cure oven?
A scatter diagram and correlation tell you whether a relationship exists and how strong it is. Regression gives you the equation, so you can predict Y, find the X needed to hit a target and quantify the effect. The model is Y = a + b·X + error, where a is the intercept and b the slope.
Visual map of simple linear regression
The map summarizes the line, the coefficients, R-squared and the prediction for the 8-point example.

Least squares formulas
The chosen line is the one that minimizes the sum of squared residuals (the vertical distance from each point to the line). With the means x̄ and ȳ, the coefficients come from two sums:
b = Sxy ÷ Sxx a = ȳ − b·x̄
where Sxx = Σ(x − x̄)² and Sxy = Σ(x − x̄)(y − ȳ). Fit is measured by the coefficient of determination:
R² = 1 − SSE ÷ SST
SSE is the sum of squared residuals and SST = Σ(y − ȳ)². R² runs from 0 to 1 and is the share of the variation in Y explained by the line. In simple regression, R² equals the square of the correlation coefficient r.
Worked example: cure temperature and bond strength
Fictional example: a line cures a structural adhesive in an oven. The lab tested 8 temperatures and measured the shear strength (MPa) of one test coupon at each.
| Temp. X (°C) | Strength Y (MPa) | x − x̄ | y − ȳ | (x − x̄)² | (x − x̄)(y − ȳ) |
|---|---|---|---|---|---|
| 40 | 12.1 | -17.5 | -3.34 | 306.25 | 58.41 |
| 45 | 13.0 | -12.5 | -2.44 | 156.25 | 30.47 |
| 50 | 14.2 | -7.5 | -1.24 | 56.25 | 9.28 |
| 55 | 14.8 | -2.5 | -0.64 | 6.25 | 1.59 |
| 60 | 16.1 | 2.5 | 0.66 | 6.25 | 1.66 |
| 65 | 16.7 | 7.5 | 1.26 | 56.25 | 9.47 |
| 70 | 18.0 | 12.5 | 2.56 | 156.25 | 32.03 |
| 75 | 18.6 | 17.5 | 3.16 | 306.25 | 55.34 |
| Total | 123.5 | 1050.00 | 198.25 |
Means: x̄ = 460 ÷ 8 = 57.5 °C and ȳ = 123.5 ÷ 8 = 15.44 MPa. Results: Sxx = 1,050 and Sxy = 198.25.
- Slope: b = 198.25 ÷ 1,050 = 0.1888 MPa/°C.
- Intercept: a = 15.4375 − 0.1888 × 57.5 = 4.58 MPa.
- Equation: Ŷ = 4.58 + 0.1888·X.
In practice: each extra 1 °C in the tested range raises strength by about 0.19 MPa, so 10 °C more gives about 1.9 MPa.
R-squared, residuals and standard error
| X (°C) | Measured Y | Predicted Y | Residual |
|---|---|---|---|
| 40 | 12.1 | 12.13 | -0.03 |
| 45 | 13.0 | 13.08 | -0.08 |
| 50 | 14.2 | 14.02 | 0.18 |
| 55 | 14.8 | 14.97 | -0.17 |
| 60 | 16.1 | 15.91 | 0.19 |
| 65 | 16.7 | 16.85 | -0.15 |
| 70 | 18.0 | 17.80 | 0.20 |
| 75 | 18.6 | 18.74 | -0.14 |
The sum of squared residuals is SSE = 0.187 and SST = 37.62. So R² = 1 − 0.187 ÷ 37.62 = 0.995: the line explains 99.5% of the variation in strength. The standard error of the regression is s = √(0.187 ÷ 6) = 0.177 MPa (n − 2 = 6 degrees of freedom), a measure of the typical prediction error.
A high R² is not enough. Plot the residuals against X: they should scatter around zero with no curve, no funnel shape and no isolated points. Here the residuals range from −0.17 to +0.20 MPa with no visible pattern.
Using the line to predict
For X = 58 °C: Ŷ = 4.58 + 0.1888 × 58 = 15.53 MPa. For X = 67 °C: Ŷ = 17.23 MPa. Both temperatures fall inside the tested range (40 to 75 °C), so this interpolation is safe.
If the specification requires at least 17 MPa, solve the equation for X: X = (17 − 4.58) ÷ 0.1888 ≈ 65.8 °C. Because the prediction carries error, set a margin above that and confirm with trials.
Extrapolation is a different matter. Applying the line at 100 °C would give 23.5 MPa, but nobody tested that temperature: the adhesive may degrade and the relationship stops being linear. Use the equation only within the range of the data.
Step by step
- Define X (what you control) and Y (what you want to explain or predict).
- Collect pairs of data across the whole range of interest, measured with a reliable system (see MSA and Gauge R&R).
- Draw the scatter plot and confirm the cloud of points is roughly a straight line.
- Calculate b, a and R² in a spreadsheet or statistics package.
- Check the residuals and test whether the slope b is significant (hypothesis testing).
- Predict within the range and validate with new trials.
When several factors act together, simple regression is not enough: plan the tests with a factorial DOE to separate the effects. The amount of data matters too; see sample size.
Common mistakes and limits
- Confusing correlation with cause: the line describes association; only a controlled experiment proves cause.
- Extrapolating beyond the data range.
- Ignoring residuals: a high R² with curved residuals means a linear model is the wrong one.
- Few or clustered points: one extreme point can pull the line.
- Unstable process data: if the process drifts over time, stabilize it first with SPC.
- Poor measurement: instrument error lowers R² and distorts the slope.
Frequently asked questions
What is simple linear regression?
A method that fits a line Y = a + b·X to two variables to describe and predict the response from the input.
What is the difference between correlation and regression?
Correlation measures how strong the relationship is; regression gives the line equation, used to predict and to quantify the effect of X on Y.
What does R² = 0.995 mean?
That 99.5% of the variation in Y in the data is explained by the line. It does not prove cause or that the model holds outside the tested range.
How many points do I need?
There is no magic number, but fewer than 8 to 10 well-spread points give a fragile line. More points reduce the uncertainty of the coefficients.
Can I predict outside the data range?
It is not recommended. The relationship may stop being linear outside the tested range, and prediction error grows.
Can I do it in a spreadsheet?
Yes. Excel's SLOPE, INTERCEPT and RSQ functions return b, a and R² directly.
Sources
- MONTGOMERY, D. C.; PECK, E. A.; VINING, G. G. Introduction to Linear Regression Analysis. Wiley.
- MONTGOMERY, D. C.; RUNGER, G. C. Applied Statistics and Probability for Engineers. Wiley.
- MONTGOMERY, D. C. Introduction to Statistical Quality Control. Wiley.
Keep studying: trusted sources and links
Save this address: Manufatura Enxuta is your school for lean manufacturing. Come back whenever you need to study, with a complete article, a visual map and trusted sources. Follow one of the learning paths or check the A–Z glossary.
Want the tools ready to use?
Download the free "Problem Solving Kit" e-book, with PDCA, A3, 5 Whys and Ishikawa.
Download the e-book
