nsfg {childfree}R Documentation

Read and recode National Survey of Family Growth (NSFG) data

Description

Read and recode National Survey of Family Growth (NSFG) data

Usage

nsfg(years, progress = TRUE)

Arguments

years

vector: a numeric vector containing the starting year of NSFG waves to include (2002, 2006, 2011, 2013, 2015, 2017)

progress

boolean: display a progress bar

Details

The U.S. Centers for Disease Control National Survey of Family Growth (NSFG) regularly collects fertility and other health information from a population-representative sample of adults in the United States. Between 1973 and 2002, the NSFG was conducted periodically. Starting in 2002, the NSFG transitioned to continuous data collection, releasing data in three-year waves (e.g., the 2013-2015, 2015-2017). The nsfg() function reads the raw data from CDC's website, extracts and recodes selected variables useful for studying childfree adults and other family statuses, then returns a single data frame.

Weights

The survey package can be used to incorporate sampling weights and obtain population-representative estimates by wave. After using nsfg() to obtain data for a given wave (see example below), use dat <- svydesign(data = dat, ids = ~cluster, strata = ~stratum, weights = ~weight, nest = TRUE) to incorporate information about the survey design.

Known issues

Value

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

Examples

data <- nsfg(years = 2017)

[Package childfree version 0.0.2 Index]