causalis.scenarios.iv.refutation.iv_confounders_balance.iv_confounders_balanceiv_confounders_balance
Compute confounder balance diagnostics between instrument groups.
Produces a DataFrame containing expanded confounder columns (after one-hot encoding categorical variables if present) with:
confounders: name of the confounder
mean_z_0: mean value for rows with Z=0
mean_z_1: mean value for rows with Z=1
abs_diff: abs(mean_z_1 - mean_z_0)
smd: standardized mean difference (Cohen’s d using pooled std)
ks_pvalue: p-value for the KS test (rounded to 5 decimal places, non-scientific)
Parameters
- dataIVCausalData
The IV causal dataset containing exactly one binary instrument column.
Returns
Balance table sorted by |smd| (descending).
Examples
Assuming ‘causal_data’ is an IVCausalData object
Canonical target
causalis.scenarios.iv.refutation.iv_confounders_balance.iv_confounders_balance
Sections