bcallaway11 / did

Difference in Differences with Multiple Periods, website: https://bcallaway11.github.io/did
298 stars 95 forks source link

First treated year with unbalanced panel #157

Open bcallaway11 opened 1 year ago

bcallaway11 commented 1 year ago

Possible bug from Stefan Wimmer:

If I run the att_gt() function for an unbalanced panel, it automatically (and correctly) drops farms that are treated already in the first year. However, “first year” seems to refer to the first year of the data period, and I think it should refer to the first year of appearance for each unit. Otherwise, units that enter the unbalanced panel in year 2, 3, and so on, are kept in the estimation, although they are always treated. In other words, they are considered as newly treated, but it could be the case that they have already been treated in the years before they entered the data.

pakshuang commented 1 month ago

I seem to be experiencing this as well.

In the tutorial here, there seems to be data points for period 1 for groups treated in period 2 and beyond, but the ATT(g,t) is not calculated for g-t like 2-1 or 3-1.