Hello Statalist. First, let me apologize for the poor formatting of this post. I am working from a remote area with very limited access to good wifi, so the text editor toolbar will not load. Also let me apologize because I believe this is a very elementary coding question, but after many hours of googling, reading the Stata PDF documentation, and trial and error I have been unsuccessful in finding a solution. I have been doing data cleaning and analysis work for a health NGO for the past year, and up to this point the binary variables in the unclean files that they send me have been in string format ("true" or "false" or ""), so converting them to numeric format has only required the generate and replace commands. In the most recent file they sent me, binary variables are in ACSII format ("\0" or "SOH" appearing as " " or ""). I want to convert these variables to the numeric format. It quickly became obvious that the replace command would not work for the "SOH" observations. After looking at other posts, it seems I will need to use filefilter, but it is not obvious to me how exactly the command should be typed (I had never heard of ACSII until yesterday, so both the Stata documentation and other forum posts are a bit over my head). After looking through other Statalist posts, I took a guess and tried filefilter "file1.dta" "file2.dta", from(\0) to ( ). I also tried filefilter "file1.dta" "file2.dta", from(BS0) to ( ). Neither worked. Is there anyone willing to give me a lesson on converting binary variables from ACSII format to just basic numeric format? Once again, apologies for the poor formatting of this post. Also, I am working in Stata 14.
-
Login or Register
- Log in with
Comment