BasePeriod
class BasePeriod(StrEnum):
UNIVERSAL = 'universal'
VARYING = 'varying'Pre-treatment period the post-treatment effect is compared to.
Use a member as the base_period argument of estimate_nonlinear_did_for_panel.
Attributes
| Name | Type | Description |
|---|---|---|
| UNIVERSAL | Always compare to the same, earliest pre-treatment period. | |
| VARYING | Compare to the immediately preceding pre-treatment period. |
Examples
Compare each period to the immediately preceding one:
>>> from qte.datasets import load_mpdta
>>> from qte.nonlinear_did import BasePeriod, estimate_nonlinear_did_for_panel
>>> res = estimate_nonlinear_did_for_panel(
... load_mpdta(),
... "lemp",
... "first.treat",
... "year",
... "countyreal",
... base_period=BasePeriod.VARYING,
... )