StaggeredDifferenceInDifferences.plot#
- StaggeredDifferenceInDifferences.plot(*, hdi_prob=None, figsize=(10, 6), show=True, legend_kwargs=None)[source]#
Plot the staggered difference-in-differences event study.
- Parameters:
hdi_prob (
float|None) – Probability mass of the highest density interval shown by the error bars. Unlike most other CausalPy experiments,hdi_probfor staggered DiD is fixed at fit time during effect aggregation and the resulting bounds are cached on the instance. If supplied here, the value must match the cachedhdi_prob_; otherwise aValueErroris raised. PassNone(the default) to plot using the cached value. Ignored for OLS models.figsize (
tuple[float,float]) – Width and height of the figure in inches, passed tomatplotlib.pyplot.subplots(). Defaults to(10, 6).show (
bool) – Whether to automatically display the plot. Defaults toTrue.legend_kwargs (
dict[str,Any] |None) – Keyword arguments to adjust legend placement and styling. Supported keys:loc,bbox_to_anchor,fontsize,frameon,title(bbox_transformis accepted alongsidebbox_to_anchor). The existing legend is modified in place so that custom handles are preserved.
- Returns:
fig (matplotlib.figure.Figure) – The figure that was created.
ax (list[matplotlib.axes.Axes]) – A single-element list containing the event-study axes.
- Return type: