Transcription of split — Split string variables into parts - Stata
{{id}} {{{paragraph}}}
Split string variables into partsSyntaxMenuDescriptionOptionsRemarks and examplesStored resultsAcknowledgmentsAlso seeSyntaxsplitstrvar[if][in][,options]op tionsDescriptionMaingenerate(stub)begin new variable names withstub; default isstrvarparse(parsestrings)parse on specified strings; default is to parse on spaceslimit(#)create a maximum of#new variablesnotrimdo not trim leading or trailing spaces of original variableDestringdestringapplydestringto new string variables , replacing initial stringvariables with numeric variables where possibleignore("chars")remove specified nonnumeric charactersforceconvert nonnumeric strings to missing valuesfloatgenerate numeric variables as typefloatpercentconvert percent variables to fractional formMenuDat
Finally, before we turn to examples, compare split with the egen function ends(), which produces the head, the tail, or the last part of a string. This function, like all egen functions, produces just one new variable as a result. In contrast, split typically produces several new variables as the result of one command.
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}