Read Census Privacy Protected Microdata Files

Implements data processing described in to align modern differentially private data with formatting of older US Census data releases. The primary goal is to read in Census Privacy Protected Microdata Files data in a reproducible way. This includes tools for aggregating to relevant levels of geography by creating geographic identifiers which match the US Census Bureau's numbering. Additionally, there are tools for grouping race numeric identifiers into categories, consistent with OMB (Office of Management and Budget) classifications. Functions exist for downloading and linking to existing sources of privacy protected microdata.


ppmf

R-CMD-check ppmf statusbadge Lifecycle:stable CRANstatus CRAN downloads

The goal of ppmf is to convert Census Privacy Protected Microdata Files into somewhat wider data aggregated to a geographic level.

Installation

To install the stable version from CRAN, use the following code:

install.packages('ppmf')

You can install the development version from GitHub with:

# install.packages('remotes')
remotes::install_github('christopherkenny/ppmf')

Basics

Load the package:

library(ppmf)

Download and read data with:

path <- download_ppmf(dsn = 'filename.csv', dir = 'some/directory', version = '19')
al <- read_ppmf(state = 'AL', path = path)

Version ‘19’ reflects the 19.61 finalized parameters used again for the 2020 Census.

For future use, I recommend storing the path to the data for future sessions using:

add_pmmf19_path(path)

Then the path can be recovered with:

path19 <- Sys.getenv('ppmf19')

Once you’ve read in what you want, you can aggregate it to the right level:

al <- al |> add_geoid()
blocks <- agg(al)

And aggregated data can use the GEOID to merge with shapefiles:

library(dplyr) # to clean up the data

shp <- tigris::blocks('AL', year = 2010) |> 
  select(GEOID10, geometry) |> rename(GEOID = GEOID10)
shp <- shp |> left_join(blocks, by = 'GEOID')

# always clean shp!
shp[is.na(shp)] <- 0

For users with the newest package version, there is an added dependency on censable, which allows for an easier workflow. If you’ve used the add_pmmf*_path() workflow suggested, you don’t even need to supply the paths!

This will not just read the ppmf data, it will merge it with 2010 Census populations (by major race/ethnicity grouping) and add the corresponding geometries.

al <- read_merge_ppmf('AL', level = 'block', versions = '19')

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ppmf")

0.2.1 by Christopher T. Kenny, a year ago


https://github.com/christopherkenny/ppmf/, https://christophertkenny.com/ppmf/


Report a bug at https://github.com/christopherkenny/ppmf/issues


Browse source code at https://github.com/cran/ppmf


Authors: Christopher T. Kenny [aut, cre] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports censable, dplyr, readr, rlang, stringr, tibble, tidyr, zip

Suggests roxygen2, spelling


See at CRAN