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

diagnostics

Submodule causalis.scenarios.iv.refutation.diagnostics with no child pages and 8 documented members.

Functions

Jump directly into the documented functions for this page.

7 items

Data

Jump directly into the documented data for this page.

1 items
function
causalis.scenarios.iv.refutation.diagnostics.compute_instrument_overlap_diagnostics

compute_instrument_overlap_diagnostics

Compute instrument propensity/overlap diagnostics from IV diagnostic data.

Canonical target

causalis.scenarios.iv.refutation.diagnostics.compute_instrument_overlap_diagnostics

Link to this symbol
function
causalis.scenarios.iv.refutation.diagnostics.compute_first_stage_diagnostics

compute_first_stage_diagnostics

Compute controlled first-stage diagnostics: D ~ 1 + Z + X.

Canonical target

causalis.scenarios.iv.refutation.diagnostics.compute_first_stage_diagnostics

Link to this symbol
function
causalis.scenarios.iv.refutation.diagnostics.compute_reduced_form_diagnostics

compute_reduced_form_diagnostics

Compute simple reduced-form diagnostics: Y ~ 1 + Z.

Canonical target

causalis.scenarios.iv.refutation.diagnostics.compute_reduced_form_diagnostics

Link to this symbol
function
causalis.scenarios.iv.refutation.diagnostics.instrument_overlap

instrument_overlap

Return instrument propensity/overlap diagnostics for an IV result.

Checks how well the instrument can be predicted from covariates and whether there is sufficient overlap in instrument assignment.

Parameters

resultIIVM or IVCausalEstimate

The fitted IV model or its estimation result.

Returns

pd.DataFrame

A table with diagnostic metrics (AUC, KS, ESS ratio).

Examples

Assuming ‘result’ is obtained from model.estimate()

Canonical target

causalis.scenarios.iv.refutation.diagnostics.instrument_overlap

Sections

ParametersReturnsExamples
Link to this symbol
function
causalis.scenarios.iv.refutation.diagnostics.first_stage

first_stage

Return first-stage diagnostics for an IV result.

Checks the strength of the relationship between the instrument and the treatment. A weak first stage (F-statistic < 10 or similar) can lead to biased and unstable IV estimates.

Parameters

resultIIVM or IVCausalEstimate

The fitted IV model or its estimation result.

Returns

pd.DataFrame

A table with first-stage metrics (Effect, F-statistic, Partial R2, etc.).

Examples

Assuming ‘result’ is obtained from model.estimate()

Canonical target

causalis.scenarios.iv.refutation.diagnostics.first_stage

Sections

ParametersReturnsExamples
Link to this symbol
function
causalis.scenarios.iv.refutation.diagnostics.reduced_form

reduced_form

Return reduced-form sanity diagnostics for an IV result.

The reduced form is the regression of the outcome on the instrument.
Under the IV assumptions, the LATE is the ratio of the reduced-form
effect to the first-stage effect.

.. math::

            heta = 

rac{\mathbb{E}[Y|Z=1] - \mathbb{E}[Y|Z=0]}{\mathbb{E}[D|Z=1] - \mathbb{E}[D|Z=0]}

Parameters
----------
result : IIVM or IVCausalEstimate
    The fitted IV model or its estimation result.

Returns
-------
pd.DataFrame
    A table with reduced-form metrics.

Examples
--------
>>> from causalis.scenarios.iv.refutation import reduced_form
>>> # Assuming 'result' is obtained from model.estimate()
>>> reduced_form(result)

Canonical target

causalis.scenarios.iv.refutation.diagnostics.reduced_form

Link to this symbol
function
causalis.scenarios.iv.refutation.diagnostics.instrument_overlap_plot

instrument_overlap_plot

Plot instrument propensity distributions by observed instrument group.

Visualizes the overlap of P(Z=1X)\mathbb{P}(Z=1|X) between the Z=0Z=0 and Z=1Z=1 groups. Good overlap is essential for reliable IV estimation.

Parameters

resultIIVM or IVCausalEstimate

The fitted IV model or its estimation result.

binsstr or int, default “fd”

Binning strategy for histograms.

axmatplotlib.axes.Axes, optional

Pre-existing axes to plot on.

figsizetuple, default (8.0, 4.5)

Figure size.

dpiint, default 150

Resolution.

savestr, optional

Path to save the figure.

Returns

matplotlib.figure.Figure

The generated figure.

Canonical target

causalis.scenarios.iv.refutation.diagnostics.instrument_overlap_plot

Sections

ParametersReturns
Link to this symbol
data
causalis.scenarios.iv.refutation.diagnostics.__all__

__all__

Value: ['compute_first_stage_diagnostics', 'compute_instrument_overlap_diagnostics', 'compute_reduced_form_...

[‘compute_first_stage_diagnostics’, ‘compute_instrument_overlap_diagnostics’, ‘compute_reduced_form_…

Canonical target

causalis.scenarios.iv.refutation.diagnostics.__all__

Link to this symbol