PlaceboInSpace.plot_mspe_ratio#

static PlaceboInSpace.plot_mspe_ratio(check_result, *, title='Placebo-in-space: post/pre MSPE ratio', figsize=(7.0, 8.0), show_pvalue=True)[source]#

Plot the post/pre MSPE ratio of every unit, treated unit highlighted.

This is the inferential view recommended in Abadie, Diamond and Hainmueller (2010), section 3.4 and Figure 8, and the ratio is theirs unchanged: mean squared prediction error after the intervention over mean squared prediction error before it. A unit with a large ratio tracks its synthetic control closely before the intervention and diverges after it, which is the signature of either a real effect or a structural break. Inference is the permutation rank of the treated unit’s ratio within the donor distribution, so the treated unit standing out is the evidence, not the size of the ratio on its own.

Prefer this over the raw effect sizes in check_result.table: a donor whose pre-period fit is poor can show a large post-period divergence without that meaning anything, and dividing by the pre-period MSPE is what removes it.

With several actual treated units, each one is ranked against the placebo units and itself only, never against the other treated units, so one treated unit’s p-value does not depend on the others.

The reference set is every unit whose ratio is defined, infinite ratios included, so the reported p-value is conditional on the units that fitted successfully. Units with an undefined ratio, meaning a failed placebo fit or a zero post-period error over a zero pre-period error, are outside both the figure and the p-value. Infinite ratios count towards the p-value but cannot be drawn on a finite axis, so they are left out of the bars alone.

Parameters:
  • check_result (CheckResult) – Result returned by run(). The bars come from its mspe_ratio column and the highlighted unit(s) from metadata["baseline_mspe"].

  • title (str) – Figure suptitle.

  • figsize (tuple[float, float]) – Size of the drawn figure, in inches.

  • show_pvalue (bool) – Whether to report the permutation p-value of each treated unit as a subtitle.

Returns:

The drawn figure.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If the result carries no mspe_ratio column, or if no unit has a finite ratio to draw.

Warns:

UserWarning – If any unit has an undefined ratio, or a defined but infinite one, and so cannot be drawn, or if show_pvalue is set but the result has no treated-unit baseline to rank.