Skip to content

Commit eda04c0

Browse files
igerberclaude
andcommitted
spillover-tva: address CI codex R11 P3 — §7 Wave E.2 vs follow-up
R11 noted that §7's survey-weights bullet conflated Wave E.2 (cross-sectional Conley + survey via stratified-Conley sandwich on PSU totals) with the Wave E.2 follow-up (panel-block spatial + serial Bartlett HAC; requires an effective PSU on the survey design — either explicit `survey_design.psu=` or `cluster=<col>` injected per the Wave E.1 warn-and-use-PSU pattern). Rewrites the bullet to distinguish: - `conley_lag_cutoff=0`: Wave E.2 stratified-Conley sandwich on PSU totals (cross-sectional, spatial only) - `conley_lag_cutoff>0`: Wave E.2 follow-up panel-block extension (library synthesis with within-PSU serial Bartlett HAC, requires effective PSU on the survey design) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e16668f commit eda04c0

1 file changed

Lines changed: 27 additions & 20 deletions

File tree

docs/tutorials/23_spillover_tva.ipynb

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "d988694a",
5+
"id": "a5f3d36b",
66
"metadata": {},
77
"source": [
88
"# Spillover-aware DiD with `SpilloverDiD` \u2014 a TVA-style worked example\n",
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"cell_type": "markdown",
50-
"id": "64ba6796",
50+
"id": "a16e76a4",
5151
"metadata": {},
5252
"source": [
5353
"## 2. The synthetic panel\n",
@@ -75,7 +75,7 @@
7575
{
7676
"cell_type": "code",
7777
"execution_count": null,
78-
"id": "3ec42967",
78+
"id": "1712f2bb",
7979
"metadata": {},
8080
"outputs": [],
8181
"source": [
@@ -157,7 +157,7 @@
157157
{
158158
"cell_type": "code",
159159
"execution_count": null,
160-
"id": "ba60f66a",
160+
"id": "21aa12c0",
161161
"metadata": {},
162162
"outputs": [],
163163
"source": [
@@ -180,7 +180,7 @@
180180
},
181181
{
182182
"cell_type": "markdown",
183-
"id": "dd90daa6",
183+
"id": "8be4e7c9",
184184
"metadata": {},
185185
"source": [
186186
"## 3. The naive headline \u2014 multi-period TWFE on the full sample\n",
@@ -194,7 +194,7 @@
194194
{
195195
"cell_type": "code",
196196
"execution_count": null,
197-
"id": "75f3aa8f",
197+
"id": "0c563f94",
198198
"metadata": {},
199199
"outputs": [],
200200
"source": [
@@ -224,7 +224,7 @@
224224
},
225225
{
226226
"cell_type": "markdown",
227-
"id": "785586b4",
227+
"id": "7253fe4c",
228228
"metadata": {},
229229
"source": [
230230
"The naive estimate is roughly **-4.29**, about 58% of the true\n",
@@ -241,7 +241,7 @@
241241
},
242242
{
243243
"cell_type": "markdown",
244-
"id": "dae0914e",
244+
"id": "cb77d87a",
245245
"metadata": {},
246246
"source": [
247247
"## 4. Choosing the spillover bandwidth\n",
@@ -267,7 +267,7 @@
267267
{
268268
"cell_type": "code",
269269
"execution_count": null,
270-
"id": "7dba9225",
270+
"id": "4804334d",
271271
"metadata": {},
272272
"outputs": [],
273273
"source": [
@@ -294,7 +294,7 @@
294294
},
295295
{
296296
"cell_type": "markdown",
297-
"id": "2e15f7f6",
297+
"id": "787428d1",
298298
"metadata": {},
299299
"source": [
300300
"At `d_bar = 50` km the ring is too narrow: near-controls in the\n",
@@ -330,7 +330,7 @@
330330
},
331331
{
332332
"cell_type": "markdown",
333-
"id": "44736532",
333+
"id": "ce1cb17e",
334334
"metadata": {},
335335
"source": [
336336
"## 5. Fit `SpilloverDiD` and interpret\n",
@@ -342,7 +342,7 @@
342342
{
343343
"cell_type": "code",
344344
"execution_count": null,
345-
"id": "1e76fde8",
345+
"id": "4558bcfe",
346346
"metadata": {},
347347
"outputs": [],
348348
"source": [
@@ -369,7 +369,7 @@
369369
},
370370
{
371371
"cell_type": "markdown",
372-
"id": "4ab80644",
372+
"id": "e28652ea",
373373
"metadata": {},
374374
"source": [
375375
"With the spillover term in the regression, `SpilloverDiD` cleanly\n",
@@ -387,7 +387,7 @@
387387
},
388388
{
389389
"cell_type": "markdown",
390-
"id": "c6e4b008",
390+
"id": "2e005043",
391391
"metadata": {},
392392
"source": [
393393
"## 6. Robust inference with Conley spatial-HAC\n",
@@ -411,7 +411,7 @@
411411
{
412412
"cell_type": "code",
413413
"execution_count": null,
414-
"id": "7425c521",
414+
"id": "25d20f8c",
415415
"metadata": {},
416416
"outputs": [],
417417
"source": [
@@ -445,7 +445,7 @@
445445
},
446446
{
447447
"cell_type": "markdown",
448-
"id": "d739826c",
448+
"id": "e6d5ee1b",
449449
"metadata": {},
450450
"source": [
451451
"Point estimates are identical across all three rows \u2014 the variance\n",
@@ -500,7 +500,7 @@
500500
},
501501
{
502502
"cell_type": "markdown",
503-
"id": "c86340f2",
503+
"id": "5cc89608",
504504
"metadata": {},
505505
"source": [
506506
"## 7. Practitioner takeaways and where to go next\n",
@@ -540,9 +540,16 @@
540540
" `tutorials/12_two_stage_did.ipynb` for the TwoStageDiD event-study\n",
541541
" pattern this mirrors).\n",
542542
"- *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",
546553
"\n",
547554
"**References:**\n",
548555
"- Butts, K. (2021). *Difference-in-Differences with Spatial\n",

0 commit comments

Comments
 (0)