Transcription of destring — Convert string variables to numeric variables ...
{{id}} {{{paragraph}}}
Convert string variables to numeric variables and vice versaSyntaxMenuDescriptionOptions for destringOptions for tostringRemarks and examplesAcknowledgmentReferencesAlso seeSyntaxConvert string variables to numeric variablesdestring[varlist],{generate(new varlist)|replace}[destringoptions]Conver t numeric variables to string variablestostringvarlist,{generate(newva rlist)|replace}[tostringoptions] destring optionsDescription generate(newvarlist)generatenewvar1,..,n ewvarkfor each variable invarlist replacereplace string variables invarlistwith numeric variablesignore("chars")remove specified nonnumeric charactersforceconvert nonnumeric strings to missing valuesfloatgenerate numeric variables as typefloatpercentconvert percent variables to fractional formdpcommaconvert variables with commas as decimals to period-decimal format Eithergenerate(newvarlist)orreplaceis generate(newvarlist)generatenewvar1.
destring— Convert string variables to numeric variables and vice versa 5 Example 2 Our dataset contains the variable date, which was accidentally recorded as a string because of spaces after the year and month. We want to remove the spaces. destring will convert it to numeric and remove the spaces.
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}