Announcement

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

  • Deleting variables

    Dear all,

    please help me with the following.

    I have a dataset with the variables hhid and age
    i want to drop a observation if (the value of hhid is the same for two or more observations and the value of age is lower then the other values with the same hhid)

    thanks a lot

  • #2
    Deleting variables != dropping observations but it seems that you want

    Code:
    bysort hhid (age) : keep if _n == _N
    but watch out if you have missing values on age.

    Comment

    Working...
    X