27/36
Part 5 of 6 · RolloutsLearn

In one rollout where every effect is positive, the regression returns -0.05

Here's how badly it can go.

city = np.repeat(np.arange(20), 16)
week = np.tile(np.arange(16), 20)
launch = np.where(city < 10, 4, 10)
D = (week >= launch).astype(float)
effect = np.where(D == 1, 0.5 * (week - launch + 1), 0.0)

print(f"true average effect:        {effect[D == 1].mean():.2f}")
print(f"regression, growing effect: {twfe(effect, city, week, D):.2f}")
print(f"regression, constant 3:     {twfe(3 * D, city, week, D):.2f}")
true average effect:        2.75
regression, growing effect: -0.05
regression, constant 3:     3.00

This is the rollout from the step before: two waves of 10 cities, launching in week 4 and week 10, over 16 weeks, with no city left untreated. The effect is 0.5 in a city's launch week and grows by 0.5 every week after. The outcome is the effect alone, with no noise. City levels and weekly shocks would change nothing, since the fixed effects absorb them.

Every treated city-week has a positive effect, and they average 2.75. The regression returns -0.05. It's a weighted average of the two comparisons:

ComparisonEstimateWeight
Early wave against the late wave, weeks 0 to 9, before the late wave launches1.750.4
Late wave against the early wave, weeks 4 to 15, after the early wave launched-1.250.6
The regression, weeks 0 to 15-0.05

The first row is right: 1.75 is the early wave's average effect over weeks 4 to 9.

The second row is the late wave's true effect over weeks 10 to 15, also 1.75, minus 3.0. That 3.0 is how much the early wave's own effect grew between the two windows: from 1.75 on average over weeks 4 to 9 to 4.75 over weeks 10 to 15.

Give every city-week the same effect of 3 instead, and the regression returns exactly 3.