Universidad Carlos III de Madrid - UC3M

Portada del sitio > Asignaturas / Teaching > Trabajo de Fin de Grado (TFG). Grado en Economía > Materiales útiles para realizar el TFG > Modelos Diff-in-diff (DID) > Getting Started with the did Package

Getting Started with the did Package

Authors: Brantly Callaway and Pedro H.C. Sant’Anna 2022-07-19. Source: vignettes/did-basics.Rmd

Miércoles 14 de junio de 2023, por Carlos San Juan

This vignette discusses the basics of using Difference-in-Differences (DiD) designs to identify and estimate the average effect of participating in a treatment with a particular focus on tools from the did package. The background article for it is Callaway and Sant’Anna (2021), “Difference-in-Differences with Multiple Time Periods”.

The did package allows for multiple periods and variation in treatment timing

The did package allows the parallel trends assumption to hold conditional on covariates.

Treatment effect estimates coming from the did package do not suffer from any of the drawbacks associated with two-way fixed effects regressions or event study regressions when there are multiple periods / variation in treatment timing.

The did package can deliver disaggregated group-time average treatment effects as well as event-study type estimates (treatment effects parameters corresponding to different lengths of exposure to the treatment) and overall treatment effect estimates.

Getting Started with the did Package. Callaway and Sant’Anna. 2022



Examples with simulated data

Estimating Group-Time Average Treatment Effects

Other features of the did package

An example with real data

Common Issues with the did package


Seguir la vida del sitio RSS 2.0 | Mapa del sitio | Espacio privado | SPIP | Contacto: csm@eco.uc3m.es