diff_diff.DCDHBootstrapResults#
- class diff_diff.DCDHBootstrapResults[source]#
Bases:
objectResults from ChaisemartinDHaultfoeuille (dCDH) multiplier bootstrap inference.
The bootstrap is a library extension beyond the dCDH papers, which propose only the analytical cohort-recentered plug-in variance from Web Appendix Section 3.7.3 of the dynamic companion paper. Provided for consistency with CallawaySantAnna / ImputationDiD / TwoStageDiD.
Per-target SE / CI / p-value are populated for the three scalar dCDH estimands implemented in Phase 1: overall (
DID_M), joiners (DID_+), and leavers (DID_-). When a target is not available in the underlying data (e.g., no leavers), the matching fields areNone.Phase 1 per-period placebo (L_max=None) bootstrap is NOT computed. The dynamic companion paper Section 3.7.3 derives the cohort-recentered analytical variance for
DID_lonly, not for the per-periodDID_M^pl. Theplacebo_se/placebo_ci/placebo_p_valuefields below remainNonefor Phase 1. Multi-horizon placebos (L_max >= 1) have valid SE viaplacebo_horizon_ses- this is a library extension applying the same IF/variance structure to the placebo estimand (see REGISTRY.md dynamic placebo SE Note).- placebo_se#
Nonefor the Phase 1 single-period placebo (L_max=None). Multi-horizon placebo bootstrap SE is onplacebo_horizon_ses.- Type:
float, optional
- placebo_p_value#
Nonefor single-period placebo. Seeplacebo_horizon_p_values.- Type:
float, optional
- bootstrap_distribution#
Full bootstrap distribution of the overall
DID_Mestimator (shape:(n_bootstrap,)). Stored for advanced diagnostics; suppressed from__repr__.- Type:
np.ndarray, optional
Methods
__init__(n_bootstrap, weight_type, alpha, ...)Attributes
cband_crit_valueevent_study_cisevent_study_p_valuesevent_study_sespath_cband_crit_valuespath_cband_n_valid_horizonspath_cispath_p_valuespath_placebo_cispath_placebo_p_valuespath_placebo_sespath_sesplacebo_horizon_cisplacebo_horizon_p_valuesplacebo_horizon_ses- __init__(n_bootstrap, weight_type, alpha, overall_se, overall_ci, overall_p_value, joiners_se=None, joiners_ci=None, joiners_p_value=None, leavers_se=None, leavers_ci=None, leavers_p_value=None, placebo_se=None, placebo_ci=None, placebo_p_value=None, bootstrap_distribution=None, event_study_ses=None, event_study_cis=None, event_study_p_values=None, placebo_horizon_ses=None, placebo_horizon_cis=None, placebo_horizon_p_values=None, cband_crit_value=None, path_ses=None, path_cis=None, path_p_values=None, path_placebo_ses=None, path_placebo_cis=None, path_placebo_p_values=None, path_cband_crit_values=None, path_cband_n_valid_horizons=None)#
- Parameters:
n_bootstrap (int)
weight_type (str)
alpha (float)
overall_se (float)
overall_p_value (float)
joiners_se (float | None)
joiners_p_value (float | None)
leavers_se (float | None)
leavers_p_value (float | None)
placebo_se (float | None)
placebo_p_value (float | None)
bootstrap_distribution (ndarray | None)
cband_crit_value (float | None)
path_cis (Dict[Tuple[int, ...], Dict[int, Tuple[float, float]]] | None)
path_p_values (Dict[Tuple[int, ...], Dict[int, float]] | None)
path_placebo_ses (Dict[Tuple[int, ...], Dict[int, float]] | None)
path_placebo_cis (Dict[Tuple[int, ...], Dict[int, Tuple[float, float]]] | None)
path_placebo_p_values (Dict[Tuple[int, ...], Dict[int, float]] | None)
path_cband_crit_values (Dict[Tuple[int, ...], float] | None)
path_cband_n_valid_horizons (Dict[Tuple[int, ...], int] | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#