2008/5/6 Maarten buis <[email protected]>:
> --- Ramaele Moshoeshoe wrote me privately:
> > [...]
> > My problem is now to give each household a unique I.D. for the entire
> > data set such that for all households and/or individuals sharing the
> > same number fall under one Household, taking into accout the Zone and
> > Region.
> [...]
> gen long id = hhno + 10*zone + 100*district + 1000*region
What is nice about Maarten's solution is that, from just looking at
the household id, you can tell zone, district and region of an
observation.
Should you worry about your household ids becoming too long with this
this system, you can also do the following:
egen hhid = group(region district zone hhno)
This will consecutively number your households, starting at 1.
Eva
*
* 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/