Notes
Variable calculated from the following variables:
- n_menage (Household number)
- n_indiv (Individual number in the HH)
- a4 (Living in the HH)
Stata program:
gen temp=1 if a4==1
replace temp=0 if a4==0
sort n_menage n_indiv
gen temp_2=temp if n_menage!=n_menage[_n-1]
replace temp_2=temp_2[_n-1]+temp if temp_2==.
sort n_menage n_indiv
egen hmember=max(temp_2), by(n_menage)
drop temp temp_2