To replace the missing values "n.a" to "", I used the following code:
However, after using such code, the numbers are still in red/string format. How can I change all string variables to numeric variables so that Stata can understand them?
Note: I have a lot of variables with different names (e.g. age, number of qualifications).
Code:
ds, has(type string) quietly foreach v in `r(varlist)'{ replace `v' = "" if inlist(`v', "n.a") }
Note: I have a lot of variables with different names (e.g. age, number of qualifications).
Comment