diff_diff.leave_one_out_test#

diff_diff.leave_one_out_test(data, outcome, treatment, post=<not supplied>, unit=<not supplied>, alpha=0.05, time=<not supplied>, **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.

  • post (str) – Post-period indicator column (0/1). (time is a deprecated alias; warns with FutureWarning and will be removed in 4.0.)

  • unit (str) – Unit identifier column.

  • alpha (float, default=0.05) – Significance level.

  • **estimator_kwargs – Arguments passed to DifferenceInDifferences.

  • time (Any)

Returns:

Results with leave_one_out_effects dict mapping unit -> ATT estimate.

Return type:

PlaceboTestResults