Hi, I want to know how I can select a reference person from each household using Stata..
I am working with household data and I want to chose a reference person for each household. I have decided to use the person with the highest income as the reference person. I have looked at ways to do it online and have not been able to find the correct command to do it. I know its a beginners question and I am sorry for wasting your time if you feel that.
The variables are named hhid (househoild ID) and income.(Disposable income for each respondent) in my data. I need to learn a command to highlight the reference person (preferably keeping data on reference person only and deleting others).
Please note my data looks like this Preferably I need it to look like this
hhid income hhid income
217 50 217 50
218 40 218 60
218 60 219 40
218 30 220 90
219 20
219 40
220 90
220 70
220 80
There are a total of more than 9000 households in the data set and obviously I can not just manually check the income for each person in each household. Kindly guide me on what code to use to achieve this. (if income is similar for two people then I would like to use age as the second filter)
P.S. I feel really scared of asking such a beginner question (even though I have read that most people are polite and helpful). i have tried my best to follow guides on 'how to ask a good question on STATALIST'.I have tried to find the answer to my question on STATALIST and google but have failed maybe I am searching the wrong words
I am working with household data and I want to chose a reference person for each household. I have decided to use the person with the highest income as the reference person. I have looked at ways to do it online and have not been able to find the correct command to do it. I know its a beginners question and I am sorry for wasting your time if you feel that.
The variables are named hhid (househoild ID) and income.(Disposable income for each respondent) in my data. I need to learn a command to highlight the reference person (preferably keeping data on reference person only and deleting others).
Please note my data looks like this Preferably I need it to look like this
hhid income hhid income
217 50 217 50
218 40 218 60
218 60 219 40
218 30 220 90
219 20
219 40
220 90
220 70
220 80
There are a total of more than 9000 households in the data set and obviously I can not just manually check the income for each person in each household. Kindly guide me on what code to use to achieve this. (if income is similar for two people then I would like to use age as the second filter)
P.S. I feel really scared of asking such a beginner question (even though I have read that most people are polite and helpful). i have tried my best to follow guides on 'how to ask a good question on STATALIST'.I have tried to find the answer to my question on STATALIST and google but have failed maybe I am searching the wrong words
Comment