Announcement

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

  • Delete entire panel ID if a variable takes a particular value in any year

    I have a panel dataset which has a variable called interest_debt. I would like to delete the entire group id (i.e. country) if interest_debt takes the value of 0 in any year. I will appreciate if somebody could help.

  • #2
    Perhaps this (untested) code will point you in a useful direction.
    Code:
    bysort id (year): egen todrop = total(interest_debt==0)
    drop if todrop>0

    Comment


    • #3
      William Lisowski thank you very much.

      Comment

      Working...
      X