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)
Replicating table 3.3 and 3.7 in Tanzania SPA 2014-15 [message #23294] Tue, 17 August 2021 12:07 Go to previous message
shakim is currently offline  shakim
Messages: 10
Registered: January 2021
Member
Dear DHS Experts and SPA Users,
I am trying to replicate some variables of table 3.3 and table 3.7 from Tanzania SPA 2014-15 in Stata. My code is:
Table 3.3-
*Improved water source:
gen water=0
replace water=1 if q330==1 | q330==2 | q330==3 | q330==4 | q330==5 | q330==7 | q330==9 | q330==10 & q331==2

*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 commun=0
replace commun=1 if commu1==1 | commu2==1

*Emergency transport
gen emergen_transport=0
replace emergen_transport=1 if (q450==1 & q453==1) | q453==1

Table 3.7-
*Liver or renal function test
gen q832 9=.
recode q832 (1=1) (2=0), gen (lrtest)
*X ray machine
gen xrmachine=0
replace xrmachine=1 if q881a_2==1 & q881b_2==1 & q881c_2==1

According to the questionnaire, it looks like I am looking the right variable, but for some reason I am not getting the percentages as of the table. Do I need to consider anything else? I would greatly appreciate any help on this matter.

Many thanks
 
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: Wed Nov 13 10:09:09 Coordinated Universal Time 2024