Hi,
I need some help to create a dummy variable from a nominal variable. I want to make a dummy for my person IDs as mover or stayer. If the person stays in the same firm, then the person is a stayer (value 0) and if s/he chnages the firm, s/he is a mover (with value 1). I would appreciate to know the command or a relevant reference to read aboout it.
I need some help to create a dummy variable from a nominal variable. I want to make a dummy for my person IDs as mover or stayer. If the person stays in the same firm, then the person is a stayer (value 0) and if s/he chnages the firm, s/he is a mover (with value 1). I would appreciate to know the command or a relevant reference to read aboout it.
Person ID | Firm ID | Year | stayer/mover |
1 | 100 | 2015 | 0 |
1 | 100 | 2016 | 0 |
1 | 115 | 2017 | 1 |
1 | 116 | 2018 | 1 |
2 | 113 | 2015 | 0 |
2 | 118 | 2016 | 1 |
2 | 118 | 2017 | 0 |
2 | 140 | 2018 | 1 |
Comment