Hello everyone,
I want to create a dummy variable that captures the first salary after graduation. My base is made up at the individual level (id_persona). For each individual there is the graduation period (periodo), the salary (sueldo) they received per month (mes) and year (anio).
I think that for this I should make a loop where I look for the first month in which he receives his first salary and put the number 1. However, I have never worked with loops and I don't know how to generate the code.
I want to create a dummy variable that captures the first salary after graduation. My base is made up at the individual level (id_persona). For each individual there is the graduation period (periodo), the salary (sueldo) they received per month (mes) and year (anio).
Id | mes | anio | sueldo | periodo |
17529056 | 4 | 2018 | 345 | 2015-2016 |
17529056 | 5 | 2018 | 345 | 2015-2016 |
17529056 | 8 | 2018 | 525 | 2015-2016 |
17528012 | 2 | 2019 | 325 | 2017-2018 |
17528012 | 3 | 2019 | 400 | 2017-2018 |
17528012 | 4 | 2019 | 800 | 2017-2018 |
17528012 | 5 | 2019 | 800 | 2017-2018 |
17528012 | 6 | 2019 | 900 | 2017-2018 |
17859404 | 1 | 2016 | 125 | 2014-2015 |
17859404 | 2 | 2016 | 300 | 2014-2015 |
17860950 | 6 | 2017 | 200 | 2013-2014 |
17860950 | 7 | 2018 | 225 | 2013-2014 |
Comment