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

Re: st: RE: Data management in Stata 9.0

From   n j cox <>
Subject   Re: st: RE: Data management in Stata 9.0
Date   Tue, 06 May 2008 18:45:16 +0100

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.


Eva Poen

2008/5/6 Maarten buis <>:
> --- 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

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:

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