dhs {childfree}R Documentation

Read and recode UN Demographic and Health Surveys (DHS) individual data

Description

Read and recode UN Demographic and Health Surveys (DHS) individual data

Usage

dhs(files, extra.vars = NULL, progress = TRUE)

Arguments

files

vector: a character vector containing the paths for one or more Individual Recode DHS data files (see details)

extra.vars

vector: a character vector containing the names of variables to be retained from the raw data

progress

boolean: display a progress bar

Details

The Demographic and Health Surveys (DHS) program regularly collects health data from population-representative samples in many countries using standardized surveys since 1984. The "individual recode" data files contain women's responses, while the "men recode" files contain men's responses. These files are available in SPSS, SAS, and Stata formats from https://www.dhsprogram.com/, however access requires a free application. The dhs() function reads one or more of these files, extracts and recodes selected variables useful for studying childfree adults and other family statuses, then returns a single data frame.

Although access to DHS data requires an application, the DHS program provides model datasets for practice. The example provided below uses the model data file "ZZIR62FL.SAV", which contains fictitious women's data, but has the same structure as real DHS data files. The example can be run without prior application for data access.

Known issues

Value

A data frame containing variables described in the codebook available using vignette("codebooks")

Examples

data <- dhs(files = c("ZZIR62FL.SAV"), extra.vars = c("v201"))

[Package childfree version 0.0.2 Index]