Introduction to the DHS.rates package"

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" (Croft, Trevor N., Aileen M. J. Marshall, Courtney K. Allen, et al. 2018, https://dhsprogram.com/Data/Guide-to-DHS-Statistics/index.cfm) and the DHS methodology of estimating the sampling errors 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"))

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"))

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"))

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"))

Sub-national indicators

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

(TFR <- fert(AWIR70,Indicator="tfr",JK="Yes", Class="v025"))

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"))

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))

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"))

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

(chmort(ADBR70,Period = 120))

In the previous examples the study period ends at the time of the survey. To change the ending date to September 2013, PeriodEnd can be used as follows

(chmort(ADBR70,Period = 120, PeriodEnd = "2013-09"))

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

The chmort function

The chmortp function calculates childhood childhood mortality probabilities for 8 age segments 0, 1-2, 3-5, 6-11, 12-23, 24-35, 36-47, and 48-59 months.

The chmortp function uses the DHS BR birth recode files

Example

childhood mortality probabilities:

chmortp can calculate five-year childhood mortality probabilities based on birth ADBR70 data

(chmortp(ADBR70))

Similar to chmort, in chmortp the Period and PeriodEnd can be used to change the calculation reference period and the Class can be used to produce domain level indicators.



Try the DHS.rates package in your browser

Any scripts or data that you put into this service are public.

DHS.rates documentation built on Dec. 11, 2021, 10:01 a.m.