My data is a longitudinal dataset of individuals who were interviewed
from 1997 to 2004. I have data on individual ages (measured as months
from birth month). Because this interview did not always,
consistently, ask individuals exactly 12 months after the last
interview, I have been trying to control for differences in time since
the last interview by differencing their ages as so:

. gen dt=d.amo

where "amo" is "age in months." I notice that this works so long as I
have values of amo in both the current and previous year. But there
are some people who disappear from the survey only to return a year
later. They look like this:

The relevant variables are: id (indiciating this is the same person),
amo (age in months on day of interview), dt (time since last
interview), and year. Ignore the "rp" variable, but note that this
variable measures something which depends on "dt" since it is a
measure of something done since the date of the last interview.

So, the problem is "dt" is missing twice. Once when all values are
missing because the person was not interviewed. A second time when he
comes back in. Ideally, I would like to know how to create
differenced values for dt equal to (226-189), since the respondent is
226 months old on the day of the interview and was 189 the last time
interviewed. What's the most efficient code to do this?