3/36
Part 1 of 6 · Two unitsLearn and do
The estimate is a difference in means, and clustering never changes it
The practice fits the regression y ~ 1 + treat. That's formula notation: it predicts y from an intercept, the 1, and the treatment flag, 0 or 1. The fit is ordinary least squares, OLS: the line with the smallest sum of squared misses.
With a 0 or 1 flag, that line passes through the two arms' means. So its slope on treat is the treated mean minus the control mean.
The estimate is the easy part, and clustering never changes it. Everything after this step is about its standard error.
In the editor, write diff_in_means(y, treat) from the two arms' means. y6 holds six small cities that the lesson comes back to.