Hi,
I can't seem to get my head around an issue. So basically I have a dataset with a set of identifers named ID. For each year I have a variable named Entry and a variable Exit. Both Entry and Exit provide a year. The objective would be to create a new "Year" variable and add a line of data for each year between Entry and Exit. So for instance if for ID = 1 Entry would be 2000 and exit 2003 and for ID = 2 Entry would be 2018 and Exit 2020; the final result I would need is:
Could anyone help me with setting this up?
Kind regards,
Gianni
I can't seem to get my head around an issue. So basically I have a dataset with a set of identifers named ID. For each year I have a variable named Entry and a variable Exit. Both Entry and Exit provide a year. The objective would be to create a new "Year" variable and add a line of data for each year between Entry and Exit. So for instance if for ID = 1 Entry would be 2000 and exit 2003 and for ID = 2 Entry would be 2018 and Exit 2020; the final result I would need is:
ID | Entry | Exit | Year |
1 | 2000 | 2003 | 2000 |
1 | 2000 | 2003 | 2001 |
1 | 2000 | 2003 | 2002 |
1 | 2000 | 2003 | 2003 |
2 | 2018 | 2020 | 2018 |
2 | 2018 | 2020 | 2019 |
2 | 2018 | 2020 | 2020 |
Kind regards,
Gianni
Comment