Skip to main content

identify.ImplicationTestResult

Results of testing implied conditional independences against data.

Usage

identify.ImplicationTestResult(
    results,
    alpha,
)

Each row corresponds to one implied independence statement from the DAG, tested via partial correlation. A low p-value indicates that the data are inconsistent with the independence — suggesting the DAG may be missing an edge.

Parameters

results: pd.DataFrame

One row per independence test with columns: x, y, conditioning_set, requested_k, effective_k, rank_collapsed, df, partial_corr, p_value, n_obs, significant. requested_k is the number of conditioning columns that entered the test. That equals the number of named conditioners when each is a single column; a categorical conditioner contributes its indicator columns. effective_k is rank([1, Z]) - 1. For a single-column test df is n_obs - effective_k - 2; a block test reports Rao’s denominator degrees of freedom. effective_k and df are missing when the test was skipped. rank_collapsed is true when an executed test used fewer conditioning columns than requested, or a named conditioner contributed no columns. False on a skip. significant is false on a skip and on a collapsed row: the p-value is still the reduced test, but the column matches n_violations. A collapsed row did not test the independence that was requested.

alpha: float
Significance level used for the significant column.

Attributes

Name Description
n_tests Total rows, including skips and rank-collapsed tests.
n_violations Significant rows that tested the independence that was written down.
violations Significant rows that tested the independence that was written down.

n_tests

Total rows, including skips and rank-collapsed tests.

n_tests: int


n_violations

Significant rows that tested the independence that was written down.

n_violations: int

A rank-collapsed row is not a violation of that independence. significant is false on those rows, so this equals results["significant"].sum() for frames this module builds.


violations

Significant rows that tested the independence that was written down.

violations: pd.DataFrame

Methods

Name Description
to_dataframe() Return the full results as a DataFrame.

to_dataframe()

Return the full results as a DataFrame.

Usage

to_dataframe()