Skip to content
Submodule
causalis.scenarios.iv.refutation.iv_confounders_balance

iv_confounders_balance

Submodule causalis.scenarios.iv.refutation.iv_confounders_balance with no child pages and 2 documented members.

Functions

Jump directly into the documented functions for this page.

1 items

Data

Jump directly into the documented data for this page.

1 items
function
causalis.scenarios.iv.refutation.iv_confounders_balance.iv_confounders_balance

iv_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

pd.DataFrame

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

ParametersReturnsExamples
Link to this symbol
data
causalis.scenarios.iv.refutation.iv_confounders_balance.__all__

__all__

Value: ['iv_confounders_balance']

[‘iv_confounders_balance’]

Canonical target

causalis.scenarios.iv.refutation.iv_confounders_balance.__all__

Link to this symbol