ControlGroup

class ControlGroup(StrEnum):
    NOT_YET_TREATED = 'not_yet_treated'
    NEVER_TREATED = 'never_treated'

Comparison group used for the counterfactual.

Use a member as the control_group argument of estimate_nonlinear_did_for_panel.

Attributes

Name Type Description
NOT_YET_TREATED Units not yet treated at the time period of interest.
NEVER_TREATED Units that are never treated.

Examples

Use not-yet-treated units as the comparison group:

>>> from qte.datasets import load_mpdta
>>> from qte.nonlinear_did import ControlGroup, estimate_nonlinear_did_for_panel
>>> res = estimate_nonlinear_did_for_panel(
...     load_mpdta(),
...     "lemp",
...     "first.treat",
...     "year",
...     "countyreal",
...     control_group=ControlGroup.NOT_YET_TREATED,
... )