plot_rdd_design

rdd.plot_rdd_design(
    ds: pl.DataFrame,
    outcome: ColumnName,
    running: RunningVariableConfig,
    *,
    n_bins: int = 30,
    local_polynomial_config: LocalPolynomialConfig | None = None,
    show_fit: bool = True,
)

Plot the outcome against the running variable around the cutoff.

The chart shows binned outcome means on either side of the cutoff and, optionally, local-linear fits. Supplying bandwidth shades the estimation window and restricts the fitted lines to it.

Parameters

Name Type Description Default
ds polars.DataFrame Input data. required
outcome ColumnName Name of the outcome column. required
running RunningVariableConfig Running variable and cutoff. required
n_bins int Number of bins on each side of the cutoff. 30
local_polynomial_config LocalPolynomialConfig Bandwidth and kernel for the local-linear fits. When omitted, the fits use the full support on each side and no bandwidth is shaded. None
show_fit bool Whether to draw the local-linear fits. True

Returns

Name Type Description
altair.Chart Design plot of the outcome against the running variable.