Announcement

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

  • ID/ Index creation

    Dear all,

    I would like to create country specific IDs. I have different ISOs for which I would like to have an individual numeration. That means, in my original table I have, amongst other columns, the ISO of a country and would like to create the country specific ID. I also have a column with the date and wish to have the enumeration for each country to start from the first date (0001) in history until now.
    ID ISO Country
    ZMB0001 ZMB Zambia
    ZMB0002 ZMB Zambia
    ARG0001 ARG Argentina
    ZWE0001 ZWE Zimbabwe
    ZMB0003 ZMB Zambia
    Cheers

    Maria

  • #2
    Welcome to the Stata Forum\Statalist.

    You may create a label with - label define -, then use - encode - with the label() option.

    Please read the FAQ. There you'll find important advice. Amongst them, the recommendation to use real name and family name.

    I assume "Maria Stata" is not your real name.
    Best regards,

    Marcos

    Comment

    Working...
    X