Announcement

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

  • Command for identifying age range

    Hello,

    I am looking to identify those who fall between an age range and am having some difficulty with my command. I want to generate a mark for those who fall between ages 5-14. I tried the following to no avail.

    gen mark5to14 = 1 if Age == 5/14

    What am I doing wrong? Any help is appreciated.

    Thanks!

  • #2
    well, 5/14 is less than one; try this instead:
    Code:
    gen mark5to14 = inrange(age,5,14)
    see
    Code:
    help inrange

    Comment

    Working...
    X