[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: gen new variable, dealing with prefix codes
I am working with a 3 byte numeric variable of age at death where the
first integer (prefix) codes whether the next 2 integers are in
years, months, days, hours, or minutes. So it lists age in years
as 1 + years; It lists months as 2 + months; days are 3 + days
etc. For example, a person who died at 59 years of age is coded as
159; a child who died at 3 months of age is coded as 203; death at 4
days is 304; death 6 hours after birth is 406; etc.
I need to convert this to the following 11 age intervals in years:
0 to less than 1;
1 to 4;
5 to 14;
15 to 24;
25 to 34;
continuing 10 year intervals up to 85+.
I am having trouble creating a stata command for this because of how
the bytes are set up (because of the prefix month, day, hour, &
minute integers.) Please help!
* For searches and help try: