The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Service Provision Assessment (SPA) » Replicating table (Ethiopia SPA 2021-22)
Replicating table [message #28722] Thu, 29 February 2024 05:05 Go to next message
foysal is currently offline  foysal
Messages: 9
Registered: August 2021
Member
Dear Sara and SPA experts,
I am trying to replicate table 3.7.1 of Ethiopia SPA 2021-22 report in Stata. I was unable to create some variables. My codes are:
gen wt=facwt/1000000

*X-ray machine
gen xray=0
replace xray=1 if ((q881b_1==1 & q881c_1==1) | (q881b_2==1 & q881c_2==1 & q881b_3==1))
tab xray [iw=wt]

*full blood count
gen blood_count=0
replace blood_count=1 if (q802a_1==1 & q802b_1==1 & q802c_1==1)
tab blood_count [iw=wt]

*Blood glucose
recode bloodgluc 9=.
recode bloodgluc (1=1 "available") (0=0 "not available"), gen (blood_glucose)
label variable blood_glucose "Blood glucose"
tab blood_glucose [iw=wt],m

*liver or renal function test
gen lrt=0
replace lrt =1 if q834==1 & q835==1
tab lrt [iw=wt]

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.
Re: Replicating table [message #28795 is a reply to message #28722] Sat, 09 March 2024 06:36 Go to previous message
SaraDHS is currently offline  SaraDHS
Messages: 46
Registered: December 2020
Member
Hello,
For all of these indicators, note that the title of the table indicates that health posts are excluded.

This is the main issue. Most of your codes are correct, you just need to add this in the tabulation line. For a couple of the indicators I have added corrections or clarifications and commented out your code below.

Best,
Sara


gen wt=facwt/1000000

*X-ray machine - you have this variable already in the dataset at factbxray, so just tab that and exclude health posts
tab factbxray if factype!=5 [iw=wt],m
/*gen xray=0
replace xray=1 if ((q881b_1==1 & q881c_1==1) | (q881b_2==1 & q881c_2==1 & q881b_3==1))
tab xray [iw=wt]
*/


*full blood count
gen blood_count=0
replace blood_count=1 if (q802b_1==1 & q802c_1==1)
tab blood_count if factype!=5 [iw=wt]

/*gen blood_count=0
replace blood_count=1 if (q802a_1==1 & q802b_1==1 & q802c_1==1)
tab blood_count [iw=wt]
*/


*Blood glucose ok - remove health posts - although you can just use bloodgluc, no need to create a new variable
recode bloodgluc 9=.
recode bloodgluc (1=1 "available") (0=0 "not available"), gen (blood_glucose)
label variable blood_glucose "Blood glucose"
tab blood_glucose if factype!=5 [iw=wt],m

*liver or renal function test
gen lrt=0
replace lrt =1 if q834==1 & q835==1
tab lrt if factype!=5 [iw=wt


Sara Riese, PhD Senior Demographic and Health Researcher, DHS Program
Previous Topic: Merging Nepal datasets (2015 and 2021_
Next Topic: Creating some variables
Goto Forum:
  


Current Time: Thu Nov 28 13:00:14 Coordinated Universal Time 2024