Prof. Polly

Data Analytics / Module 3 / Topic 11

Topic 11 · Managerial Decisions

Explain, Predict, Choose

Fit a line to see what drives an outcome, predict the next result, and choose where a limited budget does the most good.

Tiggie the tiger cub, thinking
Your sales lineAnswer Tiggie to add a point
0 of 8
Sprout & Stem's ad question. For 10 months the plant shop (made up for this guide) tried different amounts of online advertising, from $200 to $1,100 a month, and recorded its sales. Both are in hundreds of dollars: an ad spend of 2 means $200, and sales of 119 mean $11,900. Does more advertising go with more sales, and by how much? Eight short stops.
STOP 1 OF 8

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?

STOP 2 OF 8

Fit the line

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

Starting point
Slope
Your lineMissesBest-fit line
STOP 3 OF 8

Read the line, with units

Every number in the equation has a unit. Say it.

Sales = 97 + 9 × Ad spend   (both in hundreds of dollars)
  • Slope 9: each extra $100 of ads is associated with about $900 more in sales.
  • Intercept 97: where the line starts at zero ads, $9,700. Zero ads is outside the data (the lowest month was $200), so treat it as a starting point, not a tested prediction.

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.

STOP 4 OF 8

Predict, but stay inside the data

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.

STOP 5 OF 8

"Is associated with," not "causes"

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?

STOP 6 OF 8

One odd month can bend the line

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.

STOP 7 OF 8

Opportunity cost: choosing where money goes

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

OptionExpected benefit
Pick the option you would fund.

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.

STOP 8 OF 8

Spot the mistake

Six quick cases. Five are common regression and allocation mistakes, and one is fine.

Nice work. Your sales line is complete!

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.

Data

One pair per line: driver, outcome

Predict the outcome when the driver is

Slope
Intercept
Points used
Type a driver value and tap Predict.

Do it in Excel

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.

  1. Look first. Select B1 to C11 and choose Insert, Scatter. The points rise from left to right in a rough line, so a straight line is a fair summary.
  2. Add the line. Right-click a point, choose Add Trendline, pick Linear, and check Display Equation on chart. Excel shows y = 9x + 97.
  3. Same numbers in cells. =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.
  4. Predict. For a planned ad spend of $750, type =FORECAST.LINEAR(7.5,C2:C11,B2:B11). The answer is 164.5, or $16,450, the same as 97 + 9(7.5).
  5. Stay inside the data. These months cover $200 to $1,100 of ads. Treat a prediction far outside that range as a guess.
  6. More than one driver: turn on the Analysis ToolPak (the same way you turn on Solver), then use Data, Data Analysis, Regression. The Coefficients column lists the intercept and one coefficient for each driver.

Try it yourself

1. Use an equation

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?

a) 52 + 7(9) = 115, or $115,000.
b) Each extra $1,000 of ads is associated with about $7,000 more in sales.

2. Two drivers

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

30 + 2.4(10) + 0.8(25) = 30 + 24 + 20 = 74, or about $74,000. Each coefficient is read "holding the other driver fixed."

3. Opportunity cost

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? $

The opportunity cost is the single best alternative given up: Option B, $6,900. Adding up B and C ($13,000) is a common mistake.

Questions to discuss

  1. What two jobs does regression do for a manager, and how are they different?
  2. Interpret a slope and an intercept in plain words, with their units.
  3. Why is a regression line not proof of cause? Give an example of a confounder.
  4. Explain opportunity cost, and how a shadow price helps decide where extra budget should go.

Practice quiz

Score: 0 of 10

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.

It can help with

  • Fitting a line and explaining the slope and intercept
  • Drafting a prediction for a new input
  • Writing the Excel formulas

Always check

  • Recompute one prediction by hand
  • Check the units in every sentence
  • Check that predictions stay inside the data

Watch out for

  • Sentences that say "causes" when the data only show "is associated with"
  • A confounder that could drive both variables
  • Swapped ranges in SLOPE or FORECAST.LINEAR

Prompts that help you learn

The best prompts make you do the thinking, with AI as a coach.

How to check any AI answer

  1. Compare it with a result you already know, such as the tool on this page.
  2. Test one number yourself with a calculator.
  3. Ask the AI to explain each step. If a step does not make sense, do not use it.
  4. If the AI and your own work disagree, find out why before you trust either one.

Check the AI: a challenge

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.

Sales = 97 + 9 × Ad spend; at 7.5, predicted sales are 164.5 (in hundreds of dollars, $16,450). Also check its wording: if it says ads "cause" sales, that is a claim the data cannot support.
1 / 8