Data and statistics · cheat sheet

Multiple and non-linear regression

Models with several inputs (y = b0 + b1 × x1 + b2 × x2 …) or a curved shape (for example y = b0 + b1 × x + b2 × x²), to explain and predict a result from its causes.

Common practice
6 steps
Used by Process Improvement Specialist

What it is

Multiple regression fits a result to several inputs at once, so each input's effect is measured while the others are held constant.

Non-linear (curved) regression adds terms such as x² when the data bends.

When to use it

When several causes act together, or a straight line doesn't match the shape of the data.

Why it works

Real results usually have several causes, and some relationships curve. Modelling them properly gives honest predictions.

Do

  • Use roughly 10 or more data points for each input.
  • If two inputs are strongly correlated with each other, keep one.

Don't

  • Too many inputs for the amount of data.
  • Inputs that measure the same thing (they confuse each other).
  • Extrapolating a curve.

Step by step

  1. Choose inputs
  2. Fit
  3. Check each input
  4. Adjusted R²
  5. Residuals
  6. Predict inside the range
Also called: Multiple linear regression, polynomial regression, adjusted R², prediction intervalPrint the blank template ↗

Worked example

The situation. A courier's delivery round time (minutes) from distance (km) and number of stops, 10 rounds.

  1. Time = -0.4 + 2.83 × km + 3.00 × stops; adjusted R² 0.99.

The result. Rounds were planned with fewer stops; average round time fell by 12 minutes.

Multiple regression worksheet Print blank
PartValue
Each extra km2.83 minutes
Each extra stop3.00 minutes
Adjusted R²0.99
Round of 10 km, 5 stops43 minutes

Filled in for: A courier's delivery round time (minutes) from distance (km) and number of stops, 10 rounds.

InputCoef­ficientp-valueKeep?

Copy this structure, or print the blank version and fill it in by hand. R² · adjusted R² · residual pattern · prediction and interval for the scenario

Before you use it: check these

CheckIf it fails
About 10 data points per inputUse fewer inputs or collect more data
Inputs not strongly correlated with each otherKeep one of each correlated pair
Residuals random and evenAdd a missing input, a curve term, or transform

How to do it with real data

The full calculation, as it happens in the story: the data, every step, how to read the result, and the spreadsheet functions to do it yourself.

Worked example with real data

Two causes at once

From Day 39: Two causes at once of the Process Improvement Specialist story

Astrid (Data Analyst) fits one model with both routine slots offered and urgent use of routine slots, for the same 20 weeks.

Step by step

  1. Modelwait = b0 + b1 × slots + b2 × urgent %
  2. Fitted equationwait = 30.94 − 0.1025 × slots + 0.339 × urgent %
  3. Slots−0.1025 days per slot; t = −12.6= p below 0.0001
  4. Urgent use+0.34 days per percentage point; t = 6.2= p below 0.0001
  5. FitR² 0.924, adjusted R² 0.915 (allows for the extra term)= up from 0.75
  6. Typical errorstandard deviation of the residuals= 0.55 days
  7. Scenario: 262 slots, 6% urgent30.94 − 0.1025 × 262 + 0.339 × 6; prediction interval ±1.43= 6.1 days
  8. Scenario: 270 slots, 5% urgentprediction interval ±1.52= 4.9 days
WeekRoutine slots offeredUrgent use of routine slots (%)Median wait (days)
Week 1259118
Week 2261139
Week 3270158
Week 4265117
Week 5254149
Week 6262108
Week 7259149
Week 8263128
Week 9254118
Week 10263129
Week 11263128
Week 122401210
Week 13234810
Week 142351411
Week 152251011
Week 162431812
Week 172221312
Week 182381613
Week 192301212
Week 202281513

How to read the result

Together the two causes explain 92% of the variation in weekly waits. Restoring capacity and protecting routine slots from urgent use could bring the weekly median to about 5 days.

What it led to

Solutions must do both: restore and add routine capacity, and give urgent cases their own slots. The Monday peak and missed appointments add more.

Do it in a spreadsheet

Fit=LINEST(D2:D21,B2:C21,TRUE,TRUE) (two input columns together)
OrData, Data Analysis, Regression, with B and C as the inputs
Prediction=INTERCEPT + slope1 × 270 + slope2 × 5, using the LINEST results
Try it yourself: Adjusted R² went from 0.75 (one input) to 0.915 (two). Why look at adjusted R² rather than R²?

R² always rises when you add an input, even a useless one. Adjusted R² only rises if the new input explains more than chance would.

Worked example with real data

A curve, not a line

From Day 40: When the line bends of the Process Improvement Specialist story

Astrid (Data Analyst) plots the share of appointments missed against how many days ahead they were booked, in 2-day groups.

Missed appointments against days booked ahead, with the fitted curve01020304007142128Days booked aheadMissed (%)1, 7.53, 6.45, 137, 14.89, 17.311, 19.613, 19.315, 22.717, 23.319, 28.921, 26.423, 26.525, 27.227, 27.3

Step by step

  1. Straight linemissed = 8.3 + 0.837 × days; R² 0.896
  2. Check the residualsnegative at both ends, positive in the middle: a curve the line misses= pattern
  3. Quadraticmissed = 4.18 + 1.717 × days − 0.0314 × days²
  4. Compare fitsadjusted R² 0.954 against 0.896 for the line= curve fits better
  5. Predict at 4 days4.18 + 1.717 × 4 − 0.0314 × 16= 10.5%
  6. Predict at 10 days= 18.2%
Days booked aheadMissed (%)
17.5
36.4
513
714.8
917.3
1119.6
1319.3
1522.7
1723.3
1928.9
2126.4
2326.5
2527.2
2727.3

How to read the result

Missed appointments rise quickly in the first two weeks of waiting, then level off. Cutting the typical wait from 10 to 4 days should cut missed appointments from about 18% to about 10%.

What it led to

Use the curve, not the line, to estimate the effect of shorter waits on missed appointments. Never use it beyond 27 days, outside the data.

Do it in a spreadsheet

Quadratic fit=LINEST(B2:B15,A2:A15^{1,2})
Chartscatter chart, then Add trendline, Polynomial, order 2, show equation and R²
Prediction=b0 + b1*4 + b2*4^2
Try it yourself: Why not use the curve to predict the missed rate for appointments booked 60 days ahead?

The data only goes to 27 days. Outside the data a quadratic can bend in ways reality doesn't (here it would start to fall). Never extrapolate a fitted curve.

In the roles

How a Process Improvement Specialist uses it

Wait = 30.94 − 0.1025 × slots + 0.339 × urgent %; adjusted R² 0.915. Missed appointments curve: adjusted R² 0.954 against 0.896 for a line.

Questions people ask

How do I fit a curve?

Add x² as an extra input (polynomial regression), or transform x (for example a log). Compare adjusted R² and the residuals.

Related techniques

← All techniques and tools