InstrumentValidityResult
iv.InstrumentValidityResult(
statistic: float,
p_value: float,
alpha: float,
n_boot: int,
boot_stats: np.ndarray,
binding: dict[str, Any] | None,
n: int,
first_stage: float,
outcome: ColumnName,
treatment: ColumnName,
instrument: ColumnName,
weighting: ValidityWeighting,
se_floor: float,
y_grid_size: int,
)Result of the Kitagawa (2015) instrument-validity test.
Use tabulate or summarize to present the test, and get_as_dataframe for the underlying one-row summary. Instances are returned by qte.iv.perform_instrument_validity_test; the constructor is not part of the public API.
Attributes
| Name | Type | Description |
|---|---|---|
| statistic | float |
Kolmogorov–Smirnov test statistic. Larger values are evidence against instrument validity. |
| p_value | float |
Bootstrap p value. |
| alpha | float |
Significance level used for the verdict. |
| n_boot | int |
Number of bootstrap replications. |
| boot_stats | numpy.ndarray |
Bootstrap realizations of the test statistic. |
| binding | dict or None |
Configuration of the most violated interval, with keys z_low, z_high, direction, y_lower and y_upper. |
| n | int |
Number of observations used by the test. |
| first_stage | float |
Difference in treatment take-up between the instrument == 1 and instrument == 0 groups. Negative when the coding runs against the monotonicity direction D(on) >= D(off). |
| outcome | ColumnName |
Outcome variable. |
| treatment | ColumnName |
Binary treatment variable. |
| instrument | ColumnName |
Binary instrument variable. |
| weighting | ValidityWeighting |
Weighting of the test statistic. |
| se_floor | float |
Lower bound for the plug-in standard error in the variance-weighted statistic. |
| y_grid_size | int |
Maximum number of outcome grid points used for the interval search. |
Methods
| Name | Description |
|---|---|
| get_as_dataframe | Return the test result as a one-row polars DataFrame. |
| summarize | Render a rich text summary of the test result. |
| tabulate | Build a Great Tables table of the test result. |
get_as_dataframe
iv.InstrumentValidityResult.get_as_dataframe()Return the test result as a one-row polars DataFrame.
summarize
iv.InstrumentValidityResult.summarize()Render a rich text summary of the test result.
tabulate
iv.InstrumentValidityResult.tabulate()Build a Great Tables table of the test result.