Dear Statalist,

I’m using a dataset consisting of 5 variables - a household identifier, an identifier of the person within a household, a variable that shows if the person is a child or an adult, a variable that displays the ethnic group of the person and a variable that shows total income of that person. At first, i created a new variable displaying the total income of a household, divided by the number of people in that household. Since there are many children included in the set, I would like to ‘weigh’ these observations. Specifically, I would like to create a new variable that displays the income of a household divided by the number of people; but when dividing, I want the adults to be taken in account at a value of 1 and the children at a value of 0.5.
Could someone tell me how this can be done in Stata (V16.1)?

Thanks in advance!