Hello experts,
I have three variables in my data set,
1) Date
2) Event date (this is present for few days not all of the data) this variable is missing for majority of data
3) firm ID
What i Want: I want to create a new variable "event all" which should have same event date in the previous date.
for example, my data start from 1st January 2017. First event occurs on 25 Feb 2017. I want to give "25 Feb 2017' date to all the observation from 1st January 2017 to 25 Feb 2017 in the new variable "event all".
In my data, there are multiple event and multiple firms, so i want to deal each firm and its date separately.
kindly help me to program this.
Regards
Data have;
Firm date event_date event_all
1 20170101 - 20170401
1 20170201 - 20170401
1 20170301 - 20170401
1 20170401 20170401 20170401
2 20160101 20160301
2 20160201 20160301
2 20160301 20160301 20160301
2 20160401 - -
My data has more than 400 firms and about 20 year of data. any help will be appreciated.
Thanks in advance
... View more