The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Service Provision Assessment (SPA) » Linking dataset in SPA_Ethiopia
Re: Linking dataset in SPA_Ethiopia [message #9371 is a reply to message #9298] Mon, 21 March 2016 11:05 Go to previous messageGo to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
Although we do not have access or distribute the Ethiopia SPA data, here is some guidance from our technical expert Dr. Wenjuan Wang regarding SPA data in general:
Quote:

It is always possible to link between facility inventory data, provider data and client (exit and observation) data using facility id and provider id. Facility id variable should be included in facility, provider and client data files and provider id should be included in provider and client data files.

Let's say if you are interested in providers and want to merge some facility variables into the provide file. This is going to be a many-to-one merging because multiple providers are associated with one facility
See below the Stata program for this type of merging.
use providerdata.dta, clear /* you need to use the path where your data files are stored*/
merge m:1 facilityid using facilitydata.dta  /* variable "facilityid" is the facility identifier(it may be a different name in ESPA files); it has to be the same variable name in facility and provider data. Otherwise you need to rename it before merging*/
drop if _merge!=3 /*drop unmatched cases*/
save mergedfile.dta, replace /*save merged file */


The program for merging facility and client data would be similar as above, just replace the provider dataset with the client dataset.

If you are interested to merge some provider variables into the client file, the identifiers would be two variables: facilityid and providerid
use clientfile.dta, clear
merge m:1 facilityid providerid using providerdata.dta  /*as above, both variables should have the same name in provider and client data, otherwise, rename them before merging */
drop if _merge!=3 
save mergedfile.dta, replace

Let us know if you have other questions.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: merging SPA datasets: Kenya 2010
Next Topic: Kenya SPA 2010 - how to apply weights
Goto Forum:
  


Current Time: Wed Dec 11 23:58:38 Coordinated Universal Time 2024