An open API service indexing awesome lists of open source software.

https://github.com/corymccartan/blockpop

Estimate Census Block Populations for 2020
https://github.com/corymccartan/blockpop

Last synced: 3 months ago
JSON representation

Estimate Census Block Populations for 2020

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# **blockpop**: Estimate Census Block Populations for 2020

[![R-CMD-check](https://github.com/CoryMcCartan/blockpop/workflows/R-CMD-check/badge.svg)](https://github.com/CoryMcCartan/blockpop/actions)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)

2020 Census data is delayed and will be affected by differential privacy.
This package uses FCC block-level population estimates from 2010--2019, which
are based on new roads and map data, along with decennial Census and ACS data,
to estimate 2020 block populations, both overall and by major race/ethnicity
categories (using iterative proportional fitting).

## Installation

You can install the development version from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("CoryMcCartan/blockpop")
```

## Usage

We start by downloading the FCC data locally (although you can skip this
step if you just want estimates for one state).

```{r include=F}
library(blockpop)
```

```{r eval=F}
library(blockpop)
bl_download_fcc("data-raw/fcc.csv")
```

Then we can extract the data for the state we care about and construct the 2020
block estimates.

```{r message=F}
library(dplyr)

fcc_d = bl_load_state("WA", "data-raw/fcc.csv")
block_d = bl_est_2020(fcc_d)

print(block_d)
summarize(block_d, across(starts_with("pop"), sum))
```

To add populations by race and ethnicity, we need to download ACS and 2010
Census data.

```{r include=F}
acs_d = readr::read_rds("data-raw/acs.rds")
census_d = readr::read_rds("data-raw/census2010.rds")
```
```{r eval=F}
acs_d = bl_download_acs_vars("WA")
census_d = bl_download_2010_vars("WA")
```

Then we call `bl_harmonize_vars()` to create block-level estimates
that still total to 2020 block populations and are close to ACS estimates at
the block group level.

```{r}
bl_harmonize_vars(block_d, census_d, acs_d)
```