The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Rotav Vaccine and nutrition
Re: Rotav Vaccine and nutrition [message #27558 is a reply to message #27557] Sun, 03 September 2023 21:48 Go to previous messageGo to previous message
backclac is currently offline  backclac
Messages: 25
Registered: August 2023
Member
Hello Prof,
I have been able to extract the indicators needed for my project from the API using the following r syntax;
```{r}
#library
> library(devtools)
> library(usethis)
> library(rdhs)
> library(RJSONIO)
> library(tidyverse)

#example
#No education ED_EDUC_W_NED
> json_file<- fromJSON(" https://api.dhsprogram.com/rest/dhs/data?countryIds=AO,BF,BJ ,BU,CD,CF,CG,CI,CM,ET,GA,GH,GM,GN,KE,KM,LB,LS,MD,ML,MR,MW,MZ ,NG,NI,NM,RW,SL,SN,ST,SZ,TD,TG,TZ,UG,ZA,ZM&indicatorIds= ED_EDUC_W_NED")
> json_data1<- lapply(json_file$Data, function(x){unlist(x)})
> APIdata23<-as.data.frame(do.call("rbind",json_data1),stringsAsFactors = FALSE)
> xtabs(as.numeric(Value)~SurveyId,data=APIdata23)

#Selecting specific variables
xt1<-APIdata23 %>%
select(CountryName,SurveyYearLabel,Survey,Value, DenominatorWeighted)
View(xt1)
```

#I then selected and copied the viewed table to Excel
#I then calculate the number of population (N) as
N =(Value/100)*DenominatorWeighted
# I will then import the Excel file into r for complex analysis but I want to be sure if I am on track.
I have also realized that the indicator code CH_DIAT_C_ORZ has some different values for the same survey year due to a change in DenominatorWeighted.
I guess it is appropriate to use the values with the highest DenominatorWeighted

Kindly advice me
Thank you
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Childhood obesity
Next Topic: Overweight to under 5 children
Goto Forum:
  


Current Time: Tue Sep 10 01:39:15 Coordinated Universal Time 2024