empirical-methods

Homepage for 17-803 "Empirical Methods" at Carnegie Mellon University


Project maintained by bvasiles Hosted on GitHub Pages — Theme by mattgraham

L19: Diff-in-Diff & CausalImpact (slides, video)

Lecture19-Diff-in-Diff

In this last lecture in the regression / quantitative analysis series, we talked about two popular causal inference techniques for evaluating the effects of an intervention.

Difference-in-differences (or diff-in-diff) is a classic statistical technique used in econometrics and quantitative research in the social sciences that attempts to mimic an experimental research design using observational study data, by studying the differential effect of a treatment on a ‘treatment group’ versus a ‘control group’ in a natural experiment. It calculates the effect of a treatment (i.e., an explanatory variable or an independent variable) on an outcome (i.e., a response variable or dependent variable) by comparing the average change over time in the outcome variable for the treatment group, compared to the average change over time for the control group.

CausalImpact is a modern approach to estimating the causal effect of a designed intervention on a time series. Given a response time series (e.g., clicks) and a set of control time series (e.g., clicks in non-affected markets or clicks on other sites), the CausalImpact R package constructs a Bayesian structural time-series model. This model is then used to try and predict the counterfactual, i.e., how the response metric would have evolved after the intervention if the intervention had never occurred. For a quick overview, watch the tutorial video. For details, see: Brodersen et al., Annals of Applied Statistics (2015).

Example Papers

Yang, L., Jaffe, S., Holtz, D., Suri, S., Sinha, S., Weston, J., … & Teevan, J. (2020). How Work From Home Affects Collaboration: A Large-Scale Study of Information Workers in a Natural Experiment During COVID-19. arXiv preprint arXiv:2007.15584.

Lecture Readings

Diff-in-diff lecture from the Foundations of Program Evaluation III course

The source for the diff-in-diff example I used in class.


Rajendran, P. Causal Inference using Difference in Differences, Causal Impact, and Synthetic Control.

Another useful tutorial on diff-in-diff.


Wing, C., Simon, K., & Bello-Gomez, R. A. (2018). Designing difference in difference studies: best practices for public health policy research. Annual review of public health, 39.

The paper explains the key assumptions of the diff-in-diff design and discusses analytic tactics, supplementary analysis, and approaches to statistical inference that are often important in applied research.

Additional Readings

Two good textbooks on causal inference, including the techniques above.

Gertler, P. J., Martinez, S., Premand, P., Rawlings, L. B., & Vermeersch, C. M. (2016). Impact evaluation in practice. The World Bank.

Pearl, J., Glymour, M., & Jewell, N. P. (2016). Causal inference in statistics: A primer. John Wiley & Sons.