Re: Family structure [message #8548 is a reply to message #8536] |
Thu, 12 November 2015 09:55 |
Bridgette-DHS
Messages: 3199 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS Stata Specialist, Tom Pullum:
Rather than work with what you did, I have started from scratch with the Stata code in the attached text file. This is not a final version--you will have to modify it. I tested it on the PR file for the most recent Ethiopia survey. I get this distribution:
The idea is that you must construct binary codes for everyone in the household, based on their value of hv101 (and sometimes also their sex and/or age), then collapse to get the number of people of each type in the household, and then work with these numbers (usually whether they are 0 or greater than 0) to construct the household type. Once you have the type for each household, you can merge it back to the PR file.
The three categories of households that you gave me are not clearly defined. I have tried to implement your instructions but some nearly half of the households fall outside of these three types, as you have defined them.
Strictly from a programming perspective, this program could be re-written to be more elegant, but I think that would just make it harder to understand.
Note that a household is not the same as a family. In the DHS data files, hv002 is the household id code. Usually a household can be interpreted to be a family, but not always. Good luck.
|
|
|