The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging DHS data in Stata
Re: Merging DHS data in Stata [message #9727 is a reply to message #9719] Tue, 10 May 2016 15:24 Go to previous messageGo to previous message
owraza is currently offline  owraza
Messages: 37
Registered: December 2013
Location: Nebraska, US
Member
clear all

*Renaming Household's unique variable*

use "C:\Users\...\PKPR61FL.DTA" 
gen v001=hv001
gen v002=hv002
label variable v001 "Cluster number_copy"
recast long v001
format %12.0g v001
label variable v002 "Household number_copy"
recast int v002
format %8.0g v002 

sort v001 v002
save "C:\Users\...\PKPR61FL_A.DTA"

*Merging Women's file with Household's file*

use "C:\Users\...\PKIR61FL.DTA", clear
sort v001 v002
merge m:m v001 v002 using "C:\Users\...\PKPR61FL_A.DTA"

* For checking merging has done correctly *
* v138=eligible women in women's questionnaire & hv010=eligible women in household's questionnaire*
tab v138 hv010 
 
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
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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to match women to their husbands
Next Topic: Merging HR and PR Files
Goto Forum:
  


Current Time: Wed Dec 25 21:50:50 Coordinated Universal Time 2024