The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » GitHub Code Share Library » Regional child mortality with DHS.rates
Regional child mortality with DHS.rates [message #28199] Tue, 28 November 2023 13:28 Go to next message
Anne Huercanos is currently offline  Anne Huercanos
Messages: 4
Registered: November 2023
I am using the R package DHS.rates to produce estimates at the regional (ADM1) level. It worked for TFR.
Running this successfully produced subnational TFRs:

df <- fert(IRdata,Indicator="tfr", JK="Yes", Class="v024")

But when I try it an analogous approach with child mortality, it does not work.
Running this:

df <- chmort( BRdata, JK = "Yes", Class="v024")

produces the following error:

"Error in attributes(DatD[[Class]])$levels[[j]] : subscript out of bounds"

I believe the hang-up is due to the "Class" option, since running without the option successfully produces national level child-mortality indicators. (I've also tried other "Class" options such as "v025". This also produced the same error.

Any suggestions?

Re: Regional child mortality with DHS.rates [message #28200 is a reply to message #28199] Tue, 28 November 2023 15:47 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 787
Registered: January 2013
Senior Member
Yes, it does look like the latest version has a bug in it related to the Class parameter. We will try to get this fixed quickly.
For now, as a quick fix, you could loop over the v024 levels and run a separate chmort in each loop.
Previous Topic: Find the codebook or recode map for HIV/Biomarker dataset
Goto Forum:

Current Time: Sun Mar 3 13:34:16 Coordinated Universal Time 2024