In a dataset in the form of:
addressnr hhid general_health
1 1 5
2 1 6
3 2 9
4 2 8
5 3 2
6 3 4
With every hhid containing a couple
I would like to create a new variable containing the health of one's partner resulting in the following
addressnr hhid general_health partner's health
1 1 5 6
2 1 6 5
3 2 9 8
4 2 8 9
5 3 2 4
6 3 4 2
I have already gotten very close to what I want using rangestat:
rangestat (min) general_health_partner= general_health, interval(adressnr 1 2) by hhid
However this only generates the value for one of the two household members
Thanks in advance for the resonses!
0 Response to Creating a variable for partner's health score
Post a Comment