Re: Reshaping Data [message #30389 is a reply to message #30386] |
Wed, 20 November 2024 08:36 |
Bridgette-DHS
Messages: 3230 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS staff member, Tom Pullum:
Right--I had a typo and meant to say "... put the education of person (a) onto the record of person (b)." Glad you corrected that.
This (the "third configuration") is a situation in which the mother-in-law is the head of the household. There is fairly often an interest in attaching the education of the household head to everyone else in the household. I see that in the PR file for the Pakistan 2017-18 survey the head's sex and age are coded onto the records for all household members as hv219 and hv220 but the head's education is not.
There are 4 relevant education variables in the PR file: hv106, hv107, hv108, hv109. I will paste below a Stata program that does what I think you want to do. It includes a crosstab of hv106 for the two women.
The percentage of women who are in this kind of a pair is very small. It's an interesting topic but you may want to expand the relationships within the household. Let us know if you have other questions.
* Compare education of mother-in-law and daughter-in-law in Pakistan 2017-18 survey
* Mother-in-law is female head of household: hv101=1 and hv104=2
* Daughter-in-law: hv101=4 and hv104=2
use "...PKPR71FL.DTA", clear
describe hv101
* The label of hv101 is HV101
label list HV101
* How many pairs are there in the data?
tab hv219 if hv101==4 & hv104==2
* There are 623 pairs
lookfor education
* The education variables for all household members are hv106-hv109
* Construct a subfile of household heads with ID variables and education variables
keep if hv101==1
keep hv001 hv002 hv106-hv109
rename hv10* hv10*_head
* Merge the head's education variables onto every person in the household
merge 1:m hv001 hv002 using "...PKPR71FL.DTA"
tab _merge
drop _merge
* Identify women who are daughters-in-law of the household head
gen dtr_inlaw=0
* Daughter-in-law of male head
replace dtr_inlaw=1 if hv101==4 & hv104==2 & hv219==1
* Daughter-in-law of female head
replace dtr_inlaw=2 if hv101==4 & hv104==2 & hv219==2
label variable dtr_inlaw "Daughter in law of head"
label define dtr_inlaw 0 "No" 1 "Head is father in law" 2 "Head is mother in law"
tab dtr_inlaw
* The population of interest is cases with dtr_inlaw=2
* Simple comparison: crosstab of hv106 for the 623 pairs
tab hv106 hv106_head if dtr_inlaw==2
|
|
|