Hi,
I'm trying to make the variable representing the work status in the previous year to the year of delivery of the first child of the women.
The code that I wrote was as following:

Code:
sort pid year
by pid: g work_birth = work[year_birth - 1]
where year_birth indicates the year of delivery of the first child.
It didn't work, so is there anyone who could help me with the command?