Dear all,
I have a question concerning shaping the dataset. My dataset is structured as follows. Ideally i want to shift the part from variable 'restate2' of each row to next line.
1.what i have now
2.what I would like to have
...
Do you know how to do that?
Thank you in advance!
I have a question concerning shaping the dataset. My dataset is structured as follows. Ideally i want to shift the part from variable 'restate2' of each row to next line.
1.what i have now
restate | sic | year | value | restate2 | sic2 | year2 | value2 |
1 | 11 | 2012 | 34 | 0 | 11 | 2012 | 66 |
1 | 12 | 2013 | 453 | 0 | 12 | 2013 | 87 |
1 | 13 | 2014 | 546 | 0 | 13 | 2014 | 57 |
1 | 14 | 2015 | 68 | 0 | 14 | 2015 | 353 |
1 | 15 | 2016 | 896 | 0 | 15 | 2016 | 24 |
1 | 16 | 2017 | 585 | 0 | 16 | 2017 | 38 |
1 | 17 | 2018 | 545 | 0 | 17 | 2018 | 93 |
2.what I would like to have
restate | sic | year | value |
1 | 11 | 2012 | 34 |
0 | 11 | 2012 | 66 |
1 | 12 | 2013 | 453 |
0 | 12 | 2013 | 87 |
Do you know how to do that?
Thank you in advance!
Comment