The package was developed to calculate key indicators based on the Demographic and Health Survey data, especially the IR individual (women’s) recode files. 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).
First you need to install the package from the CRAN as follows:
install.packages("DHS.rates")
Use your own DHS IR individual (women’s) recode files downloaded from https://dhsprogram.com/data/available-datasets.cfm
or call any of the following datasets provided with the package:
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.
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.
library(DHS.rates)
data("AWIR70")
data("EMIR70")
The fert function calculates the following fertility indicators:
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
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
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
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
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
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