Difference in Differences
Learn about the difference in differences method for causal inference.
StartDifference in Differences for Causal Inference
Lesson 1 of 1
- 1Imagine 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…
- 2Let’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…
- 3It 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…
- 4We 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…
- 5Normally 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…
- 6One 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…
- 7While 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…
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