The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use (other programs) » Reproducing reports in R using Github Code
Reproducing reports in R using Github Code [message #25729] Thu, 01 December 2022 11:41 Go to previous message
victor is currently offline  victor
Messages: 4
Registered: December 2022
Member
I am trying to reproduce some figures from DHS reports, specifically birth registration data.

Using this code from the github page, I should be able to do just that. https://github.com/DHSProgram/DHS-Indicators-R/blob/main/Cha p02_PH/PH_POP.R

However it seems that this code does not work. Am I doing something wrong?

The first line it already goes wrong
PRdata[["ager"]] <- ifelse(PRdata[["hv103"]]==1 , as.integer(PRdata[["hv105"]]/5), NA) 

using double square brackets is quite uncommon, but it should work. However addressing the hv103 and hv105 data like that is just incorrect. This data is spread across multiple columns per respondent, indicated by hv105_01, hv105_02 etc.

Hopefully someone know how to get this running.
 
Read Message
Read Message
Previous Topic: NFHS-5 Disability and health seeking
Next Topic: Difference DTA and SAV
Goto Forum:
  


Current Time: Tue Nov 26 18:13:36 Coordinated Universal Time 2024