Announcement

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

  • Converting strings to numerics

    I have imported a dataset from excel, but Stata has set certain variables with numeric observations as strings (str7).

    -destring, replace- won't convert these strings to numerics, it gives the following message: contains nonnumeric characters; no replace. Even though this variable has numbers as the observation.

    Does anyone have a solution to this problem or a way to import an excel file without creating strings? thanks

  • #2
    To offer a better solution we need to know what the non-numeric characters are. It is very possible that one of destring's options will solve your problem. Among many other possibilities, it may be your data include more header lines with metadata than destring can handle.


    Comment


    • #3
      Ahh, I had to look through the entire data set and I found that some values had non-numeric characters. Thanks!

      Comment


      • #4
        Well, that was what destring told you!

        Comment

        Working...
        X