The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Merging SPA datasets- Nepal SPA 2015
Re: Merging SPA datasets- Nepal SPA 2015 [message #14054 is a reply to message #14037] Wed, 07 February 2018 07:17 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3061
Registered: February 2013
Senior Member
Following is a response from DHS Senior Research Associate, Wenjuan Wang:

I guess you'd like to borrow some provider-level information into the facility file. If this is the case, we usually collapse provider variables to the facility level and then merge with the facility file and it is going to be a one-to-one merging. For example, you'd like a variable on % of providers at the facility who were trained in breastfeeding. Since the training information is stored in the provider file, you can first collapse this variable to the facility level and then merge with the facility file. The Stata commands are:

use NPPV71FLSP.DTA, clear
g train_bf = 0 
replace train_bf = 1 if p513_2==1 

collapse (mean) per_trbf=train_bf [pw=provwt], by(facil)
sort facil
save train_bf.DTA, replace

use NPFC71FLSP.DTA, clear 
merge 1:1 facil using train_bf.DTA

Please try and let me know if this works.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Declaring my Data Survey Data
Next Topic: Women's decision making power
Goto Forum:
  


Current Time: Thu May 16 06:39:48 Coordinated Universal Time 2024