Learn How to Use The DHS Program’s Code Share Library on GitHub

The DHS Program recently released three YouTube tutorial videos to help DHS data users access The DHS Program’s Code Share Library on GitHub. The Code Share Library was started in 2018 to provide code for producing DHS indicators listed in the Guide to DHS Statistics using statistical software like Stata or SPSS. This year, The DHS Program has begun preparing R code as well. You do not need to create a GitHub account to copy or download any code to produce DHS indicators; it is publicly available for use.

The first video, Overview of The DHS Program’s Code Share Library on GitHub, explains the main components of the Code Share Library, including Stata and SPSS repositories, the indicator list, ReadMe file, and chapter folder contents. In each repository on GitHub, there is an important ReadMe file with instructions for users to read before using the code provided.

The second tutorial video, Preparing to Run The DHS Program’s Shared Code in Stata, demonstrates how to prepare to run code to produce DHS indicators in the statistical software Stata using the model datasets. The model datasets were created strictly for practice and do not represent any country’s actual data. Unlike datasets for specific surveys, users do NOT need to register to download model datasets.

One way to start using the Code Share Library is to download the entire repository on your computer. If any update is made to the code in the future, you will need to download the updated code from the Code Share Library. Another way to run the code is to copy and paste the code for your indicator of interest from GitHub to your own personal do file, without having to download the entire repository.

The third video, Running The DHS Program’s Shared Code on Stata, demonstrates how to run the code in Stata to construct indicator variables and produce tables for the indicators. The tables provide a simple tabulation that follows the standard DHS tabulation plan used for survey final reports.

If you do not understand why an indicator was coded in a specific way, check the Guide to DHS Statistics. If you have further questions, email us at codeshare@dhsprogram.com or post your question on The DHS Program User Forum. Follow The DHS Program on Twitter, Facebook, and LinkedIn for the latest news about code updates (including forthcoming R code), survey dataset releases, and more. Happy coding!

2 thoughts on “Learn How to Use The DHS Program’s Code Share Library on GitHub

  1. The RDHS 2019-21 Tables 10.6 and 10.11. I can’t understand the difference between the first two columns. If a child had diarrohea and did not seek treatment why are they allocated to a health facility type? Can someone explain these slides?

    • Great question! The first column of Table 10.6 includes all children with symptoms of ARI in the denominator (13) irrespective of whether they sought advice or treatment, and the second column includes all children with symptoms of ARI for whom advice or treatment was sought (101). The information in the numerators about the source of advice or treatment is the same in both columns. So we can see that advice or treatment was sought from the public sector for 63.2% of all children with symptoms of ARI, and advice or treatment was sought from the public sector for 85.7% of all children with symptoms of ARI for whom advice or treatment was sought. Similarly, in Table 10.11 the first column includes all children with diarrhea in the denominator (1,141) and the second column includes only children with diarrhea for whom advice or treatment was sought (606). Again the numerators (the source of advice or treatment) is the same for both columns. So we can see that advice or treatment was sought from the public sector for 42.5% of all children with diarrhea, and advice or treatment was sought from the public sector for 80.0% of children with diarrhea for whom advice or treatment was sought.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

The information provided on this Web site is not official U.S. Government information and does not represent the views or positions of the U.S. Agency for International Development or the U.S. Government.

The DHS Program, ICF
530 Gaither Road, Suite 500, Rockville, MD 20850
Tel: +1 (301) 407-6500 • Fax: +1 (301) 407-6501
dhsprogram.com

Subscribe to The DHS Program Blog:

* = required field

Anthropometry measurement (height and weight) is a core component of DHS surveys that is used to generate indicators on nutritional status. The Biomarker Questionnaire now includes questions on clothing and hairstyle interference on measurements for both women and children for improved interpretation.

Subscribe to The DHS Program Blog:

* = required field