Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: gen new variable, dealing with prefix codes


From   LaVera Crawley <[email protected]>
To   [email protected]
Subject   st: gen new variable, dealing with prefix codes
Date   Tue, 27 Jun 2006 13:12:34 -0700

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:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index