Statalist The Stata Listserver


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

st: Survey data: how to assign mother's age to child?


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   st: Survey data: how to assign mother's age to child?
Date   Thu, 8 Jun 2006 10:35:18 -0700 (PDT)

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/



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