Memra

Response on the vertical axis, chosen from the decision

◈ 7 cards

The response y is the thing the decision is about (sales); the explanatory x is what might move it (ad spend). plot(stores$adspend, stores$sales) puts x across and y up; plot(sales, adspend) swaps them silently. Read four things off a scatter: direction (positive), form (linear), strength (tight), outliers (none).

The question decides the axes

Maple & Birch's marketing lead asks: does advertising move sales? She has six stores, last quarter's ad spend and sales for each, in thousands of dollars:

> stores
  store adspend sales channel
1     1       2    20    Mall
2     2       4    27  Street
3     3       5    31    Mall
4     4       7    38  Street
5     5       8    40    Mall
6     6      10    48  Street

Two numeric variables, and a model needs to know which is which. The responsey, the vertical axis — is the thing the decision is about: sales. The explanatory variable — x, horizontal — is the thing that might explain it and that the business can turn up or down: ad spend. The rule is not "the bigger numbers", not "the first column", and not "the one you control" on its own — it is what would change if the decision went the other way. A CFO deciding next quarter's ad budget wants to know what happens to sales; sales is y.

Get this backwards and every later number — the slope, the prediction — answers a question nobody asked.

Worked example — draw it, then read it

Module 8 chose a scatter for two numerics. In Sheets, Insert → Chart → Scatter with adspend as the first column; in R, the two vectors in x-then-y order:

> plot(stores$adspend, stores$sales, xlab = "Ad spend (k$)", ylab = "Sales (k$)")

Six points climbing from (2, 20) at the bottom left to (10, 48) at the top right. Read a scatter in a fixed order:

  • Direction — positive: more ad spend goes with more sales.
  • Form — linear: a straight line would pass close to every point; no curve, no bend.
  • Strength — strong: the points sit tightly on that line, with little scatter around it.
  • Outliers — none: no store is far from the pattern the other five make.

Strength is about tightness, not steepness. A shallow line with the points exactly on it is a strong relationship; a steep line with points scattered widely is a weak one. Lesson 13.2 gives strength a number.

The swap that makes no noise

plot(storesadspend) runs without complaint — R plots whatever is first on the horizontal axis. The picture is the same six points reflected across the diagonal, and a line fitted to it predicts ad spend from sales: a real quantity, but not the one the CFO asked for. There is no error because R does not know what the decision is. You do; put x first.

Type the plot call, then assign x and y for three questions

CRISP-DM: choosing the response from the business objective is business understanding finishing its job before modelling begins.

storeadspend (k$) — xsales (k$) — y1220242735314738584061048Positive · linear · strong · no outliers. Means: x̄ = 6, ȳ = 34 — the point every least-squares linepasses through.
The six points the whole module is built on. adspend is x (what the CFO can change), sales is y (what the decision is about).
NORMAL ~/memra/learn/afm-112/the-modelling-question-and-the-scatter utf-8 LF