>
> . gen long myhhid = 1 if rectype==1
> . replace myhhid = sum(myhhid)
>
> The above is a useful trick to remember when you want to create an id
> variable based on grouping records according to the occurance of some
> event.
I should have mentioned that -merge- and -sum( )- are among the most
underrated command/functions in Stata.
They also happen to be Bill G.'s favorite tricks for cleaning data. It
comes up occassionally on this list, if you know what to look for.
Just so you know from whom I get these things from.
Roy
_________________________________________________________________
Rediscover Hotmail®: Now available on your iPhone or BlackBerry
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/