Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: destring with embedded blanks


From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   st: RE: destring with embedded blanks
Date   Thu, 3 Mar 2005 14:21:11 -0000

What do you want these values to become once it is numeric?
10216 and 112116? If so:

gen id_numeric=real(subinstr(ID," ","",.))

Or something more complicated?

David

-----Original Message-----
From: Harounan Kazianga [mailto:[email protected]]
Sent: 03 March 2005 14:14
To: [email protected]
Subject: st: destring with embedded blanks


Dear list members,
Could someone help me with converting string variables
with embedded  blanks.

 Let say I have:
 ID
 1 02 16
 1121 16

 Where ID is a string variable and I want to convert
 it  in numeric.  How do I proceed?

 Thank for your help.



__________________________________________________
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index