Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: Transforming Unique IDs


From   Dennis Kramer <dkramerii@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Transforming Unique IDs
Date   Mon, 23 May 2011 06:47:12 -0400

Thank you Jan, that was the fix. Very much appreciated

On Mon, May 23, 2011 at 6:42 AM, Jan Bryla <JBR@finansraadet.dk> wrote:
> I am not quite sure what the objective is, but the group function with -egen- would generate a new id based on the order of the old id.
>
> Egen newid=group(id)
>
> Regards
> Jan Bryla
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dennis Kramer
> Sent: 23. maj 2011 12:18
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Transforming Unique IDs
>
> Greetings,
>
> I am working with a large panel data set and I need to transform the
> current unique IDs into a new set of unique IDs while maintaining the
> panel nature of the data. For example,
>
> Year 1     ID1     Var 1    Var2     Var3    NewID1
> Year 2     ID1     Var 1    Var2     Var3    NewID1
> Year 3     ID1     Var 1    Var2     Var3    NewID1
> Year 1     ID2     Var 1    Var2     Var3    NewID2
> Year 2     ID2     Var 1    Var2     Var3    NewID2
> Year 3     ID2     Var 1    Var2     Var3    NewID2
> Year 1     ID3     Var 1    Var2     Var3    NewID3
> Year 2     ID3     Var 1    Var2     Var3    NewID3
> Year 3     ID3     Var 1    Var2     Var3    NewID3
>
> does anyone have a algorithm to produce a new set of unique IDs while
> maintaining the panel function? I have looked through the current FAQs
> and past listserv discussions and have not found any suggestions that
> would create a new ID while maintaining the panel groupings.
>
> Thank you,
> *
> *   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/
>
> *
> *   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/
>

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index