statsmodels.treatment.treatment_effects.TreatmentEffect.balance_table#

TreatmentEffect.balance_table(exog=None, effect_group='all')[source]#

Compare covariate means before and after inverse probability weighting.

Parameters:
exogarray_like, optional

Two-dimensional finite numeric covariates in the original sample order, with one row per observation. The default is the selection model’s design matrix. DataFrame column names are retained. Categorical covariates must first be encoded numerically.

effect_group{“all”, 0, 1, “treated”, “untreated”, “control”}, optional

Weighting target: "all" (default) for ATE, 1 or "treated" for ATET, and 0, "untreated" or "control" for ATC.

Returns:
DataFrame

One row per covariate, with mean_control, mean_treated, mean_control_weighted, mean_treated_weighted, smd and smd_weighted. Selection-model covariate names are used by default; unnamed supplied columns are labelled x0, x1, etc.

Notes

Weights use the clipped prob_select used by the estimators. Means are normalized separately within each treatment group. SMD is treated minus control mean divided by sqrt((var_treated + var_control) / 2), using unweighted sample variances (ddof=1), the standardized difference of [2]. This same denominator is held fixed before and after weighting, for all weighting targets, see [3]. Binary columns use this same numeric convention rather than population Bernoulli variances. This follows the fixed-scale approach in [1], but does not adopt its target-specific or binary-covariate defaults.

Columns that are constant within both treatment groups, including intercepts, have zero pooled variance and NaN SMDs, also if the means of the two groups differ. At least two observations are required in each treatment group. These descriptive statistics do not certify absence of confounding.

References

[1]

Greifer, N. cobalt: Frequently Asked Questions, “How are standardized mean differences computed in cobalt?” https://ngreifer.github.io/cobalt/articles/faq.html

[2]

Austin, P. C. 2009. Balance diagnostics for comparing the distribution of baseline covariates between treatment groups in propensity-score matched samples. Statistics in Medicine 28 (25): 3083-3107.

[3]

Austin, P. C., and E. A. Stuart. 2015. Moving towards best practice when using inverse probability of treatment weighting (IPTW) using the propensity score to estimate causal treatment effects in observational studies. Statistics in Medicine 34 (28): 3661-3679.