Hello everyone!
I have the following data format for stock observations with stock split events and would need some help:
With date being the date of the stock observation and DCLRDT being the declaration date for the split on the split execution date (in this case the execution was 19mar1986). I would now like to create a dummy variable that is 1 if the current date is 6 months or less away from the date for the split execution(in this case 19mar1986) before and after the split. So for example if the date would be 14. April 1986 (after the split date) or 12. February 1986 (before the split date) I would have a 1 in the dummy variable.
I do not really know how to do this, I tried to use loops but I am new to stata and could not find any further information on how to go through observations for only a specific range of months after and before a certain observation. I have millions of observations so sadly I cannot just pick out the split date manually and code around it.
Thank you very much in advance!
I have the following data format for stock observations with stock split events and would need some help:
date: | DCLRDT | |
.... 13mar1986 14mar1986 17mar1986 18mar1986 19mar1986 20mar1986 21mar1986 24mar1986 25mar1986 .... |
19feb1986 | |
I do not really know how to do this, I tried to use loops but I am new to stata and could not find any further information on how to go through observations for only a specific range of months after and before a certain observation. I have millions of observations so sadly I cannot just pick out the split date manually and code around it.
Thank you very much in advance!
Comment