The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Bangladesh » Table reproduced using code on Git does'not match the report
Table reproduced using code on Git does'not match the report [message #23552] Wed, 06 October 2021 00:06 Go to next message
salamin is currently offline  salamin
Messages: 5
Registered: September 2021
Member
Hi, I am complete novice in DHS dataset and trying learn how to analyze DHS Data.
As a first step I am trying to reproduce the tables reported in the BDHS 2017 final report using the STATA code provided on the GIT.

However, I am unable to reproduce a table that matches the final report.

For example, following code was used to generate number of ANC visits by executing !RHmain.do file.
. tab v025 rh_anc_numvs [iw=wt], row nofreq 

   type of |
  place of |                  Number of ANC visits
 residence |      none          1        2-3         4+  don't kno |     Total
-----------+-------------------------------------------------------+----------
     urban |      3.32       6.09      16.67      37.13      36.79 |    100.00 
     rural |      6.10       9.71      22.94      28.88      32.38 |    100.00 
-----------+-------------------------------------------------------+----------
     Total |      5.32       8.69      21.17      31.20      33.62 |    100.00

But, in the BDHS 2017 reports the following table (See the attached image).
/index.php?t=getfile&id=1758&private=0

Another matter that caught my attention was the number of missing values. When I explored rh_anc_numvs had 12565 missing values
Does this indicate this specific question was collected on a sub-sample? if so how was the subsample defined?

The 2017 BDHS is number of eligible women interviewed is 20,127 and reported table (image) above shows Number of women 5,051. So the number of missing value should be 15,076.
Could the mismatch with report is due to the mismatch in number of missing values? Or am I using the code incorrectly?

Thank you in advance for taking the time to help.
Re: Table reproduced using code on Git does'not match the report [message #23553 is a reply to message #23552] Wed, 06 October 2021 03:15 Go to previous messageGo to next message
Mlue
Messages: 92
Registered: February 2017
Location: North West
Senior Member
Good day,

Have you tried using the following code?

tab rh_anc_numvs v025 [iw=wt], col nofreq

* If your dataset is setup for complex surveys (svyset)
svy: tab rh_anc_numvs v025, percent format(%9.1f) miss col
svy: tab rh_anc_numvs v025, count format(%9.0f) miss

Re: Table reproduced using code on Git does'not match the report [message #23558 is a reply to message #23553] Wed, 06 October 2021 12:49 Go to previous messageGo to next message
salamin is currently offline  salamin
Messages: 5
Registered: September 2021
Member
Thank you that worked!
Re: Table reproduced using code on Git does'not match the report [message #23576 is a reply to message #23552] Tue, 12 October 2021 08:25 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello,

Usually the DHS reports these indicators for women who have had a birth in the last five years. This is why in the RH_age_period.do file of this chapters on GitHub you will find a variable period set to 60 (12*5).

However in the BDHS 2017 final report you will see at the top of the table that the indicator is reported for women with a birth in the last 3 years. So you must change the period variable to 36. Always check the table titles and notes to make sure the standard code does not need to be adjusted for country-specific changes.

When you make this change and run the standard code you will match the final report with only using the weights as you have below. The svy is used to obtained the correct standard error if your analysis involves statistical models or reporting confidence intervals.

Thank you.
Best,
Shireen Assaf
The DHS Program

Re: Table reproduced using code on Git does'not match the report [message #23577 is a reply to message #23552] Tue, 12 October 2021 08:31 Go to previous message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello again,

I forgot to respond about the missing. The large number of missing is because this indicator is only among women with a birth in the last 3 years. In this survey approximately 12 thousand women have had no births at all.

Best,
Shireen
Previous Topic: Making new variables
Next Topic: Variable regarding microcredit involvement.
Goto Forum:
  


Current Time: Wed Nov 27 02:22:44 Coordinated Universal Time 2024