InversePropensityWeighting.plot_balance_ecdf#
- InversePropensityWeighting.plot_balance_ecdf(covariate, idata=None, weighting_scheme=None)[source]#
Plot the empirical CDF of a covariate before and after IPW adjustment.
Produces a two-panel figure comparing the raw (unweighted) ECDFs of the treated and control groups with the reweighted ECDFs. This serves as a visual balance diagnostic: well-balanced covariates should show overlapping ECDFs in the right-hand panel.
- Parameters:
covariate (
str) – Name of the covariate column (must be one of the model’s design matrix labels) to check for balance.idata (
InferenceData|None) – ArviZ InferenceData containing posterior propensity score samples. IfNone, usesself.model.idata.weighting_scheme (
str|None) – Weighting scheme to apply. One of'raw','robust', or'overlap'. IfNone, falls back toself.weighting_scheme.
- Returns:
The matplotlib Figure and a list of two Axes objects (raw ECDF on the left, weighted ECDF on the right).
- Return type: