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
Overlaying a line graph over a catplot or tabplot graphDear Statalisters, First time statalist user here. I am studying the supply and demand of fishing p…
Store regression results of a loop in a new datasetHello everybody, I am new in this forum and I hope that I will get some advice from you. I would l…
Collapse dataHi, Having monthly panel data, I want to convert from monthly to quarterly. Used these following op…
Check if a group of variables exists before running a series of commandsHi I have other two questions for you all. I have a number of datasets (about 250) and I want to cr…
Equation not found after gsem + ImputationDear all, using Stata 15.1, I want to run a gsem model after Multiple Imputation. First I impute usi…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a variable for partner's health score
Post a Comment