Statalist The Stata Listserver


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

st: Re: How to create a pesonal ID applied to whole panel dataset?


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: How to create a pesonal ID applied to whole panel dataset?
Date   Mon, 16 Oct 2006 07:07:17 -0400

...
egen uid=group(hhid psid)

M Blasnik

----- Original Message ----- From: "Yibing Wang" <wang_yibing@yahoo.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Monday, October 16, 2006 2:51 AM
Subject: st: How to create a pesonal ID applied to whole panel dataset?



Dear Statalisters,

I'm relatively new to Stata, I have a dataset as
follows:

hhid psid year
1 1 1989
1 1 1991
1 1 1993
1 1 2000
1 2 1989
1 2 1991
1 2 1993
1 2 2000
2 1 1989
2 1 1991
2 1 1993
2 1 2000
... ... ...
hhid=household ID
psid=personal ID within a household
And my question is how to create a personal ID (say
uid) applied to the whold panel dataset that looks
like:
hhid psid year uid
1 1 1989 1
1 1 1991 1
1 1 1993 1
1 1 2000 1
1 2 1989 2
1 2 1991 2
1 2 1993 2
1 2 2000 2
2 1 1989 3
2 1 1991 3
2 1 1993 3
2 1 2000 3
... ... ... ....

Any help would be highly appreciated.

Thanks,

Eric Wang


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com *
* 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/
*
*   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