Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Identifying the nearest observation in a household survey


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Identifying the nearest observation in a household survey
Date   Wed, 20 Apr 2005 20:00:09 -0500

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Deborah Garvey
> Sent: Wednesday, April 20, 2005 7:32 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Identifying the nearest observation in a household survey


<snip>
> I
> want the adult who is listed before the child in the household record,
> since Census/sociology research shows he/she is most likely to be the
> parent.
> 
> An example:
> 
> serial     pernum     nfams     famunit famsize   related              age
> sex  marital
> 2411276          1         6           1            1   Head/Householder
> 88   F  widow
> 2411276          2         6           2            1   Other non-
> relatives 49   M single
> 2411276          2         6           3            2   Other non-
> relatives 49   M married
> 2411276          3         6           3            2   Other non-
> relatives  42  F  married
> 2411276          4         6           4            1   Other non-
> relatives    6  F  single
> 2411276          5         6           5            1   Other non-
> relatives  68  F widow
> 2411276          6         6           6            1   Other non-
> relatives  58  M widow
> 
> The child in line #4 is most likely the child of #2 and #3.  Can someone
> help me get started?  I'm running Stata/SE 8.2, Windows, born 1/10/05.
> 

Do you mean something like this?

. l serial relate age sex marital , abb(32) noobs

  +--------------------------------------------------+
  |  serial            related   age   sex   marital |
  |--------------------------------------------------|
  | 2411276   Head/Householder    88     F     widow |
  | 2411276              Other    49     M    single |
  | 2411276              Other    49     M   married |
  | 2411276              Other    42     F   married |
  | 2411276              Other     6     F    single |
  |--------------------------------------------------|
  | 2411276              Other    68     F     widow |
  | 2411276              Other    58     M     widow |
  +--------------------------------------------------+

. mark child if age <18

. mark parent_of_child if age>=18 & child[_n+1] == 1

. l serial  age sex marital child par, abb(32) noobs

  +---------------------------------------------------------+
  |  serial   age   sex   marital   child   parent_of_child |
  |---------------------------------------------------------|
  | 2411276    88     F     widow       0                 0 |
  | 2411276    49     M    single       0                 0 |
  | 2411276    49     M   married       0                 0 |
  | 2411276    42     F   married       0                 1 |
  | 2411276     6     F    single       1                 0 |
  |---------------------------------------------------------|
  | 2411276    68     F     widow       0                 0 |
  | 2411276    58     M     widow       0                 0 |
  +---------------------------------------------------------+



Scott



*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index