The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Service Provision Assessment (SPA) » Replicating table 3.3 and 3.7 in Tanzania SPA 2014-15 (2014-15 TSPA)
Re: Replicating table 3.3 and 3.7 in Tanzania SPA 2014-15 [message #23300 is a reply to message #23294] Wed, 18 August 2021 11:13 Go to previous messageGo to previous message
SaraDHS is currently offline  SaraDHS
Messages: 46
Registered: December 2020
Member
Hello Shakim,

Recreating the SPA tables can be a challenge, as the construction of variables can change from country to country. If you want to recreate the tables, first make sure you are using the facility weights.

gen wt=facwt/1000000

Your code for the specific items in the tables is close. I have checked the CSPro code that was used to create the tables originally, and recreated it below. These all match within 1%.

*WATER
gen water=0
replace water=1 if inlist(q330,1,2,10) | (inlist(q330,3, 4, 5, 7, 9) & inlist(q331, 1, 2))
tab water [iw=wt]

*COMMUNICATION EQUIPMENT
gen commu1=0
replace commu1=1 if q311==1 & q312==1

gen commu2=0
replace commu2=1 if q315==1 & q314==1

gen commu3=0
replace commu3=1 if q317==1 & q318==1

gen commu4=0
replace commu4=1 if q315a==1

gen commun=0
replace commun=1 if commu1==1 | commu2==1 | commu3==1 | commu4==1

tab commun [iw=wt]

*EMERGENCY TRANSPORT
gen emergen_transport=0
replace emergen_transport=1 if (q450==1 & q453==1) | q452==1
tab emergen_transport [iw=wt]

*LIVER OR RENAL FUNCTION TEST
gen lrt=0
replace lrt =1 if q834==1 & q835==1
tab lrt [iw=wt]

*XRAY MACHINE
gen xray=0
replace xray=1 if (q881a_1==1 & q881b_1==1) | (q881a_2==1 & q881b_2==1)
tab xray [iw=wt]


Best of luck with your work!

Sara


Sara Riese, PhD Senior Demographic and Health Researcher, DHS Program
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Replicating table in DR Congo SPA 2017-18
Next Topic: Creating some variables
Goto Forum:
  


Current Time: Thu Jan 9 16:59:57 Coordinated Universal Time 2025