Closed kylebutts closed 2 years ago
Does the event study for Sun and Abraham behave correctly now? Running this code from the documentation in the latest version (did2s_0.5.0) compiled from Github:
data(df_het, package = "did2s") out = event_study( data = df_het, yname = "dep_var", idname = "unit", tname = "year", gname = "g" ) plot_event_study(out)
Produces this result:
The Sun and Abraham facet indeed appears identical to the output from:
fixest_sunab <- feols(fml= dep_var ~ 1 + sunab(cohort=g, period=year, ref.c=0, ref.p=-1), data=df_het) iplot(fixest_sunab)
However, this seems to be very off compared to all other event studies. While the general direction here is still correct, in my personal application the direction of effect was reversed compared to all other event studie. I just want to make sure this is indeed the expected outcome and not a bug after the recent change.
Hi @TobiasMy, I'm not sure why it's so much noisier than the other estimators. Unless I'm mistaken, that's the proper syntax for sunab
. I'm sorry I can't be of more help.
Just one more note I forgot in my initial comment: The output included in the event_study documentation (shown below) seemed to show a Sun and Abraham event study much more in line with all the rest which initially sparked my doubts.
Anyway. I wanted to thank you for this great package, it is of enormous help to me! Cheers!
Thanks @TobiasMy. I'm looking into this. I'll try to get an answer soon.
@TobiasMy Okay, so I was doing the sunab
code wrong facepalm
It should be all fixed now!
Thanks a ton @kylebutts! Seems like I fell into the same trap when trying to figure out how sunab
worked from the vignette. I had just assumed that the fixed effects would automatically be taken care of and did not need to be specified extra. Adding such an FE example to the sunab
vignette would certainly help prevent future users making this mistake. Thanks again for investigating this issue.
It's fixed in the documentation now: https://github.com/lrberge/fixest/issues/287
A few people have found weird results, so I might be coding it up wrong in
event_study