I still remember when the bacon decomposition clicked for me. I had worked through the paper backwards and forwards. The mixtape was under contract, and I knew I had a short window to get on top of this paper that I could immediately tell was going to be influential. It was the weights. It was working through the Frisch-Waugh-Lovell steps and getting to those weighted 2x2s. That was the first moment.
But then the second moment was a simulation that andrew baker wrote for his blog which has staggered roll out with a panel of a thousand firms. No never treated, very dynamic treatment effects, and the effects were known. I studied that simulation backwards and forwards.
And that’s how I learn I think. I learn through pencil and paper, code, simulations, application, repeat. Doing things. Particularly simple simulations — things that are only about one thing so that I can see that one thing clear as day.
Well I haven’t had that happen yet with Callaway, Goodman-Bacon and Sant’Anna’s new continuous paper. I’ve read it a lot, and I feel like I know the parameters really well, and I understand the selection bias conceptually. But I haven’t had that ah hah experience yet. And I don’t know the new estimator super well either.
So what I’ve decided to do is do a series on here where I’ll be teaching myself continuous did using Claude code. I will be trying to create the TWFE decomposition myself, and I will likely try to make a shiny app, as well as Stata and R package for it too. Even if it doesn’t quite work out, I think it’ll help me because I think I need to know this paper inside and out if only because continuous treatments are common, and to be honest they are also fun. It’s fun to learn new things. So I will.
So I am going to be doing that here. After 38 Claude code entries, I think I may just quit numbering them altogether. And I’m going back to my original idea I had all along which is that I am going to share about Claude code by using it for things. If this is helpful for others, which I’m hoping learning to create econometrics packages will be, then I welcome you to come do it with me!
I have other series I’ll be doing too on Claude code. One of them is about using the time stamps in the metadata of our files and folders to try and unearth forgotten events in our old projects. But I’m going to start here with continuous did, as I think there’s a lot of people that want help learning it, and there’s a lot of people that might want to do these exercises with me.
You will almost certainly learn this faster than me! I hope if you do, you’ll leave comments though, and share with one another. If you have a great simulation or something, post it in the comments. And I just see it as us trying to learn this paper well and have fun using Claude code to do it. I have a few continuous dosage datasets we will use too.
Here’s the paper. It’s conditionally accepted at AER. And there’s an R package too. I don’t know if the TWFE decomposition is in there though. I also have some ideas for covariates that I’m wanting to take us through. And we are going to do simulations. It won’t be a class so much as it’ll just be me doing my thing, you doing your thing, and then we can chat on here and whatever.
So maybe start reading the paper? Try to really learn the parameters as well as you can, and particularly the notation. And the selection bias. The strong parallel trends part has to do with the estimator they’re going to propose, so for now I’m thinking learn the core building blocks, see if you can’t learn the ACRT really well, and then let’s try to focus on the TWFE weights. Thats the notation I’ve not loved yet, but it’s because I haven’t done the close study yet.
Thanks! I’m excited about this. My goal is to completely master this paper backwards and forwards. I’m super busy, so I’ll have to make beautiful decks, tear down and build up how I do it, and so on. I haven’t decided the best way to organize everything but I will. At minimum I have my own repo I’m working on for the TWFE decomposition that I’ll share but I think you should make your own too tbh. And it’ll be fun.


