A plant technician records part measurements on a clipboard next to a press, with a discreet green accent on the workbench.

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.

SIMPLE LINEAR REGRESSION
Visual map 170: Simple Linear Regression in Manufacturing: Worked Example. Click the map to see it full size.Download the map as PNG

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.

Advertisement

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 − ȳ)
4012.1-17.5-3.34306.2558.41
4513.0-12.5-2.44156.2530.47
5014.2-7.5-1.2456.259.28
5514.8-2.5-0.646.251.59
6016.12.50.666.251.66
6516.77.51.2656.259.47
7018.012.52.56156.2532.03
7518.617.53.16306.2555.34
Total123.51050.00198.25

Means: x̄ = 460 ÷ 8 = 57.5 °C and ȳ = 123.5 ÷ 8 = 15.44 MPa. Results: Sxx = 1,050 and Sxy = 198.25.

  1. Slope: b = 198.25 ÷ 1,050 = 0.1888 MPa/°C.
  2. Intercept: a = 15.4375 − 0.1888 × 57.5 = 4.58 MPa.
  3. 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.

Advertisement

R-squared, residuals and standard error

X (°C)Measured YPredicted YResidual
4012.112.13-0.03
4513.013.08-0.08
5014.214.020.18
5514.814.97-0.17
6016.115.910.19
6516.716.85-0.15
7018.017.800.20
7518.618.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

  1. Define X (what you control) and Y (what you want to explain or predict).
  2. Collect pairs of data across the whole range of interest, measured with a reliable system (see MSA and Gauge R&R).
  3. Draw the scatter plot and confirm the cloud of points is roughly a straight line.
  4. Calculate b, a and R² in a spreadsheet or statistics package.
  5. Check the residuals and test whether the slope b is significant (hypothesis testing).
  6. 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

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.

Advertisement

Sources

  1. MONTGOMERY, D. C.; PECK, E. A.; VINING, G. G. Introduction to Linear Regression Analysis. Wiley.
  2. MONTGOMERY, D. C.; RUNGER, G. C. Applied Statistics and Probability for Engineers. Wiley.
  3. 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
Photo of Vagner Soares

About the author

Vagner Soares

Lean Manufacturing & Behavioral Management Specialist

Over 20 years in the automotive and metalworking industries (GM and Dana), Lean Manufacturing practitioner since 2006. SENAI instructor and mentor in Brazil’s Brasil Mais Produtivo program, delivering consulting, training and audits for 50+ companies, combining quality, productivity and people development.