diff_diff.placebo_timing_test#

diff_diff.placebo_timing_test(data, outcome, treatment, time, fake_treatment_period, post_periods=None, alpha=0.05, **estimator_kwargs)[source]

Test for pre-treatment effects by moving treatment timing earlier.

Creates a fake “post” indicator using pre-treatment data only, then estimates a DiD model. A significant effect suggests pre-existing differential trends.

Parameters:
  • data (pd.DataFrame) – Panel data.

  • outcome (str) – Outcome variable column.

  • treatment (str) – Treatment indicator column.

  • time (str) – Time period column.

  • fake_treatment_period (any) – Period to use as fake treatment timing (should be a pre-treatment period).

  • post_periods (list, optional) – List of actual post-treatment periods. If None, infers from data.

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

  • **estimator_kwargs – Arguments passed to DifferenceInDifferences.

Returns:

Results of the fake timing placebo test.

Return type:

PlaceboTestResults