diff_diff.run_all_placebo_tests#

diff_diff.run_all_placebo_tests(data, outcome, treatment, time, unit, pre_periods, post_periods, n_permutations=500, alpha=0.05, seed=None, **estimator_kwargs)[source]

Run a comprehensive suite of placebo tests.

Runs fake timing tests for each pre-period, a permutation test, and a leave-one-out sensitivity analysis. If a test fails, the result will be a dict with an “error” key containing the error message.

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.

  • pre_periods (list) – List of pre-treatment periods.

  • post_periods (list) – List of post-treatment periods.

  • n_permutations (int, default=500) – Permutations for permutation test.

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

  • seed (int, optional) – Random seed.

  • **estimator_kwargs – Arguments passed to estimators.

Returns:

Dictionary mapping test names to PlaceboTestResults. Keys: “fake_timing_{period}”, “permutation”, “leave_one_out”

Return type:

dict