![Statalist](/includes/images/head_statalist.jpg) |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: RE: Data management in Stata 9.0
Note also that using the -label- option with -egen, group()- gives you
the original information in label form.
Ramaele is using Stata 9.0. Ramaele should -update- that to 9.2, or get
the local systems administrator to do that. It is free.
Nick
[email protected]
Eva Poen
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.
*
* 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/