FAMILY STRUCTURE [message #24876] |
Mon, 25 July 2022 02:26 |
Sourav_
Messages: 20 Registered: January 2021
|
Member |
|
|
I want to create several types of family structures and I have tried but unable to do so if you can provide me with STATA code it will be very helpful for me. Thank you. I am attaching the definitions of several types of family structure.
|
|
|
|
|
|
|
|
|
|
Re: FAMILY STRUCTURE [message #25962 is a reply to message #25951] |
Tue, 17 January 2023 11:38 |
Bridgette-DHS
Messages: 3199 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS staff member, Tom Pullum:
You need to construct a typology of household types, of which this specific household structure would be one of the types, using the PR file. I suggest that the dimensions are (1) the sex of the household head, (2) whether a spouse is present, and (3) whether a dependent child (age 0-17 and unmarried) is present. There are 2x2x2=8 combinations. You first construct a binary variable to describe each household member based on relation to head, sex, age, or marital status, then add up the number of people of these types within the household and assign these subtotals to each person in the household. You then construct the typology. Then you can reduce to the household head or do tabulations for just the head, so the units are households rather than individuals. I will paste below the Stata code to do this. The household type you are specifically interested in is #3. I will then paste the distribution. There is a small "other" category, probably because hv105 includes a "transgender" category. You may want to restrict to de jure household members--I didn't do that.
Type 3 represents about ½ of 1 percent of all households. Type 7, with a female head, no spouse, and dependent children, represents about 3% of households
use "...IAPR7DFL.DTA", clear
* Criteria for household typology
* household head is male (hv101=1, hv104=1)
* household head is female (hv101=1, hv104=2)
* no spouse present (no one in hh with hv101=2
* at least one unmarried child present (hv101=3,hv105<=17, hv115=0)
gen hhhead_male =0
gen hhhead_female=0
gen spouse=0
gen child=0
replace hhhead_male =1 if hv101==1 & hv104==1
replace hhhead_female=1 if hv101==1 & hv104==2
replace spouse=1 if hv101==2
replace child=1 if hv101==3 & hv105<=17 & hv115==0
egen nhhhead_male =total(hhhead_male), by(hv024 hv001 hv002)
egen nhhhead_female=total(hhhead_female), by(hv024 hv001 hv002)
egen nspouse =total(spouse), by(hv024 hv001 hv002)
egen nchild =total(child), by(hv024 hv001 hv002)
gen hhtype=.
replace hhtype=1 if nhhhead_male==1 & nspouse>=1 & nchild>0
replace hhtype=2 if nhhhead_male==1 & nspouse>=1 & nchild==0
replace hhtype=3 if nhhhead_male==1 & nspouse==0 & nchild>0
replace hhtype=4 if nhhhead_male==1 & nspouse==0 & nchild==0
replace hhtype=5 if nhhhead_female==1 & nspouse>=1 & nchild>0
replace hhtype=6 if nhhhead_female==1 & nspouse>=1 & nchild==0
replace hhtype=7 if nhhhead_female==1 & nspouse==0 & nchild>0
replace hhtype=8 if nhhhead_female==1 & nspouse==0 & nchild==0
replace hhtype=9 if hhtype==.
label define hhtype 1 "Male head with spouse and children" 2 "Male head with spouse, no children" 3 "Male head, no spouse, and children" 4 "Male head, no spouse, no children" 5 "Female head with spouse and children" 6 "Female head with spouse, no children" 7 "Female head, no spouse, and children" 8 "Female head, no spouse, no children" 9 "Other"
label values hhtype hhtype
tab hhtype if hv101==1 [iweight=hv005/1000000
-
Attachment: hhtype..jpg
(Size: 106.07KB, Downloaded 724 times)
[Updated on: Tue, 17 January 2023 11:38] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: FAMILY STRUCTURE [message #27438 is a reply to message #27396] |
Mon, 14 August 2023 11:50 |
Bridgette-DHS
Messages: 3199 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.
|
|
|
|
|
|