moderndid.plots.plot_dose_response#
- moderndid.plots.plot_dose_response(result: DoseResult, effect_type: Literal['att', 'acrt'] = 'att', show_ci: bool = True, ref_line: float | None = 0, xlab: str | None = None, ylab: str | None = None, title: str | None = None, **_kwargs: Any) ggplot[source]#
Plot dose-response function for continuous treatment.
- Parameters:
- result
DoseResult Continuous treatment dose-response result.
- effect_type{‘att’, ‘acrt’}, default=’att’
Type of effect to plot: - ‘att’: Average Treatment Effect on Treated - ‘acrt’: Average Causal Response on Treated (marginal effect)
- show_cibool, default=True
Whether to show confidence bands.
- ref_line
floatorNone, default=0 Y-value for reference line. Set to None to hide.
- xlab
str, optional X-axis label. Defaults to “Dose”.
- ylab
str, optional Y-axis label. Defaults based on effect_type.
- title
str, optional Plot title. Defaults based on effect_type.
- result
- Returns:
plotnine.ggplotA plotnine ggplot object that can be further customized.