Announcement

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

  • id in str format: how to compute summary statistics with this type of data?

    Hi everyone,

    I have an id variable in string format, and I am unable to produce summary statistics with this type of id.

    And when I use destring, it gives me following error:

    Code:
    . destring id, replace
    id: contains nonnumeric characters; no replace
    Just a small note: My id variable is of type "BD5fe56fef5...".
    Thank you very much for your help.

    Best,
    Michael

  • #2
    It appears that you need encode. See

    Code:
    help encode

    Comment


    • #3
      Thanks Andrew Musau. But when I do encode, I obtain this message:

      Code:
      . encode id, gen(id2)
      too many values
      r(134);
      In fact, I have more than 1,200,000 IDs.
      Last edited by Michael Duarte Goncalves; 11 Sep 2023, 09:03.

      Comment


      • #4
        Code:
        egen id2= group(id)

        Comment


        • #5
          Hi Andrew Musau,

          Thank you so much for the provided code.
          It works indeed.

          Best,

          Michael

          Comment

          Working...
          X