7/36
Part 2 of 6 · The estimateLearn and do

Difference-in-differences subtracts what the two easy comparisons keep

Each easy comparison is the right answer plus one bias:

T1−C1=(T0−C0)⏟gap already there+DiDT_1 - C_1 = \underbrace{(T_0 - C_0)}_{\text{gap already there}} + \text{DiD} T1−T0=(C1−C0)⏟change anyway+DiDT_1 - T_0 = \underbrace{(C_1 - C_0)}_{\text{change anyway}} + \text{DiD}

In words: DiD is the difference in differences, (T1−T0)−(C1−C0)(T_1 - T_0) - (C_1 - C_0). Both lines are true for any four numbers, so they need no assumption. On the worked example:

The two easy comparisons, and the difference in differences
0481216
after only: T1 - C1 = 16
the treated group's own change: T1 - T0 = 9.75
difference in differences = 4
the gap that was already therethe effectthe common change

The same 4 sits inside both wrong answers. The pre-launch gap is what's wrong with after-only, and the control group's change is what's wrong with before-and-after. Difference-in-differences subtracts both.

The practice data works the same way. The treated cities start 5 higher, every city rises 0.4 a week, and the true effect is 2. The pre weeks are 0 to 7 and the post weeks 8 to 15, so the two periods' midpoints are 8 weeks apart. After-only should land near 5+2=75 + 2 = 7, and before-and-after near 0.4×8+2=5.20.4 \times 8 + 2 = 5.2. Over 2,000 simulated panels they average 7.00 and 5.20, and difference-in-differences averages 2.00.

In the editor, write easy_answers(m): both easy comparisons and the difference in differences, from the four means.