The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Dissemination and Capacity Strengthening » Application Programming Interface (API)  » Maternal and child health indicators by background characteristics
Maternal and child health indicators by background characteristics [message #24367] Mon, 02 May 2022 19:03 Go to next message
DHSuser_NY is currently offline  DHSuser_NY
Messages: 8
Registered: November 2019
Member
Hi,

Does anyone know if API can generate MCH indicators by background characteristics? I have specified background= all, but the code below only gives me totals for births in the past 2,3 or 5 years. Below is a frequency of the byvariableid. Thanks for your help.


import delimited using ///
" http://api.dhsprogram.com/rest/dhs/data?surveyYearStart=2006 &surveyYearEnd=2010&breakdown=all&indicatorIds=M L_IPTP_W_2SA,ML_IPTP_W_3SA,RH_ANCT_W_TL4,HA_CATH_W_NRS,HA_CA TH_W_ATR,HA_CATH_W_ATN&&scl=1000,3001,3002,4000,4001 ,4002,4003,5001,5002&selectSurveys=latest&returnfiel ds=surveyId,DHS_CountryCode,CountryName,SurveyYear,SurveyYea rLabel,SurveyType,FieldworkStart,FieldworkEnd,indicator,Indi catorID,value,IndicatorData,Footnotes,ByVariableId,shortname &f=csv", clear


ByVariableI |
d | Freq. Percent Cum.
------------+-----------------------------------
0 | 473 49.22 49.22
14000 | 163 16.96 66.18
14001 | 164 17.07 83.25
14002 | 161 16.75 100.00
------------+-----------------------------------
Total | 961 100.00





Re: Maternal and child health indicators by background characteristics [message #24368 is a reply to message #24367] Mon, 02 May 2022 21:56 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 787
Registered: January 2013
Senior Member
You didn't include the background characteristics in the return fields list, so you can't tell which record is which characteristic.
In the example attached I remove the returnfield list so that all columns are returned and you can see the characteristics.
  • Attachment: test.do
    (Size: 0.25KB, Downloaded 198 times)
Re: Maternal and child health indicators by background characteristics [message #24370 is a reply to message #24368] Tue, 03 May 2022 08:52 Go to previous message
DHSuser_NY is currently offline  DHSuser_NY
Messages: 8
Registered: November 2019
Member
Hi Trevor,

I see. This is a huge help!

Many thanks,
Suzette
Previous Topic: Source of contraception by method
Next Topic: Fetching a specific recode data file from API
Goto Forum:
  


Current Time: Thu Mar 28 21:26:50 Coordinated Universal Time 2024