Hi,
The variable grade in my dataset is badly collected and it has been saved as a string variable.
How can I destring it while some observations have % or not, U (for fails), commas and dots?
Thanks in advance
The variable grade in my dataset is badly collected and it has been saved as a string variable.
How can I destring it while some observations have % or not, U (for fails), commas and dots?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str22 grade "66,55%" "81%" "72.5" "60%" "84,85%" "84,4%" "84,65%" "81,35%" "75%" "81,4%" "79,5%" "U" "81.7%" "71,05%" "91,45%" "70%" "89,9%" "83,8%" "88,75%" "82,65%" "88,75" "86,95%" "90,35%" "79.6" "74" "82,6%" "84,5%" "77.6%" "81" "67,5%" "U" end
Comment