⚠️ Attention: This package is movedInteractionWeightedDIDs.jl has been migrated to the new location here within the repo for DiffinDiffs.jl. Development will only happen there and this repo is archived.
Regression-based multi-period difference-in-differences with heterogenous treatment effects
This package provides a collection of regression-based estimators and auxiliary tools for difference-in-differences (DID) across multiple treatment groups over multiple time periods. It is a component of DiffinDiffs.jl that can also be used as a standalone package.
Note:
The development of this package is not fully complete. New features and improvements are being added over time.
The baseline empirical environment this package focuses on is the same as the one considered by Sun and Abraham (2020):
- Treatment states are binary, irreversible and sharp.
- Units may receive treatment in different periods in a staggered fashion.
- Treatment effects may evolve over time following possibly heterogenous paths across treated groups.
The parameters of interest include:
- A collection of average treatment effects on each group of treated units in different periods.
- Interpretable aggregations of these group-time-level parameters.
This package is developed with dedication to both the credibility of econometric methodology and high performance for working with relatively large datasets.
The main features are the following:
- Automatic and efficient generation of indicator variables based on empirical design and data coverage.
- Enforcement of an overlap condition based on the parallel trends assumption.
- Fast residualization of regressors from fixed effects via FixedEffects.jl.
- Interaction-weighted DID estimators proposed by Sun and Abraham (2020).
- Cell-level decomposition of coefficient estimates for analytical reconciliation across specifications.
As a component of DiffinDiffs.jl,
it follows the same programming interface shared by all component packages.
In particular, it is benefited from the macros @did
and @specset
that largely simplify the construction of groups of related specifications
and reduce unnecessary repetitions of identical intermediate steps
(e.g., partialling out fixed effects for the same regressors).
Tools for easing the export of estimation results are also being developed.
The package does not enforce the use of a specific estimation procedure and allows some flexibility from the users. However, it is mainly designed to ease the adoption of recent advances in the difference-in-differences literature that overcome certain pitfalls that may arise in scenarios where the treated units get treated in different periods (i.e., the staggered adoption design).
The development of this package is directly based on the following studies:
- Sun and Abraham (2020)
- Unpublished work by the package author
Some other studies are also relevant and have provided inspiration: