I have a hard time to destring some variables with both characters and numbers. The numbers are what I want. The characters may contain " ' ". If I include this character in the option of ignore, I will get error message of mismatch type. If I don't, I will be reminded that the ...
I have a dataset in Stata with more than 200000 observations and I need to destring some variables. The command shows that the variable contains nonnumeric characters. Maybe there´s is one nonnumeric value, but analyzing that by browse I believe all the values are numeric. How can I ana...
I have copy-pasted the data into Stata, and it thinks they are strings. So far I have tried: destring gdppercap, generate(gdppercap_n) but get gdppercap contains nonnumeric characters; no generate And: encode gdppercap, gen(gdppercap_n) but get a variable numbered from ...
to convert numbers in string format to numeric format, the command you're after is -destring- (use -help destring- to read about it, or you can access it via the menu Data -> Create or change data -> Other variable-transformation commands -> Convert variables from string to numeric) Th...
In your case one solution >>> is to -destring- the string variables before the loop, but then the >>> loop will convert back, so that does not appeal. >>> >>> Another is to select numeric variables beforehand. -ds- will do this >>> >>> ds srhcareactivity1-srhcareactivity6 ,...