Scott's Mixtape Substack

Scott's Mixtape Substack

Share this post

Scott's Mixtape Substack
Scott's Mixtape Substack
Mixtape University series: Diff-in-diff with a checklist. Understanding the No Anticipation Violation
Mixtape University

Mixtape University series: Diff-in-diff with a checklist. Understanding the No Anticipation Violation

scott cunningham's avatar
scott cunningham
Mar 30, 2025
∙ Paid
8

Share this post

Scott's Mixtape Substack
Scott's Mixtape Substack
Mixtape University series: Diff-in-diff with a checklist. Understanding the No Anticipation Violation
1
Share

Each Sunday, I try to post a new set of videos, usually around 15-20 minutes in length, for a library of instructional videos about causal inference. These are only accessible to paying subscribers, and in the limit, there’ll be a bazillion of them.

Right now, though, I’m focused on transferring all of my workshop material on difference-in-differences to the substack so that people who want to have more instruction about that popular quasi-experimental method can have it.

In the first video, I’m going to walk you through precisely where “no anticipation” enters into the diff-in-diff equation. I’ll also walk you through my four steps of deriving all these bias and causality terms in diff-in-diff. They are:

  1. Write down the diff-in-diff equation as a simple 2x2

  2. Replace each average outcome with its potential outcome depending on if it’s treated or not for that group-time period

  3. Add a zero, expressed as E[Y(0] - E[Y(0], corresponding to each E[Y(1)] term in the diff-in-diff equation

  4. Rearrange until you have DiD = ATT + parallel trends + whatever biases are left over

I walk us through that in the first video using my iPad and Apple Pencil so that you can just see it all done in handwriting. It takes around 15 minutes, but at the end of it, you’ll see precisely the substitutions I’m describing, as well as the role that no anticipation is playing. You’ll also hopefully better understand what precisely no anticipation means, but also does not necessarily mean. And the second video is three simulations in Stata, R and python, all of which are available on GitHub if you want to practice with them yourself.

Finally, at the end, I also have embedded a custom GPT for you. It’s been trained, more or less, to be a tutor about diff-in-diff, and specifically the content of this. It also has the three simulations in Stata, R and python, and it should be able to run the python code for you if you ask. It’ll try to help answer every question that you have.

Thanks again everyone for your support! I hope you find these videos helpful for you as you continue to invest in an understanding of potential outcomes, causal inference and specifically difference-in-differences.

Keep reading with a 7-day free trial

Subscribe to Scott's Mixtape Substack to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 scott cunningham
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share