Wednesday, November 25, 2020

reshaping

Dear statalist members, I would like to seek your advice on how to reshape/transpose data. Details as follows

My original dataset looks like this:
prod cod month price
ttt 11 1 1.1
ttt 11 1 2.3
ttt 11 2 1.4
ttt 11 2 1
ttt 11 3 2
ttt 11 3 3
ttt 12 1 1.4
ttt 12 2 1.5
ttt 12 2 1.6
vvvv 13 2 7
ww 13 2 8
And I would like to get it into this format :
prod cod month price price
ttt 11 1 1.1 2.3
ttt 11 2 1.4 1
ttt 11 3 2 3
ttt 12 1 1.4
ttt 12 2 1.5 1.6
www 13 2 7 8
Please let me know what might be the code for me to create the second table from the first.

Thank you very much for your help in advance.

Best,
Adriana

No comments:

Post a Comment