estimate_changes_in_changes_effects
distributional_did.estimate_changes_in_changes_effects(
ds: pl.DataFrame,
outcome: ColumnName,
treatment_group: ColumnName | TrtGroupConfig,
time: ColumnName,
unit: ColumnName,
qs: ArrayLike = MEDIAN,
*,
weights: ColumnName | None = None,
n_anticipation_periods: int = 0,
base_period: BasePeriod = BasePeriod.UNIVERSAL,
control_group: ControlGroup = ControlGroup.NEVER_TREATED,
bootstrap_config: BootstrapConfig | int = 1000,
)Estimate quantile treatment effects with changes-in-changes.
Changes-in-changes compares individuals across groups by their outcomes and over time by their quantiles. It requires a time-invariant, strictly increasing production function mapping unobservables to outcomes, and thus rank invariance; the distribution of unobservables may differ between the treated and untreated groups. Returns the group, event-study, overall and group-time effects.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ds | polars.DataFrame |
Panel data in long format. | required |
| outcome | ColumnName |
Name of the outcome column. | required |
| treatment_group | ColumnName or TrtGroupConfig |
Column holding the first treatment period of a unit. A plain string treats the column as already coded with inf for never-treated units; a TrtGroupConfig maps a custom never-treated value to inf. |
required |
| time | ColumnName |
Name of the time period column. | required |
| unit | ColumnName |
Name of the unit identifier column. | required |
| qs | array_like |
Quantiles in (0, 1) at which to estimate the effects. |
0.5 |
| weights | ColumnName |
Name of a column with sampling weights. | None |
| n_anticipation_periods | int |
Number of periods before treatment in which units may anticipate it. | 0 |
| base_period | BasePeriod |
Pre-treatment period used for the comparisons. | BasePeriod.UNIVERSAL |
| control_group | ControlGroup |
Comparison group used for the counterfactual. | ControlGroup.NEVER_TREATED |
| bootstrap_config | BootstrapConfig or int |
Bootstrap settings, or the number of replications. | 1000 |
Returns
| Name | Type | Description |
|---|---|---|
DistributionalDidResults |
The group, event-study, overall and group-time effects. |
See Also
estimate_quantile_did_effects Compares individuals across both groups and time by their quantiles.
References
Athey, Susan and Guido Imbens. “Identification and Inference in Nonlinear Difference-in-Differences Models.” Econometrica 74(2), pp. 431-497, 2006.