Dear StataWizards,
Currently I am performing an event study regarding earnings announcement. I am facing a problem estimating the normal performance because the loop I created with the help of Princeton University takes a lot of time to perform. I tried to use the following loop to estimate the normal returns:
forvalues i=1(1)14625 { l id company_id if id==`i' & dif==0 reg ret market_return if id==`i' & estimation_window==1 predict p if id==`i' replace predicted_return = p if id==`i' & event_window==1 drop p } As you can see I have 14625 regressions to run. Today I tried to execute the loop I described above, I have waited for 2 hours and only 150 out of the 14625 regressions were finished. Does anybody has a clue how to solve this problem? Is there something wrong with my loop? or is there a command which is able to speed up the execution of my loop? (I already set more off)
Kind Regards,
Arnout Poelstra
Currently I am performing an event study regarding earnings announcement. I am facing a problem estimating the normal performance because the loop I created with the help of Princeton University takes a lot of time to perform. I tried to use the following loop to estimate the normal returns:
forvalues i=1(1)14625 { l id company_id if id==`i' & dif==0 reg ret market_return if id==`i' & estimation_window==1 predict p if id==`i' replace predicted_return = p if id==`i' & event_window==1 drop p } As you can see I have 14625 regressions to run. Today I tried to execute the loop I described above, I have waited for 2 hours and only 150 out of the 14625 regressions were finished. Does anybody has a clue how to solve this problem? Is there something wrong with my loop? or is there a command which is able to speed up the execution of my loop? (I already set more off)
Kind Regards,
Arnout Poelstra
Comment