2.2.16 · D2Linear & Logistic Regression

Visual walkthrough — Interpreting model coefficients

1,903 words9 min readBack to topic

This walkthrough builds on the parent topic and touches Linear Regression, Logistic Regression, and Odds and Log-Odds.


Step 1 — What is a coefficient, really? A line on a grid

WHAT. Start with the simplest possible model: one feature , one prediction . We claim they are joined by a straight line:

Read each symbol on the picture: is a position along the horizontal floor, is the height the line reaches above that position, is the height where (the "start"), and is how much the line climbs for each step to the right.

WHY a straight line. A straight line is the only shape whose steepness never changes. That constant steepness is exactly the number we want to interpret: "one nudge in always does the same thing to ." If the shape curved, "the effect of " would be different at every point and could not be a single number.

PICTURE. The blue line rises over the grid; the yellow bracket at marks .

Figure — Interpreting model coefficients

Step 2 — Nudge by one unit and watch

WHAT. Pick any point on the line at feature value . Now step one unit to the right, to . Measure how much the height changed: Here (a triangle, Greek "delta") is shorthand for "the change in." is the height at the new spot; is the height where we started.

Plug the line into each:

Watch the cancellation: appears in both brackets and vanishes; appears in both and vanishes; the only survivor is one clean .

WHY. This is the definition of the coefficient made concrete. The "+1" is a controlled experiment: change exactly one thing by exactly one unit, read the result. The answer doesn't depend on where you started — that's the flatness of a straight line paying off.

PICTURE. Red horizontal arrow = the step in ; green vertical arrow = the resulting rise, labelled .

Figure — Interpreting model coefficients

Step 3 — The hidden fine print: "holding others fixed"

WHAT. Real models have many features: . When we nudged by one unit, we quietly froze . Redo the subtraction keeping still: The term is identical in both brackets, so it cancels — but only because we did not move .

WHY. With two features, is a tilted plane, not a line. is the tilt in the direction alone. If you walk diagonally (changing both features at once), the height change is not — it mixes both tilts. "Ceteris paribus" means "walk parallel to one axis."

PICTURE. A plane over an floor. The red path moves along only (rise ); the grey diagonal path moves both and rises by a different amount.

Figure — Interpreting model coefficients

Step 4 — Switching worlds: probability lives in a box, not on a line

WHAT. Now the target is yes/no (disease: 1 or 0). We want . But is trapped between and , while a line runs freely from to . A line cannot equal — it would predict probabilities above 1 or below 0.

WHY we need a transform. We need a dial that stretches the imprisoned interval out to the whole number line, so a straight line can live there honestly. That dial is built in two moves in the next step. For now: see the mismatch.

PICTURE. Left: a blue line escaping past and below (nonsense as probability). Right: the same -range, but correctly squashed inside the band.

Figure — Interpreting model coefficients

Step 5 — Building the dial: odds, then log-odds

WHAT. Two moves turn the caged into a free number.

Move 1 — odds. Define As climbs from toward , the numerator grows and the denominator shrinks, so odds sweep from up to . That frees the top end but the bottom still bunches at .

Move 2 — logarithm. Take of the odds: The log sends the range onto the full : numbers below become negative, becomes , numbers above become positive. Now — and only now — a straight line can safely equal it:

WHY the log specifically. Odds multiply when you stack effects (twice as likely, then thrice as likely = ). The log is the one tool that turns multiplying into adding — so multiplicative odds become an additive line, and Step 2's clean cancellation works again. That's the whole reason logs enter here.

PICTURE. A ladder of three panels: in → odds in → log-odds in , with matching sample points carried across.

Figure — Interpreting model coefficients

See Odds and Log-Odds for the full anatomy of this ladder.


Step 6 — Nudge again, then undo the log

WHAT. Because log-odds is linear, repeat the Step 2 trick. Nudge by one unit (others frozen): So one unit of adds to the log-odds. But we want to speak about odds, not their log. Undo the log by raising to each side. Using :

Term by term: the left side is a ratio of the new odds to the old odds; the right side is a plain multiplier. So a sum on the log-odds scale becomes a product on the odds scale.

WHY and not ? is the exact inverse of the natural log we used in Step 5; any other base would leave a leftover conversion factor. Same tool in reverse.

PICTURE. Top track (log-odds): a step of added. Bottom track (odds): the same step is a stretch.

Figure — Interpreting model coefficients

Step 7 — All the cases: sign of and the tiny- shortcut

WHAT. The multiplier behaves in three regimes:

  • → odds grow (e.g. , odds up ).
  • → odds unchanged, the feature is inert.
  • → odds shrink (e.g. ).

And the shortcut for small values: near the exponential hugs the line , so Example: , i.e. " odds."

WHY show every case. A reader who only saw would misread a negative coefficient. The multiplier is never negative (an -power can't be), so odds can approach but never go below — a degenerate limit worth seeing.

PICTURE. The curve against : crossing at , the tangent line kissing it there, and shaded regions marking and .

Figure — Interpreting model coefficients

The one-picture summary

Both worlds are the same three moves — freeze the others, nudge by one, read the result — differing only in what scale the reading lives on: linear reads on directly (an addition), logistic reads on log-odds and then un-logs to the odds scale (a multiplication).

Figure — Interpreting model coefficients
Recall Feynman: tell the whole walkthrough back

A coefficient is the steepness of a straight line — how much the output climbs when you take one step right. To measure it, I plant myself anywhere on the line, step one unit sideways, and read the rise; the start-height and everything else cancel, leaving just . With many features I must step straight along one axis and keep the rest frozen, otherwise I'm walking diagonally on a tilted plane and reading the wrong slope.

For yes/no problems the output is a probability locked between 0 and 1, and no straight line can live in a cage. So I stretch it out: first to "odds" (chance-yes over chance-no, which runs from 0 to infinity), then take a log (which spreads that onto the whole number line). Now a line fits, and my one-step trick works again — but one step now adds to the log-odds. To talk about odds instead of their log, I raise to both sides, and adding becomes multiplying by . Positive makes odds grow, zero leaves them alone, negative shrinks them toward (but never below) zero — and for tiny , reads straight off as a percent.


Connections