I am currently working with a survey dataset that follows people over time and looks as follows:
person-id | year | state | inmigration | outmigration |
1 | 1991 | 1 | 0 | 0 |
1 | 1992 | 1 | 0 | 0 |
1 | 1993 | 1 | 0 | 0 |
2 | 1991 | 1 | 0 | 0 |
2 | 1992 | 1 | 0 | 0 |
2 | 1993 | 2 | 1 | 1 |
3 | 1991 | 1 | 0 | 0 |
3 | 1992 | 1 | 0 | 0 |
3 | 1993 | 2 | 1 | 1 |
However, I also need to compute outmigration rates by state and year. This variable should also equal 2 for the year 1993, but should be reported for state 1 because these people are migrating frome state 1 to state 2 and are therefore leaving state 1. Does anyone know how to adress this problem?
I hope my question is clear.
Thanks for your help and best regards,
Leandro
0 Response to Referring to year_t-1 to construct in- and outmigration rates
Post a Comment