Statalist


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

st: RE: Individual IDs with non-numeric characters


From   "Lachenbruch, Peter" <[email protected]>
To   <[email protected]>
Subject   st: RE: Individual IDs with non-numeric characters
Date   Mon, 2 Feb 2009 15:27:04 -0800

If you have only one observation per id, you might try
Sort id  * if it makes sense to sort them
Gen idnum=_n


If you have multiple observations per id, you can generalize this easily

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Benson Limann
Sent: Monday, February 02, 2009 2:59 PM
To: [email protected]
Subject: st: Individual IDs with non-numeric characters

Dear all:
 
The individual IDs in my dataset are in the string format. I currently
use -destring- to make them numeric. But, unfortunately, some individual
IDs have non-numeric characters. As a result, -destring- with the
-force- option deletes all these individuals automatically. 
 
Given that I want to sort all the observations, is it possible to keep
these individuals with non-numeric IDs?
 
Any suggestion will be greatly appreciated,
Ben 
_________________________________________________________________
Hotmail(r) goes where you go. On a PC, on the Web, on your phone. 
http://www.windowslive-hotmail.com/learnmore/versatility.aspx#mobile?oci
d=TXT_TAGHM_WL_HM_versatility_121208 
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index