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 on April 23, 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: Generating numeric ids


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Generating numeric ids
Date   Mon, 8 Mar 2010 23:35:10 +0100

<>

Say

*******
egen newid=group(ID)
*******

then. 

HTH
Martin


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dmitriy
Krichevskiy
Sent: Montag, 8. März 2010 23:30
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: RE: Generating numeric ids

Thank you Martin, but unfortunately I get an r(134) error. I am
guessing that there are more than 65,536 unique values as possible
combinations. So I am trying to see if there is another approach.
Thanks again. Dmitriy

2010/3/8, Martin Weiss <martin.weiss1@gmx.de>:
>
> <>
>
> *******
> clear*
>
> inp str10 ID V1 str10 V2
> AAAAPTNE7		.	   .
> AAAAPTNE7		.	   .
> AAAARCOO7		1    "2002-2003"
> AAACACRI7		2	   "2004-2005"
> AAACAMCP3		1	   "2006-2007"
> AAACARIC9		1    "2002-2003"
> end
>
> encode  ID, gen(numericid)
> l, nolab sepby(ID) noo
>
> *******
>
>
> HTH
> Martin
>
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dmitriy
> Krichevskiy
> Sent: Montag, 8. März 2010 23:01
> To: statalist
> Subject: st: Generating numeric ids
>
> Dear Statalisters,
> I have a large panel dataset creators of which decided to encrypt the
> participants IDs via some unknown algorithm to covert them (original
> id numbers) into strings. I am stock trying to figure out how to
> create unique numerical identifiers from these given that the data is
> panel (in the long format). I provide a small example below. As always
> your help is much appreciated.Thanks, Dmitriy
>
>
>     ID                         V 1                          V2
> AAAAPTNE7		.		                 .
> AAAAPTNE7		.		                 .
> AAAARCOO7		1                         2002-2003
> AAACACRI7		2	                   2004-2005
> AAACAMCP3		1	                   2006-2007
> AAACARIC9		1                         2002-2003
>
> --
>
> Research Associate, College of Education
> Lumina Foundation Project
> *
> *   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/
>




Research Associate, College of Education
Lumina Foundation Project

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