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_changes_in_changes_effects.

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.distributional_did import BasePeriod, TrtGroupConfig, estimate_changes_in_changes_effects
>>> res = estimate_changes_in_changes_effects(
...     load_mpdta(),
...     "lemp",
...     TrtGroupConfig("first.treat", 0),
...     "year",
...     "countyreal",
...     base_period=BasePeriod.VARYING,
...     bootstrap_config=2,
... )