Introduction to the DHS.rates package

Mahmoud Elkasabi, Ph.D.

2018-04-16

Overview

The package was developed to calculate key indicators based on the Demographic and Health Survey data. In addition to calculating the indicators on the national level, the DHS.rates allows for domain level indicators.

In addition to the indicators, the ‘DHS.rates’ package estimates precision indicators such as Standard Error (SE), Design Effect (DEFT), Relative Standard Error (RSE) and Confidence Interval (CI).

The package is developed according to the DHS methodology of calculating the DHS indicators outlined in the “DHS Guide to Statistics” (Rutstein and Rojas 2006, http://dhsprogram.com/pubs/pdf/DHSG1/Guide_to_DHS_Statistics_29Oct2012_DHSG1.pdf) and the DHS methodology of estimating the precision indicators outlined in the “DHS Sampling and Household Listing Manual” (ICF International 2012, https://dhsprogram.com/pubs/pdf/DHSM4/DHS6_Sampling_Manual_Sept2012_DHSM4.pdf).

Datasets

First you need to install the package from the CRAN as follows:

install.packages("DHS.rates")

Call any of the following datasets provided with the package:

  1. The “AWIR70” for all women 15-49: an artificial dataset of a DHS survey where all women age 15-49 were eligible for the survey.

  2. The “EMIR70” for ever-married women 15-49 an artificial dataset of a DHS survey where only ever-married women age 15-49 were eligible for the survey. In ever-married women surveys, inflation factors called All-women factors have to be considered to produce indicators for all women.

  3. The “ADBR70” for all Births: an artificial dataset of a DHS survey that include all birth for interviewed women age 15-49.

library(DHS.rates)
data("AWIR70")
data("EMIR70")
data("ADBR70")

You can use your own DHS IR individual (women’s) recode files or BR births recode files downloaded from https://dhsprogram.com/data/available-datasets.cfm

in this case you will need to install and use the “haven” library to read the data. In the example below, I’m reading a Stata file:

library(haven)
XXIR70 <- read_dta("C:\\Users\\.............................\\XXIR7HFL.DTA")
XXIR70 <- as.data.frame(XXIR70)

The fert function

The fert function calculates the following fertility indicators:

  1. Total Fertility Rate (TFR)
  2. General Fertility Rate (GFR)
  3. Age Specific Fertility Rate (ASFR).

The fert function uses the DHS IR individual (women’s) recode files

Examples

Total Fertility Rate (TFR):

fert can calculate Total Fertility Rate (TFR) based on all women AWIR70 data

(TFR <- fert(AWIR70,Indicator="tfr"))
## [[1]]
##        TFR    N   WN
## [1,] 4.011 8442 8625

Jackknife SE for TFR

in the previous example you can use the JK argument to estimate SE, DEFT, RSE and CI. the SE is based on Jackknife variance estimation

(TFR <- fert(AWIR70,Indicator="tfr",JK="Yes"))
## [[1]]
##        TFR    SE    N   WN  DEFT   RSE   LCI   UCI iterations
## [1,] 4.011 0.142 8442 8625 1.207 0.035 3.726 4.295        120

General Fertility Rate (GFR)

fert can calculate GFR and estimate SE, DEFT, RSE and CI based on ever-married women EMIR70 data

For ever-married samples, you need to call the EverMW argument and use AWFact to define the variable name of the All-women factor

(GFR <- fert(EMIR70,Indicator="gfr",EverMW="YES",AWFact="awfactt"))
## [[1]]
##         GFR   SE    N   WN  DEFT   RSE    LCI     UCI
## [1,] 91.983 4.19 9472 6710 1.497 0.046 83.603 100.364

Age Specific Fertility Rates (ASFR)

fert can calculate ASFR and estimate SE, DEFT, RSE and CI based on all women AWIR70 data

(ASFR <- fert(AWIR70,Indicator="asfr"))
## [[1]]
##     AGE    ASFR     SE    N   WN  DEFT   RSE     LCI     UCI
## 0 15-19 111.102  7.689 1789 1829 1.091 0.069  95.724 126.481
## 1 20-24 207.647 10.357 1554 1566 1.110 0.050 186.932 228.361
## 2 25-29 188.508 10.712 1490 1552 1.220 0.057 167.084 209.933
## 3 30-34 158.503 10.762 1386 1431 1.196 0.068 136.980 180.027
## 4 35-39 104.737  9.207 1070 1126 0.953 0.088  86.324 123.150
## 5 40-44  24.797  6.285  800  780 1.078 0.253  12.226  37.368
## 6 45-49   6.848  4.496  354  340 1.027 0.657  -2.144  15.839

Sub-national indicators

you can calculate sub-national TFR by using the “Class” argument.

(TFR <- fert(AWIR70,Indicator="tfr",JK="Yes", Class="v025"))
##   Class   TFR    SE    N   WN  DEFT   RSE   LCI   UCI iterations
## 1 rural 4.573 0.156 4462 5122 1.132 0.034 4.261 4.886         68
## 2 urban 3.197 0.207 3980 3503 1.458 0.065 2.783 3.612         52

Sub-national indicators for Ever-married samples

When Class is used, you might need to use the relevent AWFact as below; “awfactu” is used to produce indicators on the urban/rural level, “v025”.

(GFR <- fert(EMIR70,Indicator="gfr", EverMW="YES",AWFact="awfactu", Class="v025"))
## [[1]]
##   Class    GFR    SE    N   WN  DEFT   RSE    LCI     UCI
## 1 rural 97.851 4.127 7230 5661  1.25 0.042 89.597 106.105
## 2 urban 63.971 7.362 2203  989 1.509 0.115 49.246  78.696

The chmort function

The chmort function calculates the following childhood mortality indicators:

  1. Neonatal Mortality Rate (NNMR)
  2. Post-neonatal Mortality Rate (PNNMR)
  3. Infant Mortality Rate (IMR)
  4. Child Mortality Rate (CMR)
  5. Under-5 Mortality Rate (U5MR).

The chmort function uses the DHS BR birth recode files

Examples

childhood mortality rates:

chmort can calculate five-year childhood mortality rates based on birth ADBR70 data

(chmort(ADBR70))
## [[1]]
##        Rate    N
## NNMR  29.72  813
## PNNMR 24.04  931
## IMR   53.76  968
## CMR   18.79 1240
## U5MR  71.53 1477

Jackknife SE for childhood mortality rates

in the previous example you can use the JK argument to estimate SE, RSE and CI. the SE is based on Jackknife variance estimation

(chmort(ADBR70,JK="Yes"))
## [[1]]
##        Rate    SE    N  RSE   LCI   UCI iterations
## NNMR  29.72  6.91  813 0.23 15.90 43.55         50
## PNNMR 24.04  5.75  931 0.24 12.54 35.53         50
## IMR   53.76  7.63  968 0.14 38.50 69.02         50
## CMR   18.79  4.75 1240 0.25  9.28 28.29         50
## U5MR  71.53 10.22 1477 0.14 51.09 91.98         50

The study period in the previous examples are the default 5 years previous to the survey. The ten-year children mortality rates can be calculated using the Period argument as follows

(chmort(ADBR70,Period = 10))
## [[1]]
##        Rate    N
## NNMR  32.18 1486
## PNNMR 24.79 1535
## IMR   56.97 1593
## CMR   24.25 1748
## U5MR  79.83 2005

Similar to fert, in chmort the Class can be used to produce domain level indicators.