chaisemartinPackages / did_multiplegt_dyn

|| Stata | R || Estimation of event-study Difference-in-Difference (DID) estimators in designs with multiple groups and periods, and with a potentially non-binary treatment that may increase or decrease multiple times.
31 stars 7 forks source link

Help Needed: Error with did_multiplegt_dyn - inv_Denom_4_XX not found #72

Closed lyk2011yjc closed 1 month ago

lyk2011yjc commented 1 month ago

Dear Professor Clément de Chaisemartin,

I hope this message finds you well. I am encountering an issue with a DID (Difference-in-Differences) program and would greatly appreciate your insights.

Commands Used: I am running a series of DID analyses with the following commands:

Issue Description: I am conducting a DID analysis with five policy variables, where each command tests the effect of one policy variable as the treatment variable while controlling for the other four policy variables. The commands for "SentN_compete_did," "SentN_supply_did," "SentN_environment_did," and "SentN_notmention_did" execute successfully without errors (last four lines), even when control variables are included. However, when I run the command for "SentN_defense_did" (first line), I encounter an error message "inv_Denom_4_XX not found." And it is important to note that if I run the command for "SentN_defense_did" without any control variables, it runs successfully and produces results.

//error
did_multiplegt_dyn total_revenue PERMNO fyear SentN_defense_did, same_switchers controls(SentN_compete_did SentN_supply_did SentN_environment_did SentN_notmention_did) effects(5) placebo(2) cluster(PERMNO) 

//successfully running
did_multiplegt_dyn total_revenue PERMNO fyear SentN_compete_did, same_switchers controls(SentN_defense_did SentN_supply_did SentN_environment_did SentN_notmention_did) effects(5) placebo(2) cluster(PERMNO) 

 //successfully running
did_multiplegt_dyn total_revenue PERMNO fyear SentN_supply_did, same_switchers controls(SentN_defense_did SentN_compete_did SentN_environment_did SentN_notmention_did) effects(5) placebo(2) cluster(PERMNO)

 //successfully running
did_multiplegt_dyn total_revenue PERMNO fyear SentN_environment_did, same_switchers controls(SentN_defense_did SentN_supply_did SentN_compete_did SentN_notmention_did) effects(5) placebo(2) cluster(PERMNO)

 //successfully running
did_multiplegt_dyn total_revenue PERMNO fyear SentN_notmention_did, same_switchers controls(SentN_defense_did SentN_supply_did SentN_compete_did SentN_environment_did) effects(5) placebo(2) cluster(PERMNO)

I have attempted to troubleshoot this issue over several days, including trying different computers, yet the error persists. I could share the data and relevant code with you if you need. Could you please spare some time to review the question and provide insight into what might be causing this issue? Your assistance in resolving this matter would be immensely valuable to me.

Thank you very much for your time and support.

Best regards,

Yuankun LI Tsinghua University, China

微信图片_20240720145525
chaisemartinPackages commented 1 month ago

Dear Yuankun,

Thanks a lot for pointing out this error to us, we fixed that in our latest update which is now available here on GitHub and should soon also be available when updating the package via SSC.

Best Regards, Felix