Simulations for regression analysis

What is the usefulness of simulations in regression analysis and how to implement them?

Objective

After this session, you should be able to implement a basic simulation for regression analysis in R and use it to test some of the hypotheses you made in you own analysis.

Summary

In this session, we first discuss why we should implement simulations. The basic idea behind simulations is that the Data Generating Process is known: in particular, that allows us to evaluate the performance of our analysis and to study what happens if an hypothesis made does not hold, etc. Simulations can thus be helpful at the design stage of an econometric analysis but can also be leveraged as checks or to build intuition on econometrics mechanisms. To build simulations, one should start with a simple DGP, wondering whether their analysis performs well in a rather “pristine” setting. Then, they can complexify the DGP. In the second part of the lecture, we implement a simulation in R.

Session Outline

  1. What are simulations?
  2. Why do simulations?
    • To understand econometric concepts
    • To design a study
    • For tests and checks
    • As a rhetorical tool
  3. How to implement a simulation?
  4. Coding a simulation in R together

Main take-aways

Main take-aways
  • Whenever we do not understand an econometric mechanism, a simulation can help understand it: plays with simulations, often
  • They are helpful before designing a study, even a non-experimental one but also after the analysis
  • I advise you to use them quasi-systematically
  • They are quite easy to implement

Materials

Open slides in html

Open slides in pdf

App

A small app to explore hurdles through simulations can be found here.

Exercise

During the lecture, we emulate an RCT studying the impact of additional courses on students’ grades, in this document.

In addition, you have a graded assignment for next week.

Specific resources for this lecture

Handbooks chapters

Papers using simulations

  • Bertrand, Duflo, and Mullainathan (2004): a canonical paper, implementing placebo simulations on an actual data set to document the impact of serial correlation on the standard errors
  • Black et al. (2022): implement power simulations building on the concrete case of the expansion of the affordable Care Act Medicaid and provide concrete advice to build such power simulations

References

Bertrand, Marianne, Esther Duflo, and Sendhil Mullainathan. 2004. “How Much Should We Trust Differences-In-Differences Estimates?” The Quarterly Journal of Economics 119 (1): 249–75. https://doi.org/10.1162/003355304772839588.
Black, Bernard, Alex Hollingsworth, Letícia Nunes, and Kosali Simon. 2022. “Simulated Power Analyses for Observational Studies: An Application to the Affordable Care Act Medicaid Expansion.” Journal of Public Economics 213 (September): 104713. https://doi.org/10.1016/j.jpubeco.2022.104713.
Gelman, Andrew, Jennifer Hill, and Aki Vehtari. 2021. Regression and Other Stories.
Huntington-Klein, Nick. 2022. The Effect: An Introduction to Research Design and Causality. 1st edition. Chapman and Hall/CRC.