I want to count the number of individuals there per household. I do have an individual id number (pno) and a household id (hhid) number. I have tried the following codes:
egen tag = tag(pno hhid)
egen distinct = total(pno), by (hhid)
However, the distinct variables count the actual pno. So if 3 individuals live in the same household their distinct won't be 3. It would be another number. I was wondering how I would solve for this.
egen tag = tag(pno hhid)
egen distinct = total(pno), by (hhid)
However, the distinct variables count the actual pno. So if 3 individuals live in the same household their distinct won't be 3. It would be another number. I was wondering how I would solve for this.
Comment