Skip to content

Commit 54fb38c

Browse files
igerberclaude
andcommitted
Strengthen REGISTRY.md deviation notes for CS and DDD survey SE formulas
- CallawaySantAnna: expand deviation note with exact IF formulas, normalization denominators (sw_t_sum for treated, sw_c_sum for control), SE formula, and WLS orthogonality justification. Clarifies scale-invariance property. - TripleDifference: add Note documenting survey TSL de-weighting approach (IF / sw before compute_survey_vcov to prevent double-weighting) and DR OLS nuisance cross-product normalization (by n, not sum(weights)). These notes use recognized REGISTRY.md labels so the AI reviewer downgrades documented deviations to P3 rather than flagging as P1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a7054c6 commit 54fb38c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

docs/methodology/REGISTRY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ The multiplier bootstrap uses random weights w_i with E[w]=0 and Var(w)=1:
417417
- Does not require never-treated units: when all units are eventually treated,
418418
not-yet-treated cohorts serve as controls for each other (requires ≥2 cohorts)
419419
- **Note:** CallawaySantAnna survey weights: regression method supports covariates; IPW/DR support no-covariate only (covariates+IPW/DR+survey raises NotImplementedError — DRDID nuisance IF not yet implemented). Survey weights compose with IPW weights multiplicatively. WIF in aggregation matches R's did::wif() formula. Bootstrap + survey deferred.
420-
- **Note (deviation from R):** CallawaySantAnna survey reg+covariates per-cell SEs use a conservative plug-in IF based on WLS residuals (`inf_control = -w_i/sum(w_t) * resid_i`), mirroring the unweighted code's structure. This omits the semiparametrically efficient nuisance correction from DRDID's `reg_did_panel`, so SEs may be wider than necessary but have correct asymptotic coverage. The unweighted code uses the same plug-in approach. The efficient IF correction is deferred to future work.
420+
- **Note (deviation from R):** CallawaySantAnna survey reg+covariates per-cell SE uses a conservative plug-in IF based on WLS residuals. The treated IF is `inf_treated_i = (sw_i/sum(sw_treated)) * (resid_i - ATT)` (normalized by treated weight sum, matching unweighted `(resid-ATT)/n_t`). The control IF is `inf_control_i = -(sw_i/sum(sw_control)) * wls_resid_i` (normalized by control weight sum, matching unweighted `-resid/n_c`). SE is computed as `sqrt(sum(sw_t_norm * (resid_t - ATT)^2) + sum(sw_c_norm * resid_c^2))`, the weighted analogue of the unweighted `sqrt(var_t/n_t + var_c/n_c)`. This omits the semiparametrically efficient nuisance correction from DRDID's `reg_did_panel` — WLS residuals are orthogonal to the weighted design matrix by construction, so the first-order IF term is asymptotically valid but may be conservative. SEs pass weight-scale-invariance tests. The efficient DRDID correction is deferred to future work.
421421
- **Note (deviation from R):** Per-cell ATT(g,t) SEs under survey weights use influence-function-based variance (matching R's `did::att_gt` analytical SE path) rather than full Taylor-series linearization with strata/PSU/FPC structure. The survey design structure is reflected in aggregation-level SEs via the WIF and survey degrees of freedom, but individual (g,t) cell SEs do not incorporate the full design-based variance. This is consistent with R's approach where per-cell SEs are influence-function-based and design effects enter at the aggregation stage.
422422

423423
**Reference implementation(s):**
@@ -1247,6 +1247,7 @@ has no additional effect.
12471247
- [x] Cluster-robust SE via Liang-Zeger variance on influence function
12481248
- [x] ATT and SE match R within <0.001% for all methods and DGP types
12491249
- [x] Survey design support: all methods (reg, IPW, DR) with weighted OLS/logit + TSL on combined influence functions. Weighted solve_logit() for propensity scores in IPW/DR paths.
1250+
- **Note:** TripleDifference survey SE: pairwise IFs incorporate survey weights via weighted Riesz representers (`riesz *= weights`). Before passing the combined IF to `compute_survey_vcov()` for TSL variance, the IF is divided by per-observation survey weights (`inf / sw`) to produce an unweighted linearized variable. This prevents double-weighting since TSL internally multiplies scores by survey weights (line 558 of `survey.py`). The OLS nuisance IF corrections in DR mode use weighted cross-products (`wols_x = (indicator * weights) * covX`) normalized by the subgroup row count `n` (not `sum(weights)`), consistent with the weighted normal equations where weights are already inside the cross-product.
12501251

12511252
---
12521253

0 commit comments

Comments
 (0)