Hello!

I'm sure this has been addressed before, but I have been unable to find a forum post or youtube video on this specific topic. My apologies!

I'm currently cleaning a raw data set. The data is from a mail survey and write in responses were coded verbatim by undergraduate research assistants. Consequently, in a number of cases, I have a few non-numeric values in what should be a numeric variable. I'm wondering what commands will allow me to edit these records.

As a specific example, in variable "acresowned", I have been trying to convert an entry of "5000ish" to "5000." The recode and replace commands, which I hoped would work, appear to be unable to edit the non-numeric records--"type mismatch" is the error. At the moment, I've resorted to manual edits in the data editor, but the lack of documented changes in a do-file make me uncomfortable.


Thank you!
Matthew Houser
Stata 15.0, Mac