I wish to count the number of members in a household for the given survey data.
hh_id memgndr_1 memage_1 memrshp_1 memgndr_2 memage_2 memrshp_2 memgndr_3 memage_3 memrshp_3
101 Male 25 Head 45 Male 78 Father
102 36 Female Sister
103 Female 28 Sister Male Female Mother
104 Sister 67 Mother
105 Male 48 Female
As apparent from the above table, for each member, the characteristics (gender, age and relationship to household head) may have missing values. In such a case, how do I use egen command to calculate the number of members in a household such that a member gets counted in the total even if one characteristic has a valid value for that member.