Announcement

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

  • Selecting observations from specific waves in a panel.

    Hi guys! I have a panal with the variable wave and pid (identifier). Lets assume wave goes from 1 to 8. How can I get those observations that appear lets say in waves 2,5 and 6. Note there's not need to observe the individuals only in those waves: the individual can be also observed in wave 1 but I want to be sure it appears in wave 2,5 and 6.

    Cheers and thanks!
    Last edited by Jean Jacques; 04 Jun 2021, 08:37. Reason: panel

  • #2

    Code:
    egen wanted = total(inlist(wave, 2, 5, 6)), by(pid) 
    
    keep if wanted == 3

    Comment


    • #3
      Thanks Nick! It worked perfectly!

      Comment

      Working...
      X