Skip to contents

Download and load U.S. census American Community Survey (ACS) Public Use Microdata Samples (PUMS): census.gov/programs-surveys/acs/microdata.html

Usage

download_census_pums(dir, state, year = 2021, level = "both",
  one_year = TRUE, calculate_error = FALSE, crosswalk = TRUE,
  geoids = NULL, verbose = TRUE)

Arguments

dir

Directory in which to save the file(s).

state

Postal or FIPS code of the state.

year

4 digit year, between 2005 and the most recent year.

level

A character indicating whether to get the person- or household-level sample. Defaults to both.

one_year

Logical; if FALSE, will get the 5-year estimates rather than the 1-year file. If not specified, will fall back to the 5-year file if the 1-year file is not available.

calculate_error

Logical; if TRUE, will calculate standard errors for each variable using the Successive Difference Replicate Formula from the census.gov/programs-surveys/acs/library/handbooks/pums.html.

crosswalk

Logical; if FALSE, will not retrieve the PUMA relationship files for associating Census tracts with PUM areas. This will be treated as TRUE if geoids is specified.

geoids

A vector of county, tract, or block group GEOIDs within the specified state to select PUM areas by; defaults to all areas. If specified, crosswalk will be treated as TRUE.

verbose

Logical; if FALSE, will not print status messages.

Value

A list with entries for year and state (as specified), dictionary (containing the data dictionary for that year), household and/or person

(with survey data), and optionally household_error and/or person_error

(if calculate_error is TRUE), and crosswalk (if crosswalk is TRUE or geoids is specified).

Examples

if (FALSE) {
download_census_pums(".", "va")
}