The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Domestic Violence » Comparing DHS6 and DHS7 district wise data (Female Labour Force Participation rates in Pakistan-using historic DHS6 data with DHS7)
Re: Comparing DHS6 and DHS7 district wise data [message #30193 is a reply to message #30152] Fri, 11 October 2024 16:11 Go to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 938
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:
The following lines will do this merge. I did not restrict to household heads with hv044=1, but you could do that. These lines will attach the household head's data to the record for each of the 3,334 couples in the CR file.

Many households do not have a couple in the CR file. There are actually many more household heads than couples. What you were doing was correct; I have only confirmed that.
* Stata lines to merge household head data with with couples, Pakistan 2017-18 survey

 

* Specify a workspace

cd e:\DHS\DHS_data\scratch

 

* Prepare a file of household heads

use "...PKPR71FL.DTA", clear

keep hv*

keep if hv101==1

gen cluster=hv001

gen hh=hv002

gen in_PR=1

save PK7A_head.dta, replace

 

* Prepare CR file

use "...PKCR71FL.DTA", clear

gen cluster=v001

gen hh=v002

gen in_CR=1

merge m:1 cluster hh using PK7A_head.dta

 

tab _merge

tab in_PR in_CR,m
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Spatial analysis
Next Topic: IPV InTANZANIA 2022
Goto Forum:
  


Current Time: Mon Jun 9 15:18:31 Coordinated Universal Time 2025