You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix methodology descriptions per PR review feedback
- CallawaySantAnna inference: clarify analytical influence-function SEs
by default, optional multiplier bootstrap when n_bootstrap > 0
- treatment_effects.weight: correct to 1/n_valid for finite tau_hat,
0 for NaN rows (not 1/n_treated)
- Summary table: update CS variance description for consistency
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/tutorials/12_two_stage_did.ipynb
+4-37Lines changed: 4 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -96,17 +96,7 @@
96
96
{
97
97
"cell_type": "markdown",
98
98
"metadata": {},
99
-
"source": [
100
-
"## Per-Observation Treatment Effects\n",
101
-
"\n",
102
-
"A feature unique to `TwoStageDiD` is the `treatment_effects` DataFrame, which contains one row per treated observation with:\n",
103
-
"- `tau_hat`: the residualized outcome (actual outcome minus estimated counterfactual)\n",
104
-
"- The unit and time columns (using the original column names from the input data, e.g., `unit` and `period`)\n",
105
-
"- `rel_time`: relative time since treatment\n",
106
-
"- `weight`: aggregation weight (1/n_treated)\n",
107
-
"\n",
108
-
"This enables granular analysis: examining which units or periods drive the aggregate effect, detecting outliers, or constructing custom aggregation schemes."
109
-
]
99
+
"source": "## Per-Observation Treatment Effects\n\nA feature unique to `TwoStageDiD` is the `treatment_effects` DataFrame, which contains one row per treated observation with:\n- `tau_hat`: the residualized outcome (actual outcome minus estimated counterfactual)\n- The unit and time columns (using the original column names from the input data, e.g., `unit` and `period`)\n- `rel_time`: relative time since treatment\n- `weight`: aggregation weight — `1/n_valid` for observations with finite `tau_hat`, `0` for NaN rows (e.g., rank-deficient cases)\n\nThis enables granular analysis: examining which units or periods drive the aggregate effect, detecting outliers, or constructing custom aggregation schemes."
110
100
},
111
101
{
112
102
"cell_type": "code",
@@ -125,15 +115,7 @@
125
115
{
126
116
"cell_type": "markdown",
127
117
"metadata": {},
128
-
"source": [
129
-
"## Comparison with Other Estimators\n",
130
-
"\n",
131
-
"TwoStageDiD and ImputationDiD produce **identical point estimates** because both estimate fixed effects on untreated observations and use them to residualize outcomes. The key difference is the variance estimator: TwoStageDiD uses the GMM sandwich from Butts & Gardner (2022), while ImputationDiD uses the conservative variance from Borusyak et al. (2024, Theorem 3).\n",
132
-
"\n",
133
-
"CallawaySantAnna uses a fundamentally different estimation approach — computing group-time ATT(g,t) effects via outcome regression, IPW, or doubly robust methods, then aggregating — so point estimates may differ, especially under heterogeneous effects. Its standard errors come from an analytical multiplier bootstrap on the influence function.\n",
134
-
"\n",
135
-
"*Note: Tutorial 11 compared ImputationDiD against CallawaySantAnna and SunAbraham. Here we focus on the TwoStageDiD vs ImputationDiD point-estimate identity, with CallawaySantAnna as a widely used reference point. For SunAbraham comparisons, see Tutorial 11.*"
136
-
]
118
+
"source": "## Comparison with Other Estimators\n\nTwoStageDiD and ImputationDiD produce **identical point estimates** because both estimate fixed effects on untreated observations and use them to residualize outcomes. The key difference is the variance estimator: TwoStageDiD uses the GMM sandwich from Butts & Gardner (2022), while ImputationDiD uses the conservative variance from Borusyak et al. (2024, Theorem 3).\n\nCallawaySantAnna uses a fundamentally different estimation approach — computing group-time ATT(g,t) effects via outcome regression, IPW, or doubly robust methods, then aggregating — so point estimates may differ, especially under heterogeneous effects. It uses analytical influence-function standard errors by default, with optional multiplier bootstrap when `n_bootstrap > 0`.\n\n*Note: Tutorial 11 compared ImputationDiD against CallawaySantAnna and SunAbraham. Here we focus on the TwoStageDiD vs ImputationDiD point-estimate identity, with CallawaySantAnna as a widely used reference point. For SunAbraham comparisons, see Tutorial 11.*"
0 commit comments