📊 08 - Difference in Differences

Table of Contents

Today’s session

  • Learn how to transform our dataframes from wide to long format with tidyr:pivot_longer()
  • Leverage visualizations with ggplot2 to explore changes between groups and across time
  • Learn how to extract our DiD estimates through manual calculation, first differences, and the regression formulation of the DiD model

Download slides - PDF


Further references

For R and RMarkdown
      Reminder of the basics: https://tinyurl.com/vkebh2f
      RMarkdown: The definitive guide https://tinyurl.com/y4tyfqmg
      Data wrangling with dplyr: https://tinyurl.com/vyrv596
      dplyr video tutorial: https://www.youtube.com/watch?v=jWjqLW-u3hc

For learning more about DAGs and ggdag:

      An Introduction to DAGs: https://ggdag.netlify.com/articles/intro-to-dags.html
      Introduction to ggdag: https://ggdag.netlify.com/articles/intro-to-ggdag.html
      Bias structures: https://ggdag.netlify.com/articles/bias-structures.html

Helpful cheatsheets

      Data visualization with ggplot: https://rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf
      Data wrangling with dplyr and tidyr: https://tinyurl.com/s6zxfqh
      RMarkdown cheatsheet: https://tinyurl.com/uqoelrx


Meet your instructors

Lisa Oswald & Sebastian Ramirez Ruiz