Statalist The Stata Listserver


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

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


From   Yibing Wang <[email protected]>
To   [email protected]
Subject   st: How to create a pesonal ID applied to whole panel dataset?
Date   Sun, 15 Oct 2006 23:51:15 -0700 (PDT)

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/



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