Parallel pretrends when using did vs fixest package #158
-
Hello, I have noticed that in some of my event study regressions, depending on which R package I use I get different results regarding the violation of parallel pretrends. Specifically, I ran an event study regression using the "fixest" package, which indicated that the treatment and control groups were not on parallel trends before treatment, whereas the "did" package showed that both groups were on the same trend pre-treatment, i.e. the coefficients were around zero. All treated units were treated at the same time, so it couldn't be because of staggered treatment effects. I then generated some other data to see whether this issue was limited to my dataset. I generated a dataset of "treated" and "untreated" observations over 10 periods, with 100 observations per group (2000 observations in total), where the observations of the untreated group are around zero in every period, but the observations of the treated group linearly grow from -5 to 5 over the 10 periods (see plot). I would therefore expect the coefficients of the event study regression to also indicate a violation of parallel trends, with no change in trend at the time of treatment (5). Indeed, the fixest package shows exactly this: However, when I run the regression in the did package, I get this: where for some reasons the pre-trends are just filtered out. Does anyone have any idea what's happening here? I tried to figure it out from the publication, but I couldn't find anything that would apply to this situation. Here's the R code to reproduce the example:
Any help would be greatly appreciated - thank you very much! I also posted this question in the Economics Stackexchange. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I am almost positive that the difference is driven by the choice of the "base period". There is a discussion of this issue here: https://bcallaway11.github.io/posts/event-study-universal-v-varying-base-period If that doesn't clear up your question, just let me know. Brant |
Beta Was this translation helpful? Give feedback.
I am almost positive that the difference is driven by the choice of the "base period". There is a discussion of this issue here: https://bcallaway11.github.io/posts/event-study-universal-v-varying-base-period
If that doesn't clear up your question, just let me know.
Brant