Announcement

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

  • Problem with "destring"

    Dear Stata users,

    I am struggling with destringing my data. String observations in the form of e.g. "12.5", Stata returns 125. How come? And what can I do to remedy this?
    The command I have used is: destring, replace ignore (n.a.)

    Thanks a whole lot in advance,

    Ines

  • #2
    you need to show us the exact command you gave Stata

    Rich

    Comment


    • #3
      "destring, replace ignore (n.a.)" is the exact command I have typed to destring my entire data set.

      Comment


      • #4
        Ines,

        destring is ignoring the characters "n", "a", and ".", as per your ignore() option. If you want to keep decimals you should probably use a different method to get rid of the "n.a." strings. Take a look at the subinstr() function instead (or prior to using destring).

        Regards,
        Joe

        Comment


        • #5
          ignore(n.a.) makes State ignore the decimal dot

          Comment


          • #6
            Ooh, I get it! How silly of me...
            Thanks a lot, you guys!

            Comment

            Working...
            X