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!
Related Posts with Creating a variable for partner's health score
Decomposing Wagstaff Concentration IndexDear All, I'm using Stata 16 and I'm trying to decompose my concentration index using the following…
How can check the assumption for survival analysis with Schoenfeld residual method in Complex survey designHello, My data is the national health survey with a complex survey design. I want to analyse the as…
Reshaping Data and Variables for a Dynamic Panel Data AnalysisHi there, I am happy to be new in this forum and currently writing on a Panel Data Analysis for a co…
Deleting entire Firm based on condition from panel data setHello Stata community, I have a panel dataset consisting of many firms over 20 years. Firms are iden…
multiple lines in one graph with if conditionshi statalist, I have the following data: Code: * Example generated by -dataex-. For more info, ty…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a variable for partner's health score
Post a Comment