The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » FAMILY STRUCTURE
Re: FAMILY STRUCTURE [message #27438 is a reply to message #27396] Mon, 14 August 2023 11:50 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3184
Registered: February 2013
Senior Member
Following is a response from Senior DHS staff member, Tom Pullum:

We apologize for the delay in this reply, due to travel. I don't have time to give two solutions to the same problem so will just show how you can develop measures of household structure using egen and the PR file. You will end up with one line per household. Measures of structure should be limited to household members who are de jure. If the household head is not de jure (yes, this can happen) then the household drops out. I work out a slightly different example, but you should be able to generalize it.

The first step is to construct binary variables for the relation to head codes (hv101), with extensions (if needed) to include marital status or other characteristics. Then you add up those binary variables within the household, using egen total, to see whether certain types of potential household members are, or are not, present. Those totals will be added to every case in the household. Then reduce to just the household head to get one record per household. Let us know if you have further questions.

* Identify households with this structure:
* Spouse of head not present; children of head present; all children of head are unmarried
* Household structure is defined entirely in terms of de jure household members (hv102=1)

* head: hv101=1; spouse, hv101=2, child: hv101=3
* unmarried: hv115=0

use "...IAPR7EFL.DTA", clear 

keep if hv102==1

gen     spouse=0
replace spouse=1 if hv101==2

gen     child=0
replace child=1 if hv101==3

gen     unmarried_child=0
replace unmarried_child=1 if hv101==3 & hv115==0

egen nspouse         =total(spouse),          by(hv024 hv001 hv002)
egen nchild          =total(child),           by(hv024 hv001 hv002)
egen nunmarried_child=total(unmarried_child), by(hv024 hv001 hv002)

* reduce to one line per household
keep if hv101==1
drop spouse child unmarried_child
gen sex_of_head=hv104
gen age_of_head=hv105
gen     spouse_absent=0
replace spouse_absent=1 if nspouse==0

rename nchild nchildren
rename nunmarried_child nunmarried_children
gen nmarried_children=nchildren-nunmarried_children

tab sex_of_head spouse_absent if nchildren>0 & nmarried_children==0

* The households with the desired structure will be those with
*   spouse_absent=1, nchildren>0, and nmarried_children=0.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: File Merge
Next Topic: Change in age of women for domestic violence module
Goto Forum:
  


Current Time: Thu Oct 31 23:21:57 Coordinated Universal Time 2024