Dear all,
I have a dataset that includes the start and end dates of events that I would like to transform into a monthly dataset.
The dataset I have is of the form :
Code:
clear // create example data input str1 id str2 nseq datdt datft str6 start str6 end_ duration str1 situation "1" "01" 9 10 "JUL-07" "AUG-07" 2 "6" "1" "02" 11 20 "SEP-07" "JUN-08" 10 "8" "1" "03" 21 22 "JUL-08" "AUG-08" 2 "1" "1" "04" 23 34 "SEP-08" "AUG-09" 12 "3" "1" "05" 35 47 "SEP-09" "SEP-10" 13 "7" "2" "01" 9 24 "JUL-07" "OCT-08" 16 "2" "2" "02" 25 32 "NOV-08" "JUN-09" 8 "1" "2" "03" 33 34 "JUL-09" "AUG-09" 2 "3" "2" "04" 35 45 "SEP-09" "JUL-10" 11 "1" "2" "05" 46 47 "AUG-10" "SEP-10" 2 "9" end
I want to transform it to make 1) event-study and 2) difference-in-differences event study. So I guess the simplest way is in the form :
id month situation
1 1 .
1 2 .
1 3 .
1 4 .
1 5 .
1 6 .
1 7 .
1 8 .
1 9 6
1 10 6
1 11 8
1 12 8
1 13 8
1 14 8
1 15 8
1 16 8
1 17 8
1 18 8
1 19 8
1 20 8
1 21 1
How could I do that?
Thank you in advance!
Comment