|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "d988694a", |
| 5 | + "id": "a5f3d36b", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "# Spillover-aware DiD with `SpilloverDiD` \u2014 a TVA-style worked example\n", |
|
47 | 47 | }, |
48 | 48 | { |
49 | 49 | "cell_type": "markdown", |
50 | | - "id": "64ba6796", |
| 50 | + "id": "a16e76a4", |
51 | 51 | "metadata": {}, |
52 | 52 | "source": [ |
53 | 53 | "## 2. The synthetic panel\n", |
|
75 | 75 | { |
76 | 76 | "cell_type": "code", |
77 | 77 | "execution_count": null, |
78 | | - "id": "3ec42967", |
| 78 | + "id": "1712f2bb", |
79 | 79 | "metadata": {}, |
80 | 80 | "outputs": [], |
81 | 81 | "source": [ |
|
157 | 157 | { |
158 | 158 | "cell_type": "code", |
159 | 159 | "execution_count": null, |
160 | | - "id": "ba60f66a", |
| 160 | + "id": "21aa12c0", |
161 | 161 | "metadata": {}, |
162 | 162 | "outputs": [], |
163 | 163 | "source": [ |
|
180 | 180 | }, |
181 | 181 | { |
182 | 182 | "cell_type": "markdown", |
183 | | - "id": "dd90daa6", |
| 183 | + "id": "8be4e7c9", |
184 | 184 | "metadata": {}, |
185 | 185 | "source": [ |
186 | 186 | "## 3. The naive headline \u2014 multi-period TWFE on the full sample\n", |
|
194 | 194 | { |
195 | 195 | "cell_type": "code", |
196 | 196 | "execution_count": null, |
197 | | - "id": "75f3aa8f", |
| 197 | + "id": "0c563f94", |
198 | 198 | "metadata": {}, |
199 | 199 | "outputs": [], |
200 | 200 | "source": [ |
|
224 | 224 | }, |
225 | 225 | { |
226 | 226 | "cell_type": "markdown", |
227 | | - "id": "785586b4", |
| 227 | + "id": "7253fe4c", |
228 | 228 | "metadata": {}, |
229 | 229 | "source": [ |
230 | 230 | "The naive estimate is roughly **-4.29**, about 58% of the true\n", |
|
241 | 241 | }, |
242 | 242 | { |
243 | 243 | "cell_type": "markdown", |
244 | | - "id": "dae0914e", |
| 244 | + "id": "cb77d87a", |
245 | 245 | "metadata": {}, |
246 | 246 | "source": [ |
247 | 247 | "## 4. Choosing the spillover bandwidth\n", |
|
267 | 267 | { |
268 | 268 | "cell_type": "code", |
269 | 269 | "execution_count": null, |
270 | | - "id": "7dba9225", |
| 270 | + "id": "4804334d", |
271 | 271 | "metadata": {}, |
272 | 272 | "outputs": [], |
273 | 273 | "source": [ |
|
294 | 294 | }, |
295 | 295 | { |
296 | 296 | "cell_type": "markdown", |
297 | | - "id": "2e15f7f6", |
| 297 | + "id": "787428d1", |
298 | 298 | "metadata": {}, |
299 | 299 | "source": [ |
300 | 300 | "At `d_bar = 50` km the ring is too narrow: near-controls in the\n", |
|
330 | 330 | }, |
331 | 331 | { |
332 | 332 | "cell_type": "markdown", |
333 | | - "id": "44736532", |
| 333 | + "id": "ce1cb17e", |
334 | 334 | "metadata": {}, |
335 | 335 | "source": [ |
336 | 336 | "## 5. Fit `SpilloverDiD` and interpret\n", |
|
342 | 342 | { |
343 | 343 | "cell_type": "code", |
344 | 344 | "execution_count": null, |
345 | | - "id": "1e76fde8", |
| 345 | + "id": "4558bcfe", |
346 | 346 | "metadata": {}, |
347 | 347 | "outputs": [], |
348 | 348 | "source": [ |
|
369 | 369 | }, |
370 | 370 | { |
371 | 371 | "cell_type": "markdown", |
372 | | - "id": "4ab80644", |
| 372 | + "id": "e28652ea", |
373 | 373 | "metadata": {}, |
374 | 374 | "source": [ |
375 | 375 | "With the spillover term in the regression, `SpilloverDiD` cleanly\n", |
|
387 | 387 | }, |
388 | 388 | { |
389 | 389 | "cell_type": "markdown", |
390 | | - "id": "c6e4b008", |
| 390 | + "id": "2e005043", |
391 | 391 | "metadata": {}, |
392 | 392 | "source": [ |
393 | 393 | "## 6. Robust inference with Conley spatial-HAC\n", |
|
411 | 411 | { |
412 | 412 | "cell_type": "code", |
413 | 413 | "execution_count": null, |
414 | | - "id": "7425c521", |
| 414 | + "id": "25d20f8c", |
415 | 415 | "metadata": {}, |
416 | 416 | "outputs": [], |
417 | 417 | "source": [ |
|
445 | 445 | }, |
446 | 446 | { |
447 | 447 | "cell_type": "markdown", |
448 | | - "id": "d739826c", |
| 448 | + "id": "e6d5ee1b", |
449 | 449 | "metadata": {}, |
450 | 450 | "source": [ |
451 | 451 | "Point estimates are identical across all three rows \u2014 the variance\n", |
|
500 | 500 | }, |
501 | 501 | { |
502 | 502 | "cell_type": "markdown", |
503 | | - "id": "c86340f2", |
| 503 | + "id": "5cc89608", |
504 | 504 | "metadata": {}, |
505 | 505 | "source": [ |
506 | 506 | "## 7. Practitioner takeaways and where to go next\n", |
|
540 | 540 | " `tutorials/12_two_stage_did.ipynb` for the TwoStageDiD event-study\n", |
541 | 541 | " pattern this mirrors).\n", |
542 | 542 | "- *Survey weights* \u2014 `survey_design=SurveyDesign(...)` supports\n", |
543 | | - " H\u00e1jek-weighted point estimates with Binder TSL variance, including\n", |
544 | | - " combined `survey_design + vcov_type=\"conley\"` panel-block sandwich\n", |
545 | | - " (Wave E.2). A dedicated survey-design tutorial is on the roadmap.\n", |
| 543 | + " H\u00e1jek-weighted point estimates with Binder TSL variance. Combined\n", |
| 544 | + " with `vcov_type=\"conley\"` and `conley_lag_cutoff=0` (cross-\n", |
| 545 | + " sectional spatial only) this is the Wave E.2 stratified-Conley\n", |
| 546 | + " sandwich on PSU totals. The panel-block extension\n", |
| 547 | + " `conley_lag_cutoff > 0` (spatial + within-PSU serial Bartlett HAC)\n", |
| 548 | + " is the Wave E.2 follow-up library synthesis, and it requires an\n", |
| 549 | + " effective PSU on the survey design (either explicit\n", |
| 550 | + " `survey_design.psu=` or `cluster=<col>` injected per Wave E.1's\n", |
| 551 | + " warn-and-use-PSU pattern). A dedicated `SpilloverDiD`\n", |
| 552 | + " survey-design tutorial is on the roadmap.\n", |
546 | 553 | "\n", |
547 | 554 | "**References:**\n", |
548 | 555 | "- Butts, K. (2021). *Difference-in-Differences with Spatial\n", |
|
0 commit comments