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:
resultDoseResult

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_linefloat or None, default=0

Y-value for reference line. Set to None to hide.

xlabstr, optional

X-axis label. Defaults to “Dose”.

ylabstr, optional

Y-axis label. Defaults based on effect_type.

titlestr, optional

Plot title. Defaults based on effect_type.

Returns:
plotnine.ggplot

A plotnine ggplot object that can be further customized.