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
- Host: GitHub
- URL: https://github.com/corymccartan/blockpop
- Owner: CoryMcCartan
- License: gpl-3.0
- Created: 2021-04-18T02:10:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-03T03:07:28.000Z (almost 4 years ago)
- Last Synced: 2025-01-10T23:35:24.244Z (5 months ago)
- Language: R
- Homepage: https://corymccartan.github.io/blockpop
- Size: 2.3 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
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
[](https://github.com/CoryMcCartan/blockpop/actions)
[](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)
```