I want to identify which observations in my variable has non-numeric characteristics and what is these non-numeric characteristic before I use destring and its options.
The destring command will only work if the string variable we are trying to convert to numeric contains no non-numeric characters. For example, if we have a variable coded as “0” or “1”, but in a given observation, it was coded by mistake as “1b”, the destring command will not work. When dealing with small databases, it might be easy to visually identify which observation was wrongly coded. However, this process might be difficult if we have a large database containing many observations.
Is there any Stata command that searches for non-numeric characters within a string variable and lists the observations that have this issue?
0 Response to How to find nonnumeric characters within a string variable and lists the observations that have this issue
Post a Comment