UnconditionalLocalQteResult

iv.UnconditionalLocalQteResult(
    qtt: pl.DataFrame,
    att: pl.DataFrame,
    outcome: ColumnName,
    group: tuple[str, ...] | None,
    complier_share: float,
    first_stage: float,
    estimator: Estimator,
    instrument_probability: InstrumentProbabilityResult,
)

Result of a local quantile treatment effect estimation.

Use plot, tabulate, summarize or get_as_dataframe to present the estimates. Instances are returned by estimate_unconditional_local_effects; the constructor is not part of the public API.

Attributes

Name Type Description
qtt polars.DataFrame Quantile-specific effects, one row per quantile.
att polars.DataFrame Average effects for compliers (the local average treatment effect).
outcome ColumnName Outcome variable the effect was estimated for.
group tuple[str, …] or None Columns the estimates are grouped by.
complier_share float Estimated share of compliers, E[kappa].
first_stage float Difference in treatment take-up between instrument arms, E[D \| Z = 1] - E[D \| Z = 0].
estimator Estimator Weighting scheme used to estimate the effects.
instrument_probability InstrumentProbabilityResult Fitted logit model for the instrument probability. Without an instrument_probability_formula this is the intercept-only model.

Methods

Name Description
get_as_dataframe Return the quantile effects with confidence interval columns.
plot Plot the quantile and average effects with confidence intervals.
summarize Render a rich text summary of the estimates.
tabulate Build a Great Tables table of the estimates.

get_as_dataframe

iv.UnconditionalLocalQteResult.get_as_dataframe(alpha: float = 0.95)

Return the quantile effects with confidence interval columns.

Parameters

Name Type Description Default
alpha float Confidence level of the intervals. 0.95

Returns

Name Type Description
polars.DataFrame Quantile effects with ci_lb and ci_ub columns.

plot

iv.UnconditionalLocalQteResult.plot(
    alpha: float = 0.95,
    quantiles: ArrayLike | None = None,
    highlight_quantiles: Sequence[float] | None = None,
)

Plot the quantile and average effects with confidence intervals.

Parameters

Name Type Description Default
alpha float Confidence level of the intervals. 0.95
quantiles array_like Quantiles to display. None shows all of them. None
highlight_quantiles array_like Quantiles at which to draw point markers on the full quantile line. None draws markers at every displayed quantile. None

Returns

Name Type Description
altair.Chart Altair chart of the estimates.

summarize

iv.UnconditionalLocalQteResult.summarize(
    alpha: float = 0.95,
    quantiles: ArrayLike | None = None,
)

Render a rich text summary of the estimates.

Parameters

Name Type Description Default
alpha float Confidence level of the intervals. 0.95
quantiles array_like Quantiles to display. None shows all of them. None

Returns

Name Type Description
rich.console.Group Rich renderable for terminals and notebooks.

tabulate

iv.UnconditionalLocalQteResult.tabulate(
    alpha: float = 0.95,
    quantiles: ArrayLike | None = None,
)

Build a Great Tables table of the estimates.

Parameters

Name Type Description Default
alpha float Confidence level of the intervals. 0.95
quantiles array_like Quantiles to display. None shows all of them. None

Returns

Name Type Description
great_tables.GT Formatted table of the estimates.