diff_diff.leave_one_out_test#
- diff_diff.leave_one_out_test(data, outcome, treatment, time, unit, alpha=0.05, **estimator_kwargs)[source]
Assess sensitivity by dropping each treated unit in turn.
For each treated unit, drops that unit and re-estimates the DiD model. Large variation in estimates suggests results are driven by a single unit.
- Parameters:
data (pd.DataFrame) – Panel data.
outcome (str) – Outcome variable column.
treatment (str) – Treatment indicator column.
time (str) – Time period column.
unit (str) – Unit identifier column.
alpha (float, default=0.05) – Significance level.
**estimator_kwargs – Arguments passed to DifferenceInDifferences.
- Returns:
Results with leave_one_out_effects dict mapping unit -> ATT estimate.
- Return type: