Regression Foundations
A reading guide for lecture p-08 — difference-in- differences, varying slopes by group, and why every coefficient is a comparison.
Section one
The two interaction models and how to read their coefficients.
Key concepts
An interaction is a product term, and it always asks whether the effect differs by group.
Difference-in-differences: interacting two dummies.
| Coefficient | Label | Meaning |
|---|---|---|
| b0 | A | comparison group, before |
| b1 | B | treatment group offset, before |
| b2 | C | change over time common to both groups |
| b3 | D | the program effect |
In the worked example b0 = 20, b1 = 15, b2 = 10, b3 = 20: the counterfactual is 45, the observed outcome is 65, and the program effect is the 20 between them.
The comparison group supplies the counterfactual trend.
Both groups would have moved by b2 anyway. The interaction term isolates the extra movement in the treatment group — the part the common trend does not explain.
Dummy × continuous: letting the slope vary by group.
With Type C as the omitted reference category:
The reference category is arbitrary; the fit is not.
The deck runs the same model with different groups omitted. Every coefficient changes, and R2 stays at 0.59. You are re-describing the same fitted lines from a different baseline.
Section two
The mental map. How the pieces connect, and how to read the deck.
This is the sentence that organises the whole deck.
In the corn example you can see both at once: Type A starts 8.98 units above Type C (b1, an intercept shift) and responds to fertilizer differently (b4, a slope shift). Type A’s line is flat, Type B’s rises steeply, Type C’s falls. Without the interaction terms the model would be forced to give all three the same slope and would fit none of them.
So the diagnostic question is: do I think the groups start at different levels, respond at different rates, or both? Each answer maps to a specific term.
Interaction models are hard to read because nothing means what it appears to mean in isolation. Everything is relative to whichever category you left out.
The four-model table drives this home. Same data, same fitted lines, same R2 = 0.59 — and completely different numbers, because each model uses a different reference group. If you ever find yourself surprised that a coefficient changed sign when you re-coded a factor, this is why.
Practical habit: before interpreting any interaction model, say out loud which group is the baseline. Every number in the output is an answer to “compared to that.”
The DiD model is just dummy × dummy — but the two dummies are chosen so the interaction has a causal reading.
The setup gives you four cells: treated and untreated, before and after. Three of them tell you what you need to construct a counterfactual:
The fourth cell is what actually happened. The gap is b3.
This is why the counterfactual line on the slide is dashed: it is not data. It is constructed from the comparison group’s trend, transplanted onto the treatment group’s starting level.
Worth being explicit, because the slides show the mechanics rather than the caveat: DiD assumes the two groups would have moved in parallel absent the program. That is what licenses using the comparison group’s change as the treatment group’s counterfactual.
Notice what this buys you. The two groups are allowed to differ in level — that is exactly what b1 absorbs, and it is why DiD is useful when treatment was not randomly assigned. What they are not allowed to differ in is trend.
Look again at the first example: the treatment group starts at 55 and the comparison at 75. They are not comparable groups. DiD does not care, as long as both were on track to improve by the same amount.
That last point is worth holding onto. The comparison-group design is not just a convenience — it is a way of neutralising unmeasured differences without ever naming them, which is the same ambition as randomization, achieved by a different route.
| Slides | What they are doing | What to take away |
|---|---|---|
| 1–2 | Framing | Two kinds of interaction, one idea. |
| 3 | The two-group, two-period plot | 75→95 and 55→85. Compute the DiD yourself before turning the page. |
| 4 | The counterfactual added | The dashed line is constructed, not observed. |
| 5–6 | The regression version | Map A, B, C, D onto b0 through b3. |
| 7 | Framing part two | Now the slopes vary. |
| 8 | Intercept terms | b0 is Type C’s intercept; b1 is A’s offset from it. |
| 9 | Slope terms | b3 is C’s slope; b4 is the difference; A’s slope is b3 + b4. |
| 10 | Four models, four baselines | Same R2, different coefficients. The reference category is a choice. |
Section three
This deck has no closing checklist, so these are the things to be able to do.