Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Need Help with converting String Variables to Numeric Variables


From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: Need Help with converting String Variables to Numeric Variables
Date   Tue, 19 Jun 2012 00:58:54 +0200

Anwar,

Can't you just -destring- your string variable, specifying the -force-
option, and -replace- the created missing values with 0 in the new
variable? Or am I missing something here?

Best
Daniel

-- 
Dear Stata List Members ,

I am working on a data set of a hospital where  one of the variables
has string values as observations .

I am able to convert numeric string values to numeric values using
destring command.

But I have some of the observations as "< 4", "<0.04","less than 0.1"
which needs to be converted to zero .

In Stata we have option to convert nonmumeric values to missing values
, but I need to convert them to Zero .
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index