The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Service Provision Assessment (SPA) » Creating some variables (SPA)
Creating some variables [message #23331] Tue, 24 August 2021 15:49 Go to previous message
ashraf is currently offline  ashraf
Messages: 3
Registered: August 2021
Member
Dear Sara and SPA experts,
I am trying to replicate table 3.5 and 3.7 of Afghanistan SPA 2018-19 report in Stata. I was unable to create the first two variables -Sterilization equipment and equipment for high-level disinfection of table 3.5 and variable "X ray machine" of table 3.7. My codes are:
gen wgt=facwt/1000000
*Sterilization equipment
gen str=0
replace str=1 if (q201==1 | q201==2) & ((q501a_03==1 & q501b_03==1) | (q501a_05==1 & q501b_05==1) | (q501a_06==1 & q501a_07==1 & q501b_07==1))
tab str [iw=wgt]
*High level disinfection
gen hidis=0
replace hidis=1 if (q201==1 | q201==2) & ((q501a_03==1 & q501b_03==1) | (q501a_05==1 & q501b_05==1) | (q501a_06==1 & q501a_07==1 & q501b_07==1) | (q501a_10==1 & inrange(q502g_5,1,3)))
tab hidis [iw=wgt]
*X ray machine
gen xray=0
replace xray=1 if (q881a_1==1 & q881b_1==1) | (q881a_2==1 & q881b_2==1)
tab xray [iw=wgt]

It looks like I am using the correct variables according to the footnotes of the tables, but I am not getting the same % as the final report table. I want to get the same % of the report table.
I would greatly appreciate any help with this matter.

Regards,
Ashraf
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Replicating table 3.3 and 3.7 in Tanzania SPA 2014-15
Next Topic: Creating two variable
Goto Forum:
  


Current Time: Thu Oct 10 07:28:13 Coordinated Universal Time 2024