Flagging each member of a household when one member has x characteristic


So I have a data set that is sorted by house hold number, and person number within each household. So their are unique house hold numbers for each house, and a number 01,02,....n for each person in the house.

I want to assign a dummy variable 1 to everyone in a household that has a child with a disability. This is so that I can find all of the parents of children who have a disability.

So far I have created a dummy variable that indicates if the child has one of the disabilities that I am interested in. I want to figure out what function I have to run to assign that dummy variable to all other people within the households that contain a person flagged with the dummy variable.

Help please!


Assuming your dummy variable is called dischild and takes the values of 0 or 1:

egen hasdischild=max(dischild), by(household)


Yes, -egen- is excellent. Every time I look at the help file I discover another command that would have saved me lots of time :)