I have this data FirmName CompCode SicCode VariableCode Q12010 Q22010 Q32010 .......
Firm 1 Price 5555 111 P 100 101 102
Firm 1 Beta 5555
Firm 1 MV 5555
Firm 1 MTBV 5555
Firm 1 Ret 5555
Firm 2 Price 6666
Firm 2 Beta 6666
Firm 2 MTBV 6666
..........
I want to reshape this data to somehting like that(See down) but is a bit complicated in my mind how should they be reshaped because I want to know which firms data am using but if i reshape them like that I won't. I want to make portoflios out of these firms based on their SicCode if it helps you to understand what I want to do. In addition some of my data are missing as you can see firm 2 doesnt have a variable MV at all. So I won't be using that data. Would you suggest deleting it from excel or doing something else in stata?
Quarters Price Beta MV MTBV Ret
Q12010
Q22010
Q32010
...........
Firm 1 Price 5555 111 P 100 101 102
Firm 1 Beta 5555
Firm 1 MV 5555
Firm 1 MTBV 5555
Firm 1 Ret 5555
Firm 2 Price 6666
Firm 2 Beta 6666
Firm 2 MTBV 6666
..........
I want to reshape this data to somehting like that(See down) but is a bit complicated in my mind how should they be reshaped because I want to know which firms data am using but if i reshape them like that I won't. I want to make portoflios out of these firms based on their SicCode if it helps you to understand what I want to do. In addition some of my data are missing as you can see firm 2 doesnt have a variable MV at all. So I won't be using that data. Would you suggest deleting it from excel or doing something else in stata?
Quarters Price Beta MV MTBV Ret
Q12010
Q22010
Q32010
...........
Comment