Statalist


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

st: coding households in survey data


From   Gisella Young <gisellayoung@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: coding households in survey data
Date   Mon, 21 Apr 2008 04:21:57 -0700 (PDT)

Dear Statalisters,
 
I have a simple question. I am working with a household dataset in which the households are not coded as such but are evident from the individual numbers. It is set up as follows:
 
PERSON    VAR1    VAR2 ...
1
2
3
1
1
2
....
 
(I haven't filled in the variables above).
 
The 'person' data actually refers to the person's household membership ie household one has 3 members, houshold 2 has 1 member, household 3 has 2
members, etc. I would like to create a new variable 'household', in which each household has a unique number as follows:
 
HOUSEHOLD    PERSON    VAR1    VAR2 ...
1              1
1              2
1              3
2              1
3              1
3              2
....
 
(Then if I concatenate 'household' and 'person' each individual will have a uniqe number.)
 
Any suggestions as to how to create the household variable?
 
Thank you!
 
Gisella
 

      
 ___________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now. 
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

*
*   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