GradedInterventionTimeSeries.plot_effect#

GradedInterventionTimeSeries.plot_effect(effect_result, **kwargs)[source]#

Plot counterfactual effect analysis results.

Creates a 2-panel figure showing: 1. Observed vs counterfactual outcome 2. Cumulative effect over time

Parameters:

effect_result (dict) – Result dictionary from effect() method containing: - effect_df: DataFrame with observed, counterfactual, effect columns - window_start, window_end: Effect window boundaries - channels: List of scaled channels - scale: Scaling factor used - total_effect: Total effect in window - mean_effect: Mean effect per period in window

Returns:

  • fig (matplotlib.figure.Figure)

  • ax (array of matplotlib.axes.Axes) – Array of 2 axes objects (top: observed vs counterfactual, bottom: cumulative effect).

Return type:

Tuple[Figure, ndarray]

Examples

# Estimate effect of removing treatment
effect_result = result.effect(
    window=(df.index[0], df.index[-1]),
    channels=["comm_intensity"],
    scale=0.0,
)
fig, ax = result.plot_effect(effect_result)