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: Getting rid of units in string variable


From   Richard Goldstein <[email protected]>
To   [email protected]
Subject   Re: st: Getting rid of units in string variable
Date   Sat, 18 Sep 2010 16:48:52 -0400

see -help destring- and look at the "ignore" option

Rich

On 9/18/10 4:41 PM, Kanter, Rebecca wrote:
> Hi,
> 
> I am in the process of converting string variables to numeric (e.g. weight values), but many have the units entered with the numeric value...
> 
> For example,
>  101.36kg      
>       101.5          
>       101.7     
>      102.51           
>        102kg
> 
> Is there an easier way to get rid of the "kg??" 
> Than to have to do:
> replace  var = "101.36" if var == "101.36kg" (for every entry with units attached)
> 
> Thanks so much,
> Rebecca
> 
> ___________________________________________
> Rebecca M. Kanter
> PhD Candidate
> Johns Hopkins Bloomberg School of Public Health
> Department of International Health
> Center for Human Nutrition
*
*   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