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
Related Posts with Cleaning Raw Data--How to edit non-numeric data records using commands
Extreme values in upper/lower bound bands not in original dataI want to create a graph with upper/lower bound bands - using this code (similar to that used here U…
Issues with running stata code for cnormI have issues running the stata code for cnorm as shown below, is there any way to resolve this issu…
Margins from a mixed model with a log-transformed outcomeI run a mixed model of a log-transformed outcome using ‘mixed’ (and the dfmethod(kroger) option with…
Nested logit with invariant regressorI am trying to use nested logit specification for estimating school choice of households. The first …
optimizeHi All, I have a big dataset (2432rows with 6 variables) looks like below. I would like to minimize …
Subscribe to:
Post Comments (Atom)
0 Response to Cleaning Raw Data--How to edit non-numeric data records using commands
Post a Comment