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
@@ -319,6 +320,12 @@ where weights ŵ_{g,e} = n_{g,e} / Σ_g n_{g,e} (sample share of cohort g at eve
319
320
- Detection: Pivoted QR decomposition with tolerance `1e-07` (R's `qr()` default)
320
321
- Handling: Warns and drops linearly dependent columns, sets NA for dropped coefficients (R-style, matches `lm()`)
321
322
- Parameter: `rank_deficient_action` controls behavior: "warn" (default), "error", or "silent"
323
+
- NaN inference for undefined statistics:
324
+
- t_stat: Uses NaN (not 0.0) when SE is non-finite or zero
325
+
- Analytical inference: p_value and CI also NaN when t_stat is NaN (NaN propagates through `compute_p_value` and `compute_confidence_interval`)
326
+
- Bootstrap inference: p_value and CI computed from bootstrap distribution, may be valid even when SE/t_stat is NaN (only NaN if <50% of bootstrap samples are valid)
327
+
- Applies to overall ATT, per-effect event study, and aggregated event study
328
+
-**Note**: Defensive enhancement matching CallawaySantAnna behavior; R's `fixest::sunab()` may produce Inf/NaN without warning
- Propensity scores near 0/1: trimmed at `pscore_trim` (default 0.01)
430
437
- Empty cells: raises ValueError with diagnostic message
431
438
- Collinear covariates: automatic detection and warning
439
+
- NaN inference for undefined statistics:
440
+
- t_stat: Uses NaN (not 0.0) when SE is non-finite or zero
441
+
- p_value and CI: Also NaN when t_stat is NaN
442
+
-**Note**: Defensive enhancement; reference implementation behavior not yet documented
432
443
433
444
**Reference implementation(s):**
434
445
- Authors' replication code (forthcoming)
@@ -656,6 +667,18 @@ For joint method, LOOCV works as follows:
656
667
657
668
# Diagnostics & Sensitivity
658
669
670
+
## PlaceboTests
671
+
672
+
**Module:**`diff_diff/diagnostics.py`
673
+
674
+
*Edge cases:*
675
+
- NaN inference for undefined statistics:
676
+
-`permutation_test`: t_stat is NaN when permutation SE is zero (all permutations produce identical estimates)
677
+
-`leave_one_out_test`: t_stat, p_value, CI are NaN when LOO SE is zero (all LOO effects identical)
678
+
-**Note**: Defensive enhancement matching CallawaySantAnna NaN convention
679
+
680
+
---
681
+
659
682
## BaconDecomposition
660
683
661
684
**Primary source:**[Goodman-Bacon, A. (2021). Difference-in-differences with variation in treatment timing. *Journal of Econometrics*, 225(2), 254-277.](https://doi.org/10.1016/j.jeconom.2021.03.014)
0 commit comments