.- help for ^destring^ (STB-37: dm45; STB-49: dm45.1; STB-52: dm45.2) .- Changing string variables to numeric ------------------------------------ ^destring^ [varlist] [, ^noc^onvert ^noe^ncode ^f^loat ] Description ----------- ^destring^ changes string variables to numeric whenever that can be done without loss of data. `Numeric' means the most compact numeric data type possible. If ^destring^ is allowed to convert, values of string variables that when trimmed of any leading or trailing blanks are either "" (empty string) or "." are regarded as numeric missing (.) when an attempt is made to convert string variables into numeric. If ^destring^ is allowed to encode, a string variable will be overwritten by a numeric variable containing integer codes if ^encode^ would create a new numeric variable from that string variable and no values of the variable may be interpreted as pure numbers. The default is to attempt both conversion and encoding: either can be forbidden by the options ^noconvert^ and ^noencode^. In either case, numeric variables are unchanged. If called with a varlist, ^destring^ will issue a warning about each variable in the varlist that cannot be changed. If called without a varlist, no such warnings will be issued. In either case, ^destring^ reports on any changes from string to any numeric type. Options ------- ^noconvert^ forbids ^destring^ from converting string variables to numeric variables. ^noencode^ forbids ^destring^ from encoding string variables to integer-coded variables. ^float^ means that the numeric variable version of any converted string variable starts out in life as a ^float^. (The default is ^double^.) Examples -------- . ^destring^ . ^qui destring^ . ^destring y^ . ^destring y, float^ . ^destring, noconvert^ . ^destring, noencode^ Authors ------- Nicholas J. Cox, University of Durham, U.K. n.j.cox@@durham.ac.uk William W. Gould, Stata Corporation wgould@@stata.com Also see -------- STB: STB-37 dm45 On-line: help for @encode@, @functions@, @recast@