Hello everyone,
I have a dataset of thousands of companies and the dates of hundreds of announcements made by each company. Variable "id" identifies a company. Variable "date" represents the announcement date.
Please see my data below:
I want to keep/identify the first announcement every 24 weeks, for every company.
For example, in my data above, for the first id, I am interested in keeping/identifying 02sep1980 (7550), 18aug1981(7900), 20apr1982(8145), 12oct1982(8320), 19jul1983(8600), 15may1984(8901), 04dec1984(9104).
In other words, I want to keep subsequent announcements that are as close to each other as possible, but not any closer than 24 weeks apart.
I would be very grateful for your help. Please let me know if I should clarify my problem any further.
Pawel
(I use Stata/SE 15.1)
I have a dataset of thousands of companies and the dates of hundreds of announcements made by each company. Variable "id" identifies a company. Variable "date" represents the announcement date.
Please see my data below:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long id int date 1 7550 1 7578 1 7704 1 7900 1 7921 1 8145 1 8320 1 8600 1 8663 1 8677 1 8726 1 8901 1 8985 1 9104 1 9209 2 7396 2 7403 2 7592 2 7732 2 7851 2 7928 2 8040 2 8187 2 8194 2 8299 2 8362 2 8565 2 8628 2 8726 2 8740 end format %d date
For example, in my data above, for the first id, I am interested in keeping/identifying 02sep1980 (7550), 18aug1981(7900), 20apr1982(8145), 12oct1982(8320), 19jul1983(8600), 15may1984(8901), 04dec1984(9104).
In other words, I want to keep subsequent announcements that are as close to each other as possible, but not any closer than 24 weeks apart.
I would be very grateful for your help. Please let me know if I should clarify my problem any further.
Pawel
(I use Stata/SE 15.1)
Comment