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 #2488 is a reply to message #275] Sat, 28 June 2014 20:38 Go to previous messageGo to previous message
owraza is currently offline  owraza
Messages: 37
Registered: December 2013
Location: Nebraska, US
Member
How do I know if I have merged files in STATA correctly or not? I am trying to merge IR file with PR file, I followed following codes:

use "C:\Users\Owais\Copy\DHS\DHS13 Datasets\Households\PKPR61FL.DTA", clear
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

use "C:\Users\Owais\Copy\DHS\DHS13 Datasets\Women\PKIR61FL.DTA", clear
sort v001 v002
merge m:m v001 v002 using "C:\Users\Owais\Copy\DHS\DHS13 Datasets\Households\PKPR61FL.DTA"
 
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 09:43:01 Coordinated Universal Time 2024