Difference in Differences for Causal Inference
Lesson 1 of 1
  1. 1
    Imagine that a California state law was passed in 2016 that raised the minimum wage beginning in the year 2017. We are interested in what this law’s impact has been on student wages since student j…
  2. 2
    Let’s say we have some data on student wages at the state level in a dataset called wages. It has the following variables: * state: state where the universities are located * year: year the data i…
  3. 3
    It is impossible to know what truly would have happened in California schools if the law had never happened. However, we can look for another state whose average student wages that follow a similar…
  4. 4
    We noted that Toronto may be a good control group for Sydney because the trends in ticket sales follow a similar pattern. This is actually a necessity of DID called the parallel trends assumption…
  5. 5
    Normally we would want to use all the data we have available to us to perform our DID model. However, that type of analysis can be complex. To keep things simple, we are going to focus on a 2x2 ana…
  6. 6
    One way we can estimate the ATT is by comparing the differences in average wages over both time and treatment groups. Let’s view the mean wages for both states for 2016 and 2017 only. # import li…
  7. 7
    While we were able to estimate the ATT through mean differences alone, we can also use linear regression for DID. A simple DID regression model predicts the outcome from the variables for treatment…
  8. 8
    Congratulations! You’ve completed a lesson on the fundamentals of difference in differences for causal inference. Through applied exercises you learned: - DID uses the trend of a control group as a…

What you'll create

Portfolio projects that showcase your new skills

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory