Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    The code I wrote should not include blanks, just cases with some non-numeric character(s). Nick's code should include blanks. If you remove the preserve and restore statements from the code I wrote, then browse the data, you *should* see cases with letters and punctuation marks and all kinds of stuff. I find it odd that it looks like you have the full range of ASCII in the output from charlist. If things are just a little wonky (say a few cases have an alphabetic component to their values), I'd expect a list, but not the full list. So your data might be mangled in some special way. Might try saving it as .csv and reading back in with insheet instead of directly importing from excel.

    Comment


    • #32
      The code I wrote should not include blanks, just cases with some non-numeric character(s). Nick's code should include blanks. If you remove the preserve and restore statements from the code I wrote, then browse the data, you *should* see cases with letters and punctuation marks and all kinds of stuff. I find it odd that it looks like you have the full range of ASCII in the output from charlist. If things are just a little wonky (say a few cases have an alphabetic component to their values), I'd expect a list, but not the full list. So your data might be mangled in some special way. Might try saving it as .csv and reading back in with insheet​ instead of directly importing from excel.

      Comment


      • #33
        oops. I hadn't been on a thread that went beyond one page! Sorry for the redundant/irrelevant posts. I don't see a way to delete them...

        Comment


        • #34
          Oops, also didn't notice there were more pages in this discussion. Apparently this is solved now. Hexstring would have shown the codes of abnormal characters trailing the values in the cells. So keeping the message in case somebody reads this in the future.


          Lydia, I agree to Nick's diagnostics that the data got corrupted somehow. If you still have the original Excel file, and it is of manageable size, I'd probably go back to it and inspect the values of this variable in question. If all the values are valid dates in Excel, then there must be something with conversion. I didn't get it from the discussion whether you imported it with Stata or another conversion tool was used. Date systems are different in Excel and Stata and so correction is necessary, perhaps something goes wrong there. Also it may become important which version of Excel was used to create the file, and whether it was MS Excel, or an alternative (OpenOffice, etc).

          Perhaps, try to import the data treating all variables as strings for now, and inspect the strings with hexstring:
          http://hsphsun3.harvard.edu/cgi-bin/...ticle-725.html

          Best, Sergiy Radyakin
          Last edited by Sergiy Radyakin; 25 Jul 2014, 16:22.

          Comment

          Working...
          X