lsun20 / EventStudyInteract

MIT License
34 stars 12 forks source link

The coefficients of the interaction terms have opposite signs compared to the results of reghdfe #12

Open Gofoy opened 5 months ago

Gofoy commented 5 months ago

image image

The first figure is the results of eventstudyinteract, where 0.142 is the coefficient of interaction term; the seond is the results of reghdfe, where -0.142 is the coefficient. Why did such results occur? By the way, it is not Staggered DiD and only has one timing point of policy impact

lsun20 commented 5 months ago

Your specification has perfect multicollinearities so Stata drops them in some default order that can be different for eventstudyinteract and reghdfe. You might want to manually specify the relative time indicators to make sure the same are dropped for eventstudyinteract and reghdfe to be comparable. Also see the R version here.

Gofoy commented 5 months ago

I may have not expressed it clearly, but there are no relative time dummy variables in the regression above. The following result is another example from eventstudyinteract, and I remove the "qui: " in the ado files so that I can show the intermediate process. Actually I'm conducting heterogeneity analysis, where M is the dummy variable denotes heterogeneity group, D is the treatment variable, inter = M * D. In the second figure, 0.135 is the coefficient of inter; -0.004 is the coefficient of D, 0.000 is the coefficient of M. But from the first figure, the interaction term's coefficient should be -0.135. Why the final result is 0.135?

image image

lsun20 commented 5 months ago

Because in the last step eventstudyinteract takes a weighted average of the cohort-specific effects where the weights can be found in e(ff_w), which are the shares of cohorts. I don't know how you specify cohort() so I cannot comment on what the issue is, but it seems you may have included M, D and M*D all as relative time indicators, which are not the correct syntax. You can check this issue for heterogeneity analysis. Since you have one timing point of policy impact, you can also use reghdfe directly.