I have a dataset that records firm's IDs and its ratings. Only rating changes are recorded, so if there is no record, that means the ratings haven't change.
Following is the data that I currently have
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(id month) int year str2 rating 1 1 2000 "A" 1 3 2000 "A-" 1 12 2000 "A" 1 4 2002 "B+" 1 5 2002 "A" 1 9 2002 "B-" end
Following is data that I want to achieve:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(id month) int year str2 rating 1 1 2000 "A" 1 2 2000 "A" 1 3 2000 "A-" 1 4 2000 "A-" 1 5 2000 "A-" 1 6 2000 "A-" 1 7 2000 "A-" 1 8 2000 "A-" 1 9 2000 "A-" 1 10 2000 "A-" 1 11 2000 "A-" 1 12 2000 "A" 1 1 2001 "A" 1 2 2001 "A" 1 3 2001 "A" 1 4 2001 "A" 1 5 2001 "A" 1 6 2001 "A" 1 7 2001 "A" 1 8 2001 "A" 1 9 2001 "A" 1 10 2001 "A" 1 11 2001 "A" 1 12 2001 "A" 1 1 2002 "A" 1 2 2002 "A" 1 3 2002 "B+" 1 4 2002 "B+" 1 5 2002 "A" 1 6 2002 "A" 1 7 2002 "A" 1 8 2002 "A" 1 9 2002 "B-" 1 10 2002 "B-" 1 11 2002 "B-" 1 12 2002 "B-" end
Can you please suggest what I can do to create such dataset?
Thank you very much in advance.
Kind regards,
Mia
0 Response to backfilling data
Post a Comment