The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Service Provision Assessment (SPA) » Replicating table in DR Congo SPA 2017-18 (Recreating variables)
Replicating table in DR Congo SPA 2017-18 [message #23316] Mon, 23 August 2021 01:57 Go to next message
foysal is currently offline  foysal
Messages: 9
Registered: August 2021
Member
Dear DHS Experts and SPA Users,
How can I create a variable named "Overnight observation beds (any)" having two categories (Yes, No) using variable "q112" in DR Congo SPA 2017-18?
I also want to recreate some variables from table 3.3, 3.7.1, and 3.9.1 in STATA. I have tried with the following codes:
gen sw=facwt/1000000
Table 3.3-
*Electricity
gen ect=0
replace ect=1 if if (q340==1 & q341==1) | (q343a==1 | q343b==1) & q345==1 & q346==1 | q343c==1
tab ect [iw=sw]
Table 3.7.1:
I want to reproduce variables "Sterilization equipment", and "Equipment for high level disinfection". But, I did not find any value of the variable "sterequip" in the dataset for sterilization equipment. Also, I did not find variable "hldequip" for equipment for high level disinfection.
Table 3.9.1:
* X ray machine
gen xr=0
replace xr=1 if (q881a_2==1 & q881b_2==1)
tab xr [iw=sw]

It looks like I am looking the right variables for creating electricity and x ray machine variables, but for some reason I am not getting the percentages as of the tables. I would greatly appreciate any help on this matter.

Many thanks
Re: Replicating table in DR Congo SPA 2017-18 [message #23324 is a reply to message #23316] Tue, 24 August 2021 10:11 Go to previous messageGo to next message
SaraDHS is currently offline  SaraDHS
Messages: 46
Registered: December 2020
Member
Dear Foysal,

Here is code for creating a variable on overnight observation beds. Be aware that there are very few facilities that have no overnight observation beds, so the variable may not be useful.

gen obsbeds=q112
recode obsbeds 998=.
recode obsbeds (1/max=1)
tab obsbeds [iw=sw], m

Below is the code for the other variables you were looking for. Please use the footnotes in the final report tables to guide your definitions. In most, though not all, cases, you should be able to recreate the variables using those definitions. For example, the "Sterilization equipment" is defined as "La formation sanitaire rapporte que certains instruments sont traités dans la formation sanitaire, et que cette dernière dispose d'un stérilisateur électrique à chaleur sèche fonctionnel, un autoclave électrique fonctionnel, ou un autoclave non-électrique avec une source de chaleur fonctionnelle disponible quelque part dans la formation sanitaire." If you use the questionnaire and the dataset to guide you, you can recreate the coding and would have gotten the same % as the table.
For "high level disinfection equipment the definition is "La formation sanitaire rapporte que certains équipements sont traités dans la formation sanitaire et que cette dernière dispose d'une bouilloire électrique fonctionnelle ou autre casserole avec une source de chaleur pour la désinfection à haut niveau par ébullition ou à haut niveau à la vapeur. La formation sanitaire dispose par ailleurs de chlore, de formaldéhyde ou de glutaraldéhyde pour la désinfection à haut niveau chimique le jour de l'enquête"

The results of the below coding replicate (or are within 1%) of the results in the final report tables.

*Electricity
gen ect=0
replace ect=1 if q340==1 & q341==1
replace ect=1 if regexm(q343, "A") & q345==1 & q346==1
replace ect=1 if regexm(q343, "B") & q345==1 & q346==1
replace ect=1 if regexm(q343, "D") & q345==1
replace ect=1 if regexm(q343, "C")
tab ect [iw=sw]

*Sterilization
gen ster=0
replace ster=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 ster [iw=sw]

*High level disinfection
gen hilvldis=0
replace hilvldis=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 hilvldis [iw=sw]

*Xray
gen xr=0
replace xr=1 if inrange(q1903,2,4) & q102_17==1 & ((q881b_1==1 & q881c_1==1) | (q881b_2==1 & q881c_2==1 & q881b_3==1))
tab xr [iw=sw]


Best,
Sara


Sara Riese, PhD Senior Demographic and Health Researcher, DHS Program
Re: Replicating table in DR Congo SPA 2017-18 [message #23330 is a reply to message #23324] Tue, 24 August 2021 15:02 Go to previous messageGo to next message
foysal is currently offline  foysal
Messages: 9
Registered: August 2021
Member
Dear Sara,

Thanks a lot for your help. I was able to match only the "high level disinfection" and "x ray machine" variable with the report table. The other variables codes as well as the output is given below:
gen sw=facwt/1000000
*Electricity
gen ect=0
replace ect=1 if q340==1 & q341==1
replace ect=1 if regexm(q343, "A") & q345==1 & q346==1
replace ect=1 if regexm(q343, "B") & q345==1 & q346==1
replace ect=1 if regexm(q343, "D") & q345==1
replace ect=1 if regexm(q343, "C")
tab ect [iw=sw]

ect Freq. Percent Cum.
------------+-----------------------------------
0 | 460.671274 33.38 33.38
1 | 919.328581 66.62 100.00
------------+-----------------------------------
Total | 1,379.9999 100.00
where in the report the percentage is 65 (table 3.3).
*Sterilization
gen ster=0
replace ster=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 ster [iw=sw]

ster | Freq. Percent Cum.
------------+-----------------------------------
0 | 1,168.4817 84.67 84.67
1 | 211.518143 15.33 100.00
------------+-----------------------------------
Total | 1,379.9999 100.00
the final report table percentage is 14 (table 3.7.1).

Please help me to get the same percentage as the tables.

Regards,
Foysal

Re: Replicating table in DR Congo SPA 2017-18 [message #23343 is a reply to message #23330] Wed, 25 August 2021 11:27 Go to previous message
SaraDHS is currently offline  SaraDHS
Messages: 46
Registered: December 2020
Member
Hi Foysal,
The code provided was how the variable was coded for the final report. It is done in a different software, so there may be small difference because of that, or there may have been other small changes. If the % is within 1% or so, you shouldn't worry about it.

Best,
Sara


Sara Riese, PhD Senior Demographic and Health Researcher, DHS Program
Previous Topic: Malawi SPA variables about number of providers
Next Topic: Replicating table 3.3 and 3.7 in Tanzania SPA 2014-15
Goto Forum:
  


Current Time: Wed Dec 4 03:06:06 Coordinated Universal Time 2024