estimate_unconditional_local_effects
iv.estimate_unconditional_local_effects(
ds: pl.DataFrame,
outcome: ColumnName,
treatment: ColumnName,
instrument: ColumnName,
qs: ArrayLike = MEDIAN,
*,
instrument_probability_formula: FormulaRhs | None = None,
weights: ColumnName | None = None,
trim: float = _DEFAULT_TRIM,
estimator: Estimator = Estimator.SIGNED,
bootstrap_config: BootstrapConfig | int = 100,
)Estimate the local quantile treatment effect for compliers.
The causal target is the difference between the complier quantiles of the treated and untreated potential outcomes. It is a local effect analogous to the local average treatment effect (LATE), but for quantiles rather than means. Notice further, that the effect is unconditional in the sense that it is not conditional on covariate values but rather applies to the population (of compliers) as a whole.
The effect is obtained using Abadie’s kappa weights:
\[ \begin{aligned} w_1 &= \frac{D Z}{p(X)} - \frac{D (1 - Z)}{1 - p(X)}, \\ w_0 &= \frac{(1 - D)(1 - Z)}{1 - p(X)} - \frac{(1 - D) Z}{p(X)}. \end{aligned} \]
Here \(p(X) = P(Z = 1 \mid X)\), so a formula for the instrument propensity should be supplied.
The weights are not necessarily positive. The estimator argument controls how negative weights are handled. With Estimator.SIGNED, negative weights are retained, which can lead to non-monotone inverse cumulative distribution functions. In that case, inversion uses all values below the relevant quantile rather than, for instance, the value at the first crossing. With Estimator.POSITIVE, the weights are projected on the outcome and treatment, which makes them nonnegative.
The framework requires a binary treatment and a binary instrument.
Standard errors are computed via the case bootstrap.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ds | polars.DataFrame |
Input data. | required |
| outcome | ColumnName |
Name of the outcome column. | required |
| treatment | ColumnName |
Name of the binary treatment column (1 treated, 0 not). |
required |
| instrument | ColumnName |
Name of the binary instrument column (1 encouraged, 0 not). |
required |
| qs | array_like |
Quantiles in (0, 1) at which to estimate the effect. |
0.5 |
| instrument_probability_formula | FormulaRhs |
Right-hand side of the logit model for P(Z = 1 \| X). When omitted, the instrument probability is taken to be constant. |
None |
| weights | ColumnName |
Name of a column with sampling weights. | None |
| trim | float |
Drop observations whose estimated instrument propensity lies outside [trim, 1 - trim]. 0 keeps every observation. |
0.001 |
| estimator | Estimator |
Weighting scheme used to form the complier weights. | Estimator.SIGNED |
| bootstrap_config | BootstrapConfig or int |
Bootstrap settings, or the number of replications. | 100 |
Returns
| Name | Type | Description |
|---|---|---|
UnconditionalLocalQteResult |
Complier quantile effects and the LATE with bootstrap standard errors. |