I do a lot of my work with a large dataset that follows several million individuals on a monthly basis for as much as 20 years. Often I want to estimate the impact of some kind of shock or event on the individuals. These are individual-level shocks that potentially can have a different treatment time for each individual. The natural thing to do is to estimate a difference-in-differences/event study specification. Since this is a setting with treatment occurring at different times, best practice is now to estimate one of the many staggered DiD specifications out there.
However, I've found that Stata's new-ish built-in commands hdidregress/xthdidregress are unworkably slow on data like mine. I haven't tried all of the user written packages (such as csdid, wooldid, did_multiplegt etc.), but the ones I have tried are also unworkably slow (like, a week+ of runtime on a fast cloud server to run one regression). The various packages seem to be designed with a state/year or maybe county/year panel in mind, with cross-sectional units in the thousands at most, and work poorly with large data. Perhaps it's just a feature of the underlying methods that they don't scale well.
So, my question: Are there any packages, built-in or user-written, that have reasonable run-times for a staggered difference-in-differences estimation with data that has millions of cross-sectional units, and 100+ time periods with treatments potentially occurring in every calendar time period?
However, I've found that Stata's new-ish built-in commands hdidregress/xthdidregress are unworkably slow on data like mine. I haven't tried all of the user written packages (such as csdid, wooldid, did_multiplegt etc.), but the ones I have tried are also unworkably slow (like, a week+ of runtime on a fast cloud server to run one regression). The various packages seem to be designed with a state/year or maybe county/year panel in mind, with cross-sectional units in the thousands at most, and work poorly with large data. Perhaps it's just a feature of the underlying methods that they don't scale well.
So, my question: Are there any packages, built-in or user-written, that have reasonable run-times for a staggered difference-in-differences estimation with data that has millions of cross-sectional units, and 100+ time periods with treatments potentially occurring in every calendar time period?

Comment