Apologies for the previous message, which I sent by mistake.
I work with household survey data and am looking for a way to assign
the mother's age to her children. The problem is that some
observations are missing. Take the data below:
hh id sex age mid fid
1 1 1 30 . .
1 2 2 30 . .
1 3 1 5 2 1
2 1 1 30 . .
2 3 2 5 2 1
There are two households (hh 1 and 2) with three household members
each (id 1 to 3). mid identifies a child's mother, fid the father. In
household 2, the mother (id 2) is missing. The usual code to assign
the mother's age therefore fails:
. bysort hh (id): gen mage=age[mid]
hh id sex age mid fid mage
1 1 1 30 . .
1 2 2 30 . .
1 3 1 5 2 1
2 1 1 30 . .
2 3 2 5 2 1
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
*
* 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/