Announcement

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

  • Unique id number to each participant

    I have results from a survey and want to assign a unique id number to each participant. There are four separate surveys of 30 responses each. I will like to generate ids starting with 100, 200, 300, and 400 respectively for each dataset. I am working with this code but don't know how to make it start from 100 etc.

    Code:
    gen case_id = _n

  • #2
    As _n starts at 1, so also

    Code:
    gen case_id = 99 + _n
    starts at 100, and so on.

    You are referring to separate datasets, so that sounds like a different command for each.

    Comment


    • #3
      Thank you! Nick

      Comment

      Working...
      X