Announcement

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

  • Create categorical variables from string variable

    Hello!

    I have a problem: I have a dataset which include Chinese cities, however, they are stored in a string variable. For each city there are several observations. Now, I would like to put a number on each of the cities, so for instance: Beijing =1, Tianjin =2 etc.

    Is there an appropriate command in Stata to do that?

    Thank you in advance!


  • #2
    Code:
    help encode

    Comment


    • #3
      Thank you! That helped me already, I was able to solve my problem
      Have a nice day!

      Comment

      Working...
      X