# Several variables

> Formulas with several inputs: ŷ = b₀ + Σ bⱼxⱼ, 0/1 variables and interactions, a driver-based forecast, ±10% sensitivity and scenarios.

- Course: [Math for Statistics and Unit Economics](https://productovi.com/courses/math-basics.md)
- Module: Lines and models
- Lesson 19/36, ~28 min
- Source: https://productovi.com/courses/math-basics/several-variables

## One output, several inputs

**Alex Tutor:** Still on Klasna's product team. Marketing built a model for new families a month: ŷ = 40 + 0.15·spend + 25·exam. Spend is in thousand UAH; exam is 1 in exam months and 0 otherwise.

**Sofia:** It's like last lesson's line, just with two x's. What does each number mean?

$$
\hat{y} = b_0 + b_1 x_1 + b_2 x_2 + \dots + b_k x_k = b_0 + \sum_{j=1}^{k} b_j x_j
$$

*ŷ (y-hat): the model's prediction; b₀: the value when every x is 0; bⱼ: how much ŷ changes when xⱼ grows by 1 and the other x's stay the same.*

**Alex Tutor:** b₀ = 40 is the start. Each coefficient is a slope for its own input, **holding the others fixed**: one more thousand of spend adds 0.15 families, whatever the month.

**Alex Tutor:** Exam is a **0/1 variable**: it's either on or off. When it's 1, it adds 25 families at the same spend. When it's 0, its term vanishes.

**Alex Tutor:** Before computing anything, read one coefficient.

> **Exercise:** Klasna's model for new families a month is ŷ = 40 + 0.15·spend + 25·exam, with spend in thousand UAH and exam = 1 in exam months, 0 otherwise. What does 0.15 mean?

> **Exercise:** With ŷ = 40 + 0.15·spend + 25·exam, how many new families does the model predict for an exam month with a spend of 120 thousand UAH?

**Sofia:** And 40 means 40 families with no spend at all, outside exam season?

**Alex Tutor:** That's how it reads, but careful: every month in the data had some spend, so zero is outside what the model has seen. Often b₀ just anchors the line.

**Sofia:** And 0.15 sounds tiny for a coefficient.

**Alex Tutor:** It's per thousand hryvnias: 100 thousand more brings 15 families. Always read a coefficient together with the unit of its input.

> **Exercise:** In ŷ = 40 + 0.15·spend + 25·exam, what does the 25 mean?

## When two inputs work together

**Sofia:** But in exam season parents react to ads more, don't they? The same thousand should bring more families in April.

**Alex Tutor:** Then the model needs an **interaction**: a term that multiplies two inputs, + 0.10·spend·exam. In other months it's zero. In exam months each thousand brings 0.15 + 0.10 = 0.25 families.

**Alex Tutor:** Without it, the two lines run parallel: exam months are just 25 higher. With it, the exam line is steeper, and the gap grows with spend.

![Without an interaction the exam-month line is 25 families above the other line at every spend; with it, the exam line is steeper and the gap grows from 25 to 45 at 200 thousand.](https://productovi.com/courses/math-basics/diagrams/m5-l3-dummy-interaction.png)

*A 0/1 variable shifts a line; an interaction also tilts it.*

**Sofia:** So in a model with interactions, "the effect of spend" has no single answer. It depends on the month.

> **Exercise:** The model is now ŷ = 40 + 0.15·spend + 25·exam + 0.10·spend·exam. What does it predict for an exam month with a spend of 200 thousand UAH?

## A forecast built from drivers

**Alex Tutor:** Finance uses the same idea for money. A **driver-based forecast** of a month's operating profit multiplies the things that cause it:

$$
OP = L \cdot (0.975\,P - T - V \cdot FX) - F
$$

*L: lessons; P: price; 0.975: what remains after the 2.5% fee; T: tutor payout; V: video and AI per lesson, in USD; FX: the dollar rate; F: fixed costs.*

**Sofia:** Brackets first: 0.975 × 650 − 415 − 0.75 × 42 = 633.75 − 415 − 31.50 = 187.25 per lesson. Then times lessons, minus fixed costs.

**Alex Tutor:** Compute the bracket for a different lesson before we go to the month.

> **Exercise:** In OP = L · (0.975·P − T − V·FX) − F, take a premium lesson with price P = 700 UAH, tutor payout T = 430 UAH, video and AI V = 0.75 USD and a dollar rate FX = 42. What is the contribution per lesson, the bracket, in UAH?

**Alex Tutor:** And L itself is learners × lessons per learner. In October that's 1,010 × 6.5 = 6,565 lessons; with 1,062,000 of fixed costs the month leaves 167,296.25 UAH.

> **Exercise:** A month has 1,000 learners taking 6.5 lessons each, 187.25 UAH of contribution per lesson and 1,062,000 UAH of fixed costs. What is its operating profit, in UAH?

## Which input matters most?

**Alex Tutor:** To find out, run a **sensitivity** test: move one driver by 10%, keep the rest, and record how far profit moves. Then sort.

**Sofia:** Price +10% is 65 more, 63.375 after the fee, times 6,565: about +416,057. That's more than twice the month's whole profit.

**Alex Tutor:** Because price touches every lesson, and the margin is thin: 187.25 of 650 stays. The dollar rate +10% costs only 3.15 per lesson, about −20,680.

![October profit of 167,296 UAH moves +416,057 if price rises 10%, −272,448 if payout rises 10%, +122,930 for 10% more lessons, −106,200 for 10% higher fixed costs and −20,680 for a 10% higher dollar.](https://productovi.com/courses/math-basics/diagrams/m5-l3-tornado.png)

*One driver at a time, the same 10% step, sorted by impact.*

**Alex Tutor:** **Scenarios** are different: they move several drivers together into one consistent story, say a weak year with fewer learners and a lower price. Sensitivity says where to look; scenarios say what could happen.

> **Exercise:** Order October's drivers from the biggest to the smallest effect on profit when each moves by 10% in the harmful or helpful direction.

**Alex Tutor:** One more distinction before your task.

> **Exercise:** Which of these is a scenario rather than a sensitivity test?

## Your turn: where to spend the week

**Alex Tutor:** Leo wants a better forecast and suggests: "Let's spend next week getting the dollar rate exactly right."

**Sofia:** The tornado says the dollar is the smallest bar.

**Alex Tutor:** Then tell him where the week is better spent, with the numbers.

> **Exercise:** Reply to Leo, Klasna's CEO, in 3–4 sentences: is a week on the dollar forecast well spent? October's profit is 167,296 UAH, and a 10% move changes it by about 416,057 for price, 272,448 for tutor payout, 122,930 for lessons, 106,200 for fixed costs and 20,680 for the dollar rate. Use these numbers and say which drivers deserve the work.

## Where you will meet this

> **In short**
>
> - **ŷ = b₀ + Σ bⱼxⱼ**: b₀ is the value when every x is 0; each bⱼ is the change in ŷ for +1 in xⱼ with the other inputs fixed.
> - A **0/1 variable** shifts the prediction by its coefficient when it is 1. An **interaction** (b·x₁·x₂) changes the slope of one input depending on the other.
> - A **driver-based forecast**: OP = L · (0.975P − T − V·FX) − F, with L = learners × lessons per learner.
> - **Sensitivity**: move one driver by the same step (±10%), keep the rest, rank by the change in the result. **Scenarios** move several drivers together.

> **These lessons use it**
>
> - [Multiple linear regression](/courses/statistics-for-pm-and-marketers/multiple-regression): ŷ = b₀ + b₁x₁ + … + bₖxₖ, read coefficient by coefficient.
> - [Two-way ANOVA and interactions](/courses/statistics-for-pm-and-marketers/multifactor-anova): when the effect of one factor depends on another.
> - [A driver-based forecast](/courses/finance-for-product/driver-based-forecast): the whole year built from drivers.
> - [Scenarios and sensitivity](/courses/finance-for-product/scenarios-and-sensitivity): every driver moved by 10%, side by side.

**Alex Tutor:** Next time: splitting a total into parts, from sums of squares to plan versus actual.

- Previous lesson: [Slope as a marginal quantity](https://productovi.com/courses/math-basics/slope-as-a-marginal-quantity.md)
- Next lesson: [Splitting a total](https://productovi.com/courses/math-basics/splitting-a-total.md)

---
Productovi Learning. Free, no sign-up needed to read.
