Day 38 of 55Stage 4 · ImproveWednesdaySimple regression

How much difference would it make?

Before choosing solutions, Amara wants to know how much each cause moves the wait. She starts with capacity.

Stage goal: Test and put in place solutions that remove the root causes.
Team
Astrid (Data Analyst)
Stakeholders
Augustin (Black Belt)
How the day goes
  1. 09:00Fit the line with Astrid (Data Analyst)
  2. 11:00Check the residuals
  3. 15:00Predict with Augustin (Black Belt)

Situation 1 of 2

09:00 · Fit the line with Astrid (Data Analyst)
Astrid (Data Analyst)
The line says each extra slot shortens the weekly median wait by 0.105 days. Can we trust it?

What do you check?

Check a regression three ways: is the slope significant, how much does it explain (R²), and do the residuals look random?

Situation 2 of 2

15:00 · Predict with Augustin (Black Belt)
Augustin (Black Belt)mentor
At 262 slots, the line predicts 8.3 days. But the confidence interval is ±0.6 and the prediction interval ±2.1. Which do you tell Atticus?

Which interval fits his question?

A confidence interval is for the average; a prediction interval is for one new value, so it's wider.
Worked example 1

How much does each routine slot shorten the wait?

Astrid (Data Analyst) fits a straight line through the 20 weeks: median wait against routine slots offered.

Median wait against routine slots, with the fitted line05101520220233246259272Routine slots offered per weekMedian wait (days)259, 8261, 9270, 8265, 7254, 9262, 8259, 9263, 8254, 8263, 9263, 8240, 10234, 10235, 11225, 11243, 12222, 12238, 13230, 12228, 13
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
Download the data (spreadsheet file)
  1. Fit the lineleast squares: the line that makes the squared vertical distances smallest
  2. Equationwait = 35.85 − 0.105 × slots
  3. Slopeeach extra routine slot a week= −0.105 days; 10 slots ≈ 1 day shorter
  4. Is the slope real?t = −0.1051 ÷ 0.0143= t = −7.36, p below 0.0001
  5. R²share of the variation in weekly waits explained by slots= 0.75
  6. Residualsactual − predicted; typical size 0.97 days, no pattern, roughly normal= model is reasonable
  7. Prediction at 262 slots35.85 − 0.105 × 262; 95% confidence interval for the average ±0.61, prediction interval for one week ±2.13= 8.3 days
What it meansSlots explain three quarters of the week-to-week variation. Getting back to 262 routine slots a week would bring the weekly median back to about 8.3 days: better, but not the 5-day goal on its own.
What Amara decidesRestoring lost capacity is necessary but not enough. Model the other causes together.
Try it yourself in a spreadsheet
Slope and intercept=SLOPE(D2:D21,B2:B21) and =INTERCEPT(D2:D21,B2:B21)
R²=RSQ(D2:D21,B2:B21)
Full output=LINEST(D2:D21,B2:B21,TRUE,TRUE), or Data Analysis, Regression
Prediction=FORECAST.LINEAR(262,D2:D21,B2:B21)

Why is the prediction interval (±2.13) so much wider than the confidence interval (±0.61)?

Show the answer

The confidence interval is for the average wait of all weeks with 262 slots. The prediction interval is for one single week, which also varies around that average.

Key concepts

The ideas behind today. Concept how the work is done, in our own words · Common practice widely used ways of working.

Concept

Regression equations

  • A regression line y = b0 + b1 × x fitted by least squares. The slope says how much the result changes for each unit of the input.

Where you will meet this: Simple linear regression · least squares

Common practice

Residuals

  • Residual = actual − predicted. They should look like random scatter around zero, roughly normal, with even spread. A pattern means the model is missing something.

Where you will meet this: Residual analysis

Concept

Confidence and prediction intervals

  • A confidence interval shows where the average result lies for a given input. A prediction interval shows where one new result will probably fall, so it's wider. Predict only inside the range of the data.

Explained in our own words. This helps you understand the concepts behind the certifications; it does not reproduce or replace any official guide. Sources

Day 38 complete

2 situations today.

Your responsibility todayPredicting the effect of a change
Technique you usedSimple regression, residuals, prediction intervals
Key points to remember
  • Check a regression three ways: is the slope significant, how much does it explain (R²), and do the residuals look random?
  • A confidence interval is for the average; a prediction interval is for one new value, so it's wider.