Two jobs for regression
Regression fits a line (or a surface) that links an outcome to its drivers.
The idea
- Explain: how much does each driver move the outcome?
- Predict: what will the outcome be for a new input?
Try it: explain or predict?
Data Analytics / Module 3 / Topic 11
Topic 11 · Managerial Decisions
Fit a line to see what drives an outcome, predict the next result, and choose where a limited budget does the most good.
Regression fits a line (or a surface) that links an outcome to its drivers.
The idea
Try it: explain or predict?
Can you find the line that sits closest to the points?
The idea
The best-fit line is the one that keeps the misses as small as possible: for each month, the gap between the actual sales and the line. Excel finds it for you, but try it by hand first.
Try it: move the line
Every number in the equation has a unit. Say it.
With two drivers
A shop might fit Sales = 64 + 7.5 × Ad spend + 3.2 × Workshop seats (sales and ads in hundreds of dollars). Each extra $100 of ads goes with about $750 more sales, holding seats fixed. Each extra seat goes with about $320 more, holding ads fixed. With 6 ($600) of ads and 15 seats: 64 + 7.5(6) + 3.2(15) = 64 + 45 + 48 = 157, or about $15,700.
The line was only tested where the data are.
Try it: pick a planned ad spend
The data cover $200 to $1,100 a month. A prediction for $2,500 (322, or $32,200) leans on a stretch of the line the data never tested, so treat it as a guess. Every prediction also carries uncertainty: real months will land above and below the line.
A line shows that two things move together. It does not prove one causes the other.
The idea
Sprout & Stem may spend more on ads in spring, when people buy plants anyway. Then the season moves both ads and sales. A third factor like that is called a confounder. To claim cause, you generally need a controlled test, such as an A/B experiment, or other strong evidence.
Try it: which sentence is safe to write?
Unusual points can pull the whole line toward them.
Try it: add a big wedding order
In one month, Sprout & Stem spent $400 on ads but sold $26,000, because of a one-time wedding order.
If a point clearly belongs to a different situation, like a one-time wedding order among normal months, leave it out and say so in your report. If you are not sure, fit the line with and without it and report both when they disagree.
The real question is not "is this option good?" but "is it the best use of the money?"
Try it: Sprout & Stem has $2,000 for one option
| Option | Expected benefit |
|---|
The opportunity cost of a choice is the best alternative you give up, just one, not everything you passed on. When a limit is binding, a model can also show what one more unit of it is worth (its shadow price), which tells you where extra budget would do the most good.
Six quick cases. Five are common regression and allocation mistakes, and one is fine.
Now use the tool: paste your own data, fit the line, and test a prediction.
A line-fitting tool. Enter pairs of numbers (driver, outcome), and it fits the best line, reads it in plain words, and predicts a new value. Tap a point on the chart to leave it out and see how the line changes. It starts with Sprout & Stem's made-up data.
One pair per line: driver, outcome
Predict the outcome when the driver is
Put the month numbers in A2 to A11, Sprout & Stem's ad spend in B2 to B11, and its sales in C2 to C11, with headings in row 1.
=SLOPE(C2:C11,B2:B11) returns 9 and =INTERCEPT(C2:C11,B2:B11) returns 97. The outcome (sales) goes first and the driver (ad spend) second.=FORECAST.LINEAR(7.5,C2:C11,B2:B11). The answer is 164.5, or $16,450, the same as 97 + 9(7.5).A store estimates Sales = 52 + 7 × Ad spend, both in thousands of dollars.
a) Predict sales when ad spend is $9,000 (that is, 9 in these units). thousand dollars
b) What does the slope mean?
Sales = 30 + 2.4 × Ad spend + 0.8 × Staff hours (sales and ad spend in thousands of dollars). Predict sales with an ad spend of 10 ($10,000) and 25 staff hours. thousand dollars
A manager can put $5,000 into one option: Option A (expected benefit $7,200), Option B ($6,900), or Option C ($6,100). She picks Option A. What is the opportunity cost? $
AI can run and explain a regression quickly. You supply the doubt: is it really cause, and do the numbers check out? If your class has an AI policy, follow it.
The best prompts make you do the thinking, with AI as a coach.
Give an AI assistant Sprout & Stem's ten months (ad spend, sales): . Ask for the best-fit line and the predicted sales at an ad spend of 7.5. Then compare.