moderndid.plots.plot_event_study#
- moderndid.plots.plot_event_study(result: AGGTEResult | PTEResult | DDDAggResult, show_ci: bool = True, ref_line: float | None = 0, ref_period: float | None = -1, xlab: str | None = None, ylab: str | None = None, title: str | None = None, **_kwargs: Any) ggplot[source]#
Create event study plot for dynamic treatment effects.
- Parameters:
- result
AGGTEResult,PTEResult, orDDDAggResult Aggregated treatment effect result with dynamic/eventstudy aggregation, or PTEResult with event_study attribute.
- show_cibool, default=True
Whether to show confidence intervals as error bars.
- ref_line
floatorNone, default=0 Y-value for reference line. Set to None to hide.
- ref_period
floatorNone, default=-1 X-value for vertical reference period line. Set to None to hide.
- xlab
str, optional X-axis label. Defaults to “Event Time”.
- ylab
str, optional Y-axis label. Defaults to “ATT”.
- title
str, optional Plot title. Defaults based on result type.
- result
- Returns:
plotnine.ggplotA plotnine ggplot object that can be further customized.