Hello everyone, I hope you are well
I need help to count the number of existing households in a database from the household_id.
Then, I want to know the average number of members per total household and per ethnicity.
In addition, I want to know in how many households (%) the head of household (relations=1) is indigenous (ethnicity!=1).
My database contains more than 12 million records and the truth is that I don't know how to move forward with that. I could use any help
The variables I put in the data are:
id_individual: identifier of each subject.
id_household: identifier of each household.
members: refers to the number of members per household.
ethnicity: 1. non-indigenous, 2. indigenous_groupA, 3. indigenous_groupB, 4. indigenous_groupC.
relations: 1.head_of_household, 2. partner_head, 3. children. 4.grandchildren, 5.other_family
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
I appreciate any kind of help
Thank you very much
Best regards
Moses
I need help to count the number of existing households in a database from the household_id.
Then, I want to know the average number of members per total household and per ethnicity.
In addition, I want to know in how many households (%) the head of household (relations=1) is indigenous (ethnicity!=1).
My database contains more than 12 million records and the truth is that I don't know how to move forward with that. I could use any help
The variables I put in the data are:
id_individual: identifier of each subject.
id_household: identifier of each household.
members: refers to the number of members per household.
ethnicity: 1. non-indigenous, 2. indigenous_groupA, 3. indigenous_groupB, 4. indigenous_groupC.
relations: 1.head_of_household, 2. partner_head, 3. children. 4.grandchildren, 5.other_family
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(id_individual id_household members ethnic relation) 1 1 3 1 1 2 1 3 1 2 3 1 3 2 3 4 2 3 2 1 5 2 3 2 2 6 2 3 2 3 7 3 2 3 1 8 3 2 3 3 9 4 1 4 1 10 5 1 4 1 11 6 5 1 1 12 6 5 1 2 13 6 5 1 3 14 6 5 1 4 15 6 5 1 5 16 7 3 1 1 17 7 3 1 3 18 7 3 2 4 19 8 1 1 1 20 9 3 1 1 21 9 3 1 2 22 9 3 1 3 23 10 4 1 1 24 10 4 1 2 25 10 4 1 3 26 10 4 1 4 end
I appreciate any kind of help
Thank you very much
Best regards
Moses
Comment