diff_diff.plot_group_effects#
- diff_diff.plot_group_effects(results, *, groups=None, figsize=(10, 6), title='Treatment Effects by Cohort', xlabel='Time Period', ylabel='Treatment Effect', alpha=0.05, show=True, ax=None, backend='matplotlib')[source]
Plot treatment effects by treatment cohort (group).
- Parameters:
results (CallawaySantAnnaResults) – Results from CallawaySantAnna estimator.
groups (list, optional) – List of groups (cohorts) to plot. If None, plots all groups.
figsize (tuple, default=(10, 6)) – Figure size.
title (str) – Plot title.
xlabel (str) – X-axis label.
ylabel (str) – Y-axis label.
alpha (float, default=0.05) – Significance level for confidence intervals.
show (bool, default=True) – Whether to call plt.show().
ax (matplotlib.axes.Axes, optional) – Axes to plot on.
backend (str, default="matplotlib") – Plotting backend:
"matplotlib"or"plotly".
- Returns:
The axes object (matplotlib) or figure (plotly).
- Return type:
matplotlib.axes.Axes or plotly.graph_objects.Figure