Hi I am about to perform an event study and I need to calculate abnormal stock returns for about 500 U.S. companies. I have two matrices, one with returns, the other with events. the first column contains dates and the first row the name of company in both matrices. Now I need to find the return on the day of the event for specified company. Could someone help me? I tried to do this with find () but its not working. Thanks in advance for all hints.
No products are associated with this question.
I think you should be able to do this with the ismember() command. The syntax will be roughly
[tf,index] = ismember(event(:,1),return(:,1));
The index will tell you which row in return it found the same first column value as it found in the first column of event.
Use datenum to convert the dates to serial datenumbers if they are not in this form already. Then use ismember to identify dates that are members of both:
doc datenum doc ismember
Play games and win prizes!Learn more