Regional child mortality with DHS.rates [message #28199] |
Tue, 28 November 2023 13:28 |
Anne Huercanos
Messages: 4 Registered: November 2023
|
Member |
|
|
Hello!
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?
Thanks!
Anne
|
|
|
Re: Regional child mortality with DHS.rates [message #28200 is a reply to message #28199] |
Tue, 28 November 2023 15:47 |
Trevor-DHS
Messages: 802 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.
|
|
|