Pitfalls and Simulation Basics
What are some common pitfalls commonly encountered when doing regression analysis? How can we detect them?
After this session, you should have some ideas about how to avoid some pitfalls in applied economic studies and be able to set up the foundations to implement a basic simulation for regression analysis in R.
Summary
In this session, we first discuss the logistics of the class and present the capabilities of R
. It is a great language, learn it and make nice things with it! Then, we present some pitfalls that we can encounter in applied research: spurious correlation, reverse causality, confounders, model misspecification, external validity, lack of statistical power. We then discuss how to avoid them: you can learn your econometrics, derive maths the maths or what might be more fun, develop some data visualization and run some simulations. Finally we describe how to generate fake data, postulating a DGP and run a simple simulation.
Session Outline
- Introduction, course overview and logistics
- R: why and how?
- Some common pitfalls encountered in applied economics analyses
- Avoiding pitfalls
- Simulations: a basic R example
- Summary
Materials
Exercise
During the lecture, we start the implemention of a simple simulation exercise. We emulate an RCT studying the impact of additional courses on students’ grades.
You can find the document for this exercise here.
Specific resources for this lecture
- A fun website with examples of spurious correlations: https://tylervigen.com/
- An introduction to Directed Acyclic Graphs (DAGs): Chapter 3 of Causal Inference, The Mixtape