The referenced post assumes you're estimating a generalized difference-in-differences equation. The model includes unit fixed effects, time fixed effects, and a binary treatment treatment. It is useful in settings with irregular exposure periods.
In some Difference-in-Difference analysis, is there any common rule for how many "lead" and "lag" years around the event that we should use?
No.
It depends upon the policy under evaluation. Suppose a crime bill was passed in 2016 and the number of visible police on patrol doubled. The goal of the legislation was to reduce the violent crime rate. Only a subset of counties were treated. There is no hard-and-fast rule to determine the number of leads and/or lags to incorporate. Here are some questions to consider:
- Did individuals living in treated counties anticipate a surge in guardianship? Before the bill was passed, did it receive a lot of coverage in the media? Would law abiding residents in non-treated jurisdictions move to treated jurisdictions in response to the crime bill, or vice versa?
If media coverage was consistent throughout most of 2015, then one lead indicator is worth including. Assuming individuals "perceived" the increased coverage and actually changed their behavior, then it seems warranted to assess anticipatory behavior within treated counties.
- Did prospective offenders actually "perceive" the surge in police presence? Suppose violent crime decreased in treated jurisdictions. Was the reduction immediate, or did it set in with a lag? If it was immediate, did effects last for a couple of years or was it permanent? If it set in with a lag, in what year did effects emerge?
Suppose theory tells me the effects of the bill will be perceived immediately and then quickly dissipate after the first year. I may include the immediate effect and then the first and second lag. Note the "first lag" as I have defined it is a dummy equal to 1 if the county is a treated jurisdiction and is in the second year post-shock. This is the first full period after the initial adoption year. Likewise, the "second lag" is equal to 1 if the county is a treated jurisdiction and is in the third year post-shock. Including a third, fourth, or even a fifth lag may be appropriate, assuming you're agnostic about how long it takes for effects to dissipate. Note how if you only observed counties up until 2020, then you can't go beyond four lags.
This is just one of many different ways to proceed in practice. I would argue that there is no optimal lead/lag structure. Rather, you should be guided by what theory tells you about how the treatment affects your outcome.