Problem: I have an Excel datasheet with numeric variables that only show numeric values in Excel. When I import into STATA, paste into the data editor, or convert the Excel file-->SAS-->STATA, I still wind up with string variables. I have attempted to use the encode oldvar, gen(newvar) function as well as gen newvar=real(oldvar) function. Some of the numeric values appear in the new variable, but most of them are erased. I'm assuming something is wrong in my Excel datafile, but don't know what to do. I have tried reformatting the data values in Excel and everything appears to be numeric, but I'm still getting a STATA dataset full of string variables for numbers that I can't analyze.
-
Login or Register
- Log in with
Comment