diff_diff.StaggeredTripleDifference#
- class diff_diff.StaggeredTripleDifference[source]#
Bases:
_StaggeredTripleDiffEngineMixin,CallawaySantAnnaBootstrapMixin,CallawaySantAnnaAggregationMixin,BaseEstimatorStaggered Triple Difference (DDD) estimator.
Deprecated since version 3.9: Deprecated in 3.9 and removed in 4.0 (ledger row M-013). Use
TripleDifference().fit(..., unit=, time=, first_treat=, partition=), which runs this exact engine. Theeligibility=parameter is namedpartition=there, andcontrol_grouptakes the underscored values"not_yet_treated"/"never_treated". TheSDDDalias is deprecated with the class (row M-064).Computes group-time average treatment effects ATT(g,t) for settings with staggered adoption and a binary eligibility dimension, using the three-DiD decomposition of Ortiz-Villavicencio & Sant’Anna (2025).
Multiple comparison groups are combined via GMM-optimal (inverse-variance) weighting. Event study, group, and overall aggregations are supported.
- Parameters:
estimation_method (str, default="dr") – Estimation method: “dr” (doubly robust), “ipw” (inverse probability weighting), or “reg” (regression adjustment).
alpha (float, default=0.05) – Significance level.
anticipation (int, default=0) – Number of anticipation periods. Must be a non-negative integer;
boolis rejected - validated atfit()(construction stays permissive on this deprecated class).base_period (str, default="varying") – Base period selection: “varying” (consecutive comparisons) or “universal” (always vs g-1-anticipation).
n_bootstrap (int, default=0) – Number of multiplier bootstrap repetitions. 0 disables bootstrap.
bootstrap_weights (str, default="rademacher") – Bootstrap weight distribution: “rademacher”, “mammen”, or “webb”.
seed (int or None, default=None) – Random seed for reproducibility.
cband (bool, default=True) – Whether to compute simultaneous confidence bands.
pscore_trim (float, default=0.01) – Propensity score trimming bound.
cluster (str or None, default=None) – Column name for cluster-robust standard errors.
rank_deficient_action (str, default="warn") – Action for rank-deficient design matrices: “warn”, “error”, “silent”.
epv_threshold (float, default=10) – Minimum events per variable for propensity score logistic regression. A warning is emitted when EPV falls below this threshold.
pscore_fallback (str, default="error") – Action when propensity score estimation fails: “error” (raise) or “unconditional” (fall back to unconditional propensity).
References
Ortiz-Villavicencio, M. & Sant’Anna, P.H.C. (2025). “Better Understanding Triple Differences Estimators.” arXiv:2505.09942v3.
Methods
__init__([estimation_method, control_group, ...])fit(data, outcome, unit, time, first_treat, ...)Fit the staggered triple difference estimator.
get_params([deep])Get estimator parameters (sklearn-compatible).
set_params(**params)Set estimator parameters (sklearn-compatible, transactional).
Attributes
estimation_methodcontrol_groupalphaanticipationbase_periodn_bootstrapcbandpscore_trimclusterrank_deficient_actionepv_thresholdpscore_fallbackis_fitted_bootstrap_weightsseed- __init__(estimation_method='dr', control_group='notyettreated', alpha=0.05, anticipation=0, base_period='varying', n_bootstrap=0, bootstrap_weights='rademacher', seed=None, cband=True, pscore_trim=0.01, cluster=None, rank_deficient_action='warn', epv_threshold=10, pscore_fallback='error')[source]#
- classmethod __new__(*args, **kwargs)#