Announcement

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

  • Year in order

    Hi

    I have values from 1 to 10
    and I would like to rename the numbers to years 1992 to 2002.
    I tried with for values but does not work.
    Do you have any suggestions?

    Thank you very much!

  • #2
    Can't be done. Years 1992 to 2002 is a range of 11 years, so 10 numbers is not enough. Assuming you meant 1992 to 2001, just do:

    Code:
    gen year  = 1991 + old_value
    (Replace old_value by the name of the variable that ranges from 1 to 10.)

    Comment


    • #3
      Yes I am sorry for the mistake.
      This method is much simpler than using the loop!

      Thank you!

      Comment

      Working...
      X