Announcement

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

  • Help with destringing a variable

    Hello,
    I'm working with a dataset and I want to destring a variable. This variable is a string but with blank spaces. For context, when i type in codebook I get the following result.

    Type: String (str15)

    Unique values: 3,972 Missing "": 0/5,949

    Examples: "78176 6"
    "159120 2"
    "239 4 2"
    "321139 2"
    I tried to destring it but it doesn't work and I get the message 'contains nonnumeric characters; no replace'. I'm not too sure how to proceed with this. Would really appreciate some help!

  • #2
    What is the correct interpretation of these strings? If the spaces are to be ignored, you need to spell that out, as space counts as a non-numeric character.

    Comment


    • #3
      hello, its a str15 - %15s

      Comment


      • #4
        What we need to know is how Stata should read your data: should 239 4 2 be 23942, or something else? Why are spaces present any way?

        Comment

        Working...
        X