PAF 515: Data Science III Project Management

Lab 04: Visualizing The Intervention - Middle Atlantic Division

`

Lecture Videos




Introduction

Over the past three weeks we have had the opportunity to explore reproducible data project management strategies and analyze the patterns of social vulnerability in our Census Divisions. Specifically, we have identified the least and most vulnerable areas within our states of interest via descriptive statistics and data visualization techniques.

This week we will expand beyond this analysis to embark on a study of the relationship between our identified areas of social vulnerability and the governmental policy interventions of two tax credit programs: the New Markets Tax Credit program (NMTC), and the Low Income Housing Tax Credit program (LIHTC).

To begin, we will review videos and program summaries to gain a better understanding of the history and purpose of these credits and then conduct exploratory data analyses to determine whether there is a relationship between our identified areas of Social Vulnerability in 2010 and the amount of funds these areas received if they were eligible for either of the programs from 2011 - 2020.

We will employ a few different strategies to complete this analysis:

  1. Correlation
  2. K-Means Clustering
  3. Bivariate mapping

For correlation, we will create and examine scatterplots to visualize whether our data shows a visual trend between SVI and the tax credit programs. We will also use box plots to further examine any potential outliers or influential points within our data.

Next we will calculate and interpret the Pearson Correlation Coefficient (r) to better quantify this relationship. While there is no official chart with cut-off points to determine the strength of a relationship, there are some general guidelines such as the following chart from Boston University School of Public Health, which we will utilize to interpret our analyses:

Following our analysis of the correlation of all counties in our division, we will then utilize an unsupervised statistical/machine learning algorithm and its accompanying Elbow Plot to create groups/clusters within our data set that are closely related. We can then examine each of these clusters individually to see if any trends change.

Finally we will report our findings on both our SVI and tax credit programs on a specialized choropleth map known as a bivariate map.

Tax Credit Programs

New Markets Tax Credit Program

History: Created in 2000, authorized by Congress under the Community Renewal and Tax Relief Act of 2000, most recently, the Taxpayer Certainty and Disaster Tax Relief Act of 2020 provided $5 billion in NMTC Allocation authority for calendar years through 2025 (CDFI Fund, 2022). There were bills introduced in 2023 to make the NMTC program permanent (Novogradac, 2023).

Recipients: NMTCs are awarded to Community Development Entities, not to individuals or businesses. (CDFI Fund, 2022)

Purpose: make Qualified Low-Income Community Investments (QLICIs), such as business loans, in Low-Income Communities (CDFI Fund, 2022)

The NMTC program provides tax credit dollars to Community Development Entities with the intention of improving low income communities by encouraging developers to build new projects within the community that can create new jobs and provide additional services.

Tip

Eligibility criteria for the NMTC program is quite extensive:

Sites located in non-metropolitan (i.e., rural) census tracts must meet the following criteria:

  • Median family income: < 80%
  • Poverty rate: > 20%

Sites located in metropolitan areas must meet one of the primary criteria listed below or two of the secondary criteria listed below:

Primary criteria for sites located in metropolitan areas include:

  • Median family income: < 60%
  • Poverty rate: > 30%
  • Unemployment rate: > 1.50x the National Average

Secondary criteria for sites located in metropolitan areas include:

  • Poverty rate greater than 25%; median family income not exceeding 70%; or unemployment rates at least 1.25 times the national average
  • Federally designated Empowerment Zone, Enterprise Community or Renewal Community
  • SBA designated HUB Zone, when NMTC financing will support businesses that obtain HUB Zone certification by the SBA
  • Federal Brownfield sites as defined under 42 U.S.C. 9601 (39)
  • Area encompassed by a HOPE VI redevelopment plan
  • Native American or Alaskan Native areas, Hawaiian Homelands, or redevelopment areas by the appropriate Tribal or other authority
  • Areas designated as distressed by the Appalachian Regional Commission of Delta Regional Authority
  • Colonias areas as designated by the U.S. Department of Housing and Urban Development
  • Federal Opportunity Zones
  • Federally designated medically underserved area, when NMTC financing activities will result in the support of health-related services
  • State Enterprise Zone, or other similar state/local programs targeted toward economically distressed communities
  • Counties for which the Federal Emergency Management Agency has issued a “major disaster declaration” and made a determination that such county is eligible for both “individual and public assistance” provided that initial investment be made within 24 months of the disaster declaration
  • Businesses certified by the Department of Commerce as eligible for assistance under the Trade Adjustment Assistance for Firms program
  • Businesses located in food deserts under the Healthy Food Financing Initiative definition (USDA-ERS) to the extent NMTC financing will increase access to healthy food

Sites located in non-metropolitan (i.e., rural) census tracts must meet the following criteria:

  • Median family income: < 80%
  • Poverty rate: > 20%

Sites located in metropolitan areas must meet one of the primary criteria listed below or two of the secondary criteria listed below:

Primary criteria for sites located in metropolitan areas include:

  • Median family income: < 60%
  • Poverty rate: > 30%
  • Unemployment rate: > 1.50x the National Average

Secondary criteria for sites located in metropolitan areas include:

  • Poverty rate greater than 25%; median family income not exceeding 70%; or unemployment rates at least 1.25 times the national average
  • Federally designated Empowerment Zone, Enterprise Community or Renewal Community
  • SBA designated HUB Zone, when NMTC financing will support businesses that obtain HUB Zone certification by the SBA
  • Federal Brownfield sites as defined under 42 U.S.C. 9601 (39)
  • Area encompassed by a HOPE VI redevelopment plan
  • Native American or Alaskan Native areas, Hawaiian Homelands, or redevelopment areas by the appropriate Tribal or other authority
  • Areas designated as distressed by the Appalachian Regional Commission of Delta Regional Authority
  • Colonias areas as designated by the U.S. Department of Housing and Urban Development
  • Federal Opportunity Zones
  • Federally designated medically underserved area, when NMTC financing activities will result in the support of health-related services
  • State Enterprise Zone, or other similar state/local programs targeted toward economically distressed communities
  • Counties for which the Federal Emergency Management Agency has issued a “major disaster declaration” and made a determination that such county is eligible for both “individual and public assistance” provided that initial investment be made within 24 months of the disaster declaration
  • Businesses certified by the Department of Commerce as eligible for assistance under the Trade Adjustment Assistance for Firms program
  • Businesses located in food deserts under the Healthy Food Financing Initiative definition (USDA-ERS) to the extent NMTC financing will increase access to healthy food

Watch the following video for a comprehensive overview:



Low Income Housing Tax Credit Program

History: Created in 1986, authorized by Congress under the Tax Reform Act of 1986, most recent legislation to impact the LIHTC program was the Inflation Reduction Act of 2022 which increased credits/bonuses (Urban Institute, 2018; Congressional Research Service, 2023)

Recipients: Private investors (Urban Institute, 2018)

Purpose: It is “an incentive to make equity investments in affordable rental housing. The equity raised is used to construct new properties, acquire and renovate existing buildings, and refinance and renovate existing affordable rental housing properties that have previously been financed through other federal housing programs” (Urban Institute, 2018)

The LIHTC program provides tax credit dollars to private investors with the intention of increasing affordable rental housing facilities within communities.

Tip

For the LIHTC program census tracts must be deemed eligible based on one of the following criteria:

  • 50 percent of households with incomes below 60 percent of the Area Median Gross Income (AMGI)
  • Poverty rate of 25 percent or more
  • Qualify as a Difficult Development Areas (DDA) with high land, construction, and utility costs relative to the area median income


Analysis Methodologies

Correlation

You will recall from your previous statistical and analytics courses that “correlation” refers to the statistical relationship between two variables. A positive relationship refers to two variables that trend in the same direction (example: the increasing height and weight of a puppy as he grows). While a negative relationship refers to two variables that trend in opposite directions (example: the more people who need to share a cake, the smaller the pieces will be).

Watch the video below for a more in-depth review:



K-Means Clustering

Landman et al. of Brilliant.org define K-Means Clustering in the following way:

K-means clustering is a traditional, simple machine learning algorithm that is trained on a test data set and then able to classify a new data set using a prime, k number of clusters defined a priori.

Statistician Jim Frost further explains:

The K means clustering algorithm divides a set of n observations into k clusters. … In general, clustering is a method of assigning comparable data points to groups using data patterns. Clustering algorithms find similar data points and allocate them to the same set. K means clustering is one such algorithm.

Review the following video to see this machine learning technique in action:



Bivariate Mapping

As explained on the Water Programming Blog of the Reed Research Group on Decision Analytics for Complex Systems at Cornell University:

Choropleth maps are a ubiquitous tool in geospatial analysis where color is used to visualize the spatial variability of data (e.g., coloring counties based on temperature, GDP, or election results). Bivariate choropleth maps are a less common variant that use 2-dimensional color palettes to show two different types of data at once. This can be a powerful tool for visualizing spatial correlations and clustering patterns between two related variables.

Thus we can build upon the univariate choropleth maps we explored last week to examine our correlations on a bivariate map using the R package biscale by Chris Prener

If you would like to learn more about this mapping technique ahead of creating our own maps in the lab this week, check out the following video:



Additional Readings

If you would like to explore the topics introduced above further, feel free to review the following readings and then begin this week’s lab:

Readings on NMTC and LIHTC Programs:

Readings on Correlation and Outliers:

Readings on K-Means Clustering:

Readings on Bivariate Mapping and the biscale and cowplot Packages:

Library

To begin, we will need to install a few new packages and load some packages that we’ve previously installed:

Code
utils::install.packages("cluster")
utils::install.packages("factoextra")
utils::install.packages("gridExtra")
utils::install.packages("biscale")
utils::install.packages("cowplot")
Code
# Turn off scientific notation
options(scipen=999)

# Load packages
library(here)        # relative file paths for reproducibility
library(tidyverse)   # data wrangling
library(stringi)     # string data wrangling
library(tigris)      # US census TIGER/Line shapefiles
library(ggplot2)     # data visualization
library(cowplot)     # data visualization plotting
library(gridExtra)   # grid for data visualizations
library(biscale)     # bivariate mapping
library(kableExtra)  # table formatting
library(scales)      # palette and number formatting
library(cluster)     # clustering algorithms
library(factoextra)  # clustering algorithms & visualization

Functions and Constant Variables

Next we need to import our functions and constants from our project_data_steps.R file. Remember, your file should have your initials at the end to avoid confusion with your teammates. For example, in a shared repo my file name would be project_data_steps_CS.R

Recall that we should use the here::here() function for relative file paths. We also can use double colons :: to indicate both the specific library and function name we want to use to avoid any overriding.

Import Functions

Code
import::here( "fips_census_regions",
              "load_svi_data",
              "merge_svi_data",
              "census_division",
              "flag_summarize",
             # notice the use of here::here() that points to the .R file
             # where all these R objects are created
             .from = here::here("analysis/project_data_steps.R"),
             .character_only = TRUE)

census_division

Data

Next, recall that we can load up our data sets and process them with our functions to create data sets on a national and divisional level for 2010 and 2020.

Note

Note that we will want to flag our SVI indicators at or above the 75th percentile. For the divisional data we will also want to utilize the rank_by and location parameters to limit to our division of interest.

Code
# Load SVI data sets
svi_2010 <- readRDS(here::here("data/raw/Census_Data_SVI/svi_2010_trt10.rds"))
svi_2020 <- readRDS(here::here("data/raw/Census_Data_SVI/svi_2020_trt10.rds"))

# Load mapping data sets
svi_county_map2010 <- readRDS(here::here(paste0("data/wrangling/", str_replace_all(census_division, " ", "_"), "_county_svi_flags10.rds")))

svi_county_map2020 <- readRDS(here::here(paste0("data/wrangling/", str_replace_all(census_division, " ", "_"), "_county_svi_flags20.rds")))

divisional_st_sf <- readRDS(here::here(paste0("data/wrangling/", str_replace_all(census_division, " ", "_"), "_st_sf.rds")))
Code
# Load NMTC & LIHTC Tract Eligibility Data

orig_nmtc <- readxl::read_excel(here::here("data/raw/NMTC_LIHTC_tracts/nmtc_2011-2015_lic_110217.xlsx"), sheet="NMTC LICs 2011-2015 ACS")

high_migration_nmtc <- readxl::read_excel(here::here("data/raw/NMTC_LIHTC_tracts/nmtc_2011-2015_lic_110217.xlsx"), sheet="High migration tracts", skip=1)

nmtc_awards_data <- readxl::read_excel(here::here("data/raw/NMTC_LIHTC_tracts/NMTC_Public_Data_Release_includes_FY_2021_Data_final.xlsx"), sheet = "Projects 2 - Data Set PUBLISH.P")

lihtc_eligible <- readxl::read_excel(here::here("data/raw/NMTC_LIHTC_tracts/qct_data_2010_2011_2012.xlsx"))

lihtc_projects <- read.csv(here::here("data/raw/NMTC_LIHTC_tracts/lihtcpub/LIHTCPUB.csv"))

Load 2010 SVI Data

Code
# National 2010 Data
svi_2010_national <- load_svi_data(svi_2010, percentile=.75)
svi_2010_national %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1 RPL_THEME1 F_THEME1 SPL_THEME2 RPL_THEME2 F_THEME2 SPL_THEME3 RPL_THEME3 F_THEME3 SPL_THEME4 RPL_THEME4 F_THEME4 SPL_THEMES RPL_THEMES F_TOTAL
01001020100 01 001 020100 AL Alabama Autauga County 3 South Region 6 East South Central Division 1809 771 696 297 1809 16.41791 0.3871 0 36 889 4.049494 0.1790 0 127 598 21.23746 0.20770 0 47 98 47.95918 0.5767 0 174 696 25.00000 0.18790 0 196 1242 15.780998 0.6093 0 186 1759 10.574190 0.3790 0 222 12.271973 0.4876 0 445 24.59923 0.5473 0 298 1335 22.32210 0.8454 1 27 545 4.954128 0.09275 0 36 1705 2.1114370 0.59040 0 385 1809 21.282477 0.4524 0 771 0 0.0000000 0.1224 0 92 11.9325551 0.8005 1 0 696 0.0000000 0.1238 0 50 696 7.183908 0.6134 0 0 1809 0 0.364 0 1.74230 0.28200 0 2.56345 0.5296 1 0.4524 0.4482 0 2.0241 0.2519 1 6.78225 0.3278 2
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.5754 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.3019 0 154 730 21.09589 0.09312 0 339 1265 26.798419 0.8392 1 313 2012 15.556660 0.6000 0 204 10.099010 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.83510 1 15 1890 0.7936508 0.40130 0 1243 2020 61.534653 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.7808219 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0 0.364 0 2.70312 0.56650 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6
01001020300 01 001 020300 AL Alabama Autauga County 3 South Region 6 East South Central Division 3543 1403 1287 656 3533 18.56779 0.4443 0 93 1552 5.992268 0.3724 0 273 957 28.52665 0.45780 0 178 330 53.93939 0.7152 0 451 1287 35.04274 0.49930 0 346 2260 15.309734 0.5950 0 252 3102 8.123791 0.2596 0 487 13.745413 0.5868 0 998 28.16822 0.7606 1 371 2224 16.68165 0.6266 0 126 913 13.800657 0.46350 0 0 3365 0.0000000 0.09298 0 637 3543 17.979114 0.4049 0 1403 10 0.7127584 0.3015 0 2 0.1425517 0.4407 0 0 1287 0.0000000 0.1238 0 101 1287 7.847708 0.6443 0 0 3543 0 0.364 0 2.17060 0.41010 0 2.53048 0.5116 1 0.4049 0.4011 0 1.8743 0.1942 0 6.98028 0.3576 1
01001020400 01 001 020400 AL Alabama Autauga County 3 South Region 6 East South Central Division 4840 1957 1839 501 4840 10.35124 0.2177 0 101 2129 4.744011 0.2447 0 310 1549 20.01291 0.17080 0 89 290 30.68966 0.2044 0 399 1839 21.69657 0.10540 0 274 3280 8.353658 0.3205 0 399 4293 9.294200 0.3171 0 955 19.731405 0.8643 1 1195 24.69008 0.5530 0 625 3328 18.78005 0.7233 0 152 1374 11.062591 0.34710 0 10 4537 0.2204100 0.22560 0 297 4840 6.136364 0.1647 0 1957 33 1.6862545 0.3843 0 25 1.2774655 0.5516 0 14 1839 0.7612833 0.3564 0 19 1839 1.033170 0.1127 0 0 4840 0 0.364 0 1.20540 0.13470 0 2.71330 0.6129 1 0.1647 0.1632 0 1.7690 0.1591 0 5.85240 0.1954 1
01001020500 01 001 020500 AL Alabama Autauga County 3 South Region 6 East South Central Division 9938 3969 3741 1096 9938 11.02838 0.2364 0 188 4937 3.807981 0.1577 0 426 2406 17.70574 0.11050 0 528 1335 39.55056 0.3753 0 954 3741 25.50120 0.20140 0 293 5983 4.897209 0.1655 0 740 10110 7.319486 0.2211 0 837 8.422218 0.2408 0 3012 30.30791 0.8455 1 759 7155 10.60797 0.2668 0 476 2529 18.821669 0.63540 0 78 9297 0.8389803 0.41110 0 1970 9938 19.822902 0.4330 0 3969 306 7.7097506 0.6153 0 0 0.0000000 0.2198 0 7 3741 0.1871157 0.2535 0 223 3741 5.960973 0.5483 0 0 9938 0 0.364 0 0.98210 0.08468 0 2.39960 0.4381 1 0.4330 0.4290 0 2.0009 0.2430 0 5.81560 0.1905 1
01001020600 01 001 020600 AL Alabama Autauga County 3 South Region 6 East South Central Division 3402 1456 1308 735 3402 21.60494 0.5199 0 134 1720 7.790698 0.5436 0 242 1032 23.44961 0.28010 0 62 276 22.46377 0.1035 0 304 1308 23.24159 0.14070 0 301 2151 13.993491 0.5510 0 355 3445 10.304790 0.3656 0 386 11.346267 0.4232 0 931 27.36626 0.7200 0 440 2439 18.04018 0.6912 0 143 924 15.476190 0.52900 0 4 3254 0.1229256 0.19840 0 723 3402 21.252205 0.4519 0 1456 18 1.2362637 0.3507 0 433 29.7390110 0.9468 1 16 1308 1.2232416 0.4493 0 28 1308 2.140673 0.2298 0 0 3402 0 0.364 0 2.12080 0.39510 0 2.56180 0.5288 0 0.4519 0.4477 0 2.3406 0.4048 1 7.47510 0.4314 1
Code
# Divisional 2010 Data
svi_2010_divisional <- load_svi_data(svi_2010, rank_by = "divisional", location = census_division, percentile=.75)
svi_2010_divisional %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1 RPL_THEME1 F_THEME1 SPL_THEME2 RPL_THEME2 F_THEME2 SPL_THEME3 RPL_THEME3 F_THEME3 SPL_THEME4 RPL_THEME4 F_THEME4 SPL_THEMES RPL_THEMES F_TOTAL
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0.000000 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9

Load 2020 SVI Data

Code
# National 2020 Data
svi_2020_national <- load_svi_data(svi_2020, percentile=.75)
svi_2020_national %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1 RPL_THEME1 F_THEME1 SPL_THEME2 RPL_THEME2 F_THEME2 SPL_THEME3 RPL_THEME3 F_THEME3 SPL_THEME4 RPL_THEME4 F_THEME4 SPL_THEMES RPL_THEMES F_TOTAL
01001020100 01 001 020100 AL Alabama Autauga County 3 South Region 6 East South Central Division 1941 710 693 352 1941 18.13498 0.4630 0 18 852 2.112676 0.15070 0 81 507 15.976331 0.26320 0 63 186 33.87097 0.2913 0 144 693 20.77922 0.2230 0 187 1309 14.285714 0.6928 0 187 1941 9.634209 0.6617 0 295 15.19835 0.4601 0 415 21.38073 0.4681 0 391 1526 25.62254 0.9011 1 58 555 10.45045 0.3451 0 0 1843 0.0000000 0.09479 0 437 1941 22.51417 0.3902 0 710 0 0.0000000 0.1079 0 88 12.3943662 0.8263 1 0 693 0.0000000 0.09796 0 10 693 1.443001 0.1643 0 0 1941 0.000000 0.1831 0 2.19120 0.4084 0 2.26919 0.3503 1 0.3902 0.3869 0 1.37956 0.07216 1 6.23015 0.2314 2
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.41320 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.4041 0 139 1313 10.586443 0.5601 0 91 1533 5.936073 0.4343 0 284 16.16392 0.5169 0 325 18.49744 0.2851 0 164 1208 13.57616 0.4127 0 42 359 11.69916 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.46880 0 57 573 9.947644 0.7317 0 212 1757 12.066022 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.91300 0.68620 1 7.83579 0.4802 2
01001020300 01 001 020300 AL Alabama Autauga County 3 South Region 6 East South Central Division 3694 1464 1351 842 3694 22.79372 0.5833 0 53 1994 2.657974 0.22050 0 117 967 12.099276 0.11370 0 147 384 38.28125 0.3856 0 264 1351 19.54108 0.1827 0 317 2477 12.797739 0.6460 0 127 3673 3.457664 0.2308 0 464 12.56091 0.3088 0 929 25.14889 0.7080 0 473 2744 17.23761 0.6211 0 263 975 26.97436 0.8234 1 128 3586 3.5694367 0.70770 0 1331 3694 36.03140 0.5515 0 1464 26 1.7759563 0.3675 0 14 0.9562842 0.5389 0 35 1351 2.5906736 0.60550 0 42 1351 3.108808 0.3415 0 0 3694 0.000000 0.1831 0 1.86330 0.3063 0 3.16900 0.8380 1 0.5515 0.5468 0 2.03650 0.26830 0 7.62030 0.4460 1
01001020400 01 001 020400 AL Alabama Autauga County 3 South Region 6 East South Central Division 3539 1741 1636 503 3539 14.21305 0.3472 0 39 1658 2.352232 0.17990 0 219 1290 16.976744 0.30880 0 74 346 21.38728 0.1037 0 293 1636 17.90954 0.1333 0 173 2775 6.234234 0.3351 0 169 3529 4.788892 0.3448 0 969 27.38062 0.9225 1 510 14.41085 0.1208 0 670 3019 22.19278 0.8194 1 148 1137 13.01671 0.4541 0 89 3409 2.6107363 0.64690 0 454 3539 12.82848 0.2364 0 1741 143 8.2136703 0.6028 0 0 0.0000000 0.2186 0 10 1636 0.6112469 0.28340 0 72 1636 4.400978 0.4538 0 0 3539 0.000000 0.1831 0 1.34030 0.1575 0 2.96370 0.7496 2 0.2364 0.2344 0 1.74170 0.16270 0 6.28210 0.2389 2
01001020500 01 001 020500 AL Alabama Autauga County 3 South Region 6 East South Central Division 10674 4504 4424 1626 10509 15.47245 0.3851 0 81 5048 1.604596 0.09431 0 321 2299 13.962592 0.17970 0 711 2125 33.45882 0.2836 0 1032 4424 23.32731 0.3109 0 531 6816 7.790493 0.4251 0 301 10046 2.996217 0.1894 0 1613 15.11149 0.4553 0 2765 25.90407 0.7494 0 1124 7281 15.43744 0.5253 0 342 2912 11.74451 0.4019 0 52 9920 0.5241935 0.35230 0 2603 10674 24.38636 0.4160 0 4504 703 15.6083481 0.7378 0 29 0.6438721 0.5037 0 37 4424 0.8363472 0.33420 0 207 4424 4.679023 0.4754 0 176 10674 1.648866 0.7598 1 1.40481 0.1743 0 2.48420 0.4802 0 0.4160 0.4125 0 2.81090 0.63730 1 7.11591 0.3654 1
01001020600 01 001 020600 AL Alabama Autauga County 3 South Region 6 East South Central Division 3536 1464 1330 1279 3523 36.30429 0.8215 1 34 1223 2.780049 0.23780 0 321 1111 28.892889 0.75870 1 67 219 30.59361 0.2305 0 388 1330 29.17293 0.5075 0 306 2380 12.857143 0.6480 0 415 3496 11.870709 0.7535 1 547 15.46946 0.4760 0 982 27.77149 0.8327 1 729 2514 28.99761 0.9488 1 95 880 10.79545 0.3601 0 0 3394 0.0000000 0.09479 0 985 3536 27.85633 0.4608 0 1464 0 0.0000000 0.1079 0 364 24.8633880 0.9300 1 0 1330 0.0000000 0.09796 0 17 1330 1.278196 0.1463 0 0 3536 0.000000 0.1831 0 2.96830 0.6434 2 2.71239 0.6156 2 0.4608 0.4569 0 1.46526 0.08976 1 7.60675 0.4440 5
Code
# Divisional 2020 Data
svi_2020_divisional <- load_svi_data(svi_2020, rank_by = "divisional", location =  census_division, percentile=.75)
svi_2020_divisional %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1 RPL_THEME1 F_THEME1 SPL_THEME2 RPL_THEME2 F_THEME2 SPL_THEME3 RPL_THEME3 F_THEME3 SPL_THEME4 RPL_THEME4 F_THEME4 SPL_THEMES RPL_THEMES F_TOTAL
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.977974 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.291860 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.7464 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.0000000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9

Check Data

Next, we want to check that our functions are behaving as expected and have filtered our data sets to include all divisions and states on the national level and only our division/states of interest on the divisional level:

2010

Code
svi_2010_national$division %>% unique() 
[1] "East South Central Division" "Pacific Division"           
[3] "Mountain Division"           "West South Central Division"
[5] "New England Division"        "South Atlantic Division"    
[7] "East North Central Division" "West North Central Division"
[9] "Middle Atlantic Division"   
Code
svi_2010_national$state %>% unique() 
 [1] "AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DE" "DC" "FL" "GA" "HI" "ID" "IL" "IN"
[16] "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH"
[31] "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT"
[46] "VT" "VA" "WA" "WV" "WI" "WY"
Code
svi_2010_divisional$division %>% unique() 
[1] "Middle Atlantic Division"
Code
svi_2010_divisional$state %>% unique() 
[1] "NJ" "NY" "PA"

2020

Code
svi_2020_national$division %>% unique()
[1] "East South Central Division" "Pacific Division"           
[3] "Mountain Division"           "West South Central Division"
[5] "New England Division"        "South Atlantic Division"    
[7] "East North Central Division" "West North Central Division"
[9] "Middle Atlantic Division"   
Code
svi_2020_national$state %>% unique()
 [1] "AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DE" "DC" "FL" "GA" "HI" "ID" "IL" "IN"
[16] "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH"
[31] "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT"
[46] "VT" "VA" "WA" "WV" "WI" "WY"
Code
svi_2020_divisional$division %>% unique()
[1] "Middle Atlantic Division"
Code
svi_2020_divisional$state %>% unique()
[1] "NJ" "NY" "PA"

Merge 2010 and 2020 data

Code
# Find tracts with divisional data in both 2010 and 2020
svi_divisional <- merge_svi_data(svi_2010_divisional, svi_2020_divisional)
svi_divisional %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.977974 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.291860 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0.000000 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.7464 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.0000000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9
Code
# Find tracts with divisional data in both 2010 and 2020
svi_national <- merge_svi_data(svi_2010_national, svi_2020_national)
svi_national %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20
01001020100 01 001 020100 AL Alabama Autauga County 3 South Region 6 East South Central Division 1809 771 696 297 1809 16.41791 0.3871 0 36 889 4.049494 0.1790 0 127 598 21.23746 0.20770 0 47 98 47.95918 0.5767 0 174 696 25.00000 0.18790 0 196 1242 15.780998 0.6093 0 186 1759 10.574190 0.3790 0 222 12.271973 0.4876 0 445 24.59923 0.5473 0 298 1335 22.32210 0.8454 1 27 545 4.954128 0.09275 0 36 1705 2.1114370 0.59040 0 385 1809 21.282477 0.4524 0 771 0 0.0000000 0.1224 0 92 11.9325551 0.8005 1 0 696 0.0000000 0.1238 0 50 696 7.183908 0.6134 0 0 1809 0 0.364 0 1.74230 0.28200 0 2.56345 0.5296 1 0.4524 0.4482 0 2.0241 0.2519 1 6.78225 0.3278 2 1941 710 693 352 1941 18.13498 0.4630 0 18 852 2.112676 0.15070 0 81 507 15.976331 0.26320 0 63 186 33.87097 0.2913 0 144 693 20.77922 0.2230 0 187 1309 14.285714 0.6928 0 187 1941 9.634209 0.6617 0 295 15.19835 0.4601 0 415 21.38073 0.4681 0 391 1526 25.62254 0.9011 1 58 555 10.45045 0.3451 0 0 1843 0.0000000 0.09479 0 437 1941 22.51417 0.3902 0 710 0 0.0000000 0.1079 0 88 12.3943662 0.8263 1 0 693 0.0000000 0.09796 0 10 693 1.443001 0.1643 0 0 1941 0.000000 0.1831 0 2.19120 0.4084 0 2.26919 0.3503 1 0.3902 0.3869 0 1.37956 0.07216 1 6.23015 0.2314 2
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.5754 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.3019 0 154 730 21.09589 0.09312 0 339 1265 26.798419 0.8392 1 313 2012 15.556660 0.6000 0 204 10.099010 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.83510 1 15 1890 0.7936508 0.40130 0 1243 2020 61.534653 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.7808219 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0 0.364 0 2.70312 0.56650 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.41320 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.4041 0 139 1313 10.586443 0.5601 0 91 1533 5.936073 0.4343 0 284 16.16392 0.5169 0 325 18.49744 0.2851 0 164 1208 13.57616 0.4127 0 42 359 11.69916 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.46880 0 57 573 9.947644 0.7317 0 212 1757 12.066022 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.91300 0.68620 1 7.83579 0.4802 2
01001020300 01 001 020300 AL Alabama Autauga County 3 South Region 6 East South Central Division 3543 1403 1287 656 3533 18.56779 0.4443 0 93 1552 5.992268 0.3724 0 273 957 28.52665 0.45780 0 178 330 53.93939 0.7152 0 451 1287 35.04274 0.49930 0 346 2260 15.309734 0.5950 0 252 3102 8.123791 0.2596 0 487 13.745413 0.5868 0 998 28.16822 0.7606 1 371 2224 16.68165 0.6266 0 126 913 13.800657 0.46350 0 0 3365 0.0000000 0.09298 0 637 3543 17.979114 0.4049 0 1403 10 0.7127584 0.3015 0 2 0.1425517 0.4407 0 0 1287 0.0000000 0.1238 0 101 1287 7.847708 0.6443 0 0 3543 0 0.364 0 2.17060 0.41010 0 2.53048 0.5116 1 0.4049 0.4011 0 1.8743 0.1942 0 6.98028 0.3576 1 3694 1464 1351 842 3694 22.79372 0.5833 0 53 1994 2.657974 0.22050 0 117 967 12.099276 0.11370 0 147 384 38.28125 0.3856 0 264 1351 19.54108 0.1827 0 317 2477 12.797739 0.6460 0 127 3673 3.457664 0.2308 0 464 12.56091 0.3088 0 929 25.14889 0.7080 0 473 2744 17.23761 0.6211 0 263 975 26.97436 0.8234 1 128 3586 3.5694367 0.70770 0 1331 3694 36.03140 0.5515 0 1464 26 1.7759563 0.3675 0 14 0.9562842 0.5389 0 35 1351 2.5906736 0.60550 0 42 1351 3.108808 0.3415 0 0 3694 0.000000 0.1831 0 1.86330 0.3063 0 3.16900 0.8380 1 0.5515 0.5468 0 2.03650 0.26830 0 7.62030 0.4460 1
01001020400 01 001 020400 AL Alabama Autauga County 3 South Region 6 East South Central Division 4840 1957 1839 501 4840 10.35124 0.2177 0 101 2129 4.744011 0.2447 0 310 1549 20.01291 0.17080 0 89 290 30.68966 0.2044 0 399 1839 21.69657 0.10540 0 274 3280 8.353658 0.3205 0 399 4293 9.294200 0.3171 0 955 19.731405 0.8643 1 1195 24.69008 0.5530 0 625 3328 18.78005 0.7233 0 152 1374 11.062591 0.34710 0 10 4537 0.2204100 0.22560 0 297 4840 6.136364 0.1647 0 1957 33 1.6862545 0.3843 0 25 1.2774655 0.5516 0 14 1839 0.7612833 0.3564 0 19 1839 1.033170 0.1127 0 0 4840 0 0.364 0 1.20540 0.13470 0 2.71330 0.6129 1 0.1647 0.1632 0 1.7690 0.1591 0 5.85240 0.1954 1 3539 1741 1636 503 3539 14.21305 0.3472 0 39 1658 2.352232 0.17990 0 219 1290 16.976744 0.30880 0 74 346 21.38728 0.1037 0 293 1636 17.90954 0.1333 0 173 2775 6.234234 0.3351 0 169 3529 4.788892 0.3448 0 969 27.38062 0.9225 1 510 14.41085 0.1208 0 670 3019 22.19278 0.8194 1 148 1137 13.01671 0.4541 0 89 3409 2.6107363 0.64690 0 454 3539 12.82848 0.2364 0 1741 143 8.2136703 0.6028 0 0 0.0000000 0.2186 0 10 1636 0.6112469 0.28340 0 72 1636 4.400978 0.4538 0 0 3539 0.000000 0.1831 0 1.34030 0.1575 0 2.96370 0.7496 2 0.2364 0.2344 0 1.74170 0.16270 0 6.28210 0.2389 2
01001020500 01 001 020500 AL Alabama Autauga County 3 South Region 6 East South Central Division 9938 3969 3741 1096 9938 11.02838 0.2364 0 188 4937 3.807981 0.1577 0 426 2406 17.70574 0.11050 0 528 1335 39.55056 0.3753 0 954 3741 25.50120 0.20140 0 293 5983 4.897209 0.1655 0 740 10110 7.319486 0.2211 0 837 8.422218 0.2408 0 3012 30.30791 0.8455 1 759 7155 10.60797 0.2668 0 476 2529 18.821669 0.63540 0 78 9297 0.8389803 0.41110 0 1970 9938 19.822902 0.4330 0 3969 306 7.7097506 0.6153 0 0 0.0000000 0.2198 0 7 3741 0.1871157 0.2535 0 223 3741 5.960973 0.5483 0 0 9938 0 0.364 0 0.98210 0.08468 0 2.39960 0.4381 1 0.4330 0.4290 0 2.0009 0.2430 0 5.81560 0.1905 1 10674 4504 4424 1626 10509 15.47245 0.3851 0 81 5048 1.604596 0.09431 0 321 2299 13.962592 0.17970 0 711 2125 33.45882 0.2836 0 1032 4424 23.32731 0.3109 0 531 6816 7.790493 0.4251 0 301 10046 2.996217 0.1894 0 1613 15.11149 0.4553 0 2765 25.90407 0.7494 0 1124 7281 15.43744 0.5253 0 342 2912 11.74451 0.4019 0 52 9920 0.5241935 0.35230 0 2603 10674 24.38636 0.4160 0 4504 703 15.6083481 0.7378 0 29 0.6438721 0.5037 0 37 4424 0.8363472 0.33420 0 207 4424 4.679023 0.4754 0 176 10674 1.648866 0.7598 1 1.40481 0.1743 0 2.48420 0.4802 0 0.4160 0.4125 0 2.81090 0.63730 1 7.11591 0.3654 1
01001020600 01 001 020600 AL Alabama Autauga County 3 South Region 6 East South Central Division 3402 1456 1308 735 3402 21.60494 0.5199 0 134 1720 7.790698 0.5436 0 242 1032 23.44961 0.28010 0 62 276 22.46377 0.1035 0 304 1308 23.24159 0.14070 0 301 2151 13.993491 0.5510 0 355 3445 10.304790 0.3656 0 386 11.346267 0.4232 0 931 27.36626 0.7200 0 440 2439 18.04018 0.6912 0 143 924 15.476190 0.52900 0 4 3254 0.1229256 0.19840 0 723 3402 21.252205 0.4519 0 1456 18 1.2362637 0.3507 0 433 29.7390110 0.9468 1 16 1308 1.2232416 0.4493 0 28 1308 2.140673 0.2298 0 0 3402 0 0.364 0 2.12080 0.39510 0 2.56180 0.5288 0 0.4519 0.4477 0 2.3406 0.4048 1 7.47510 0.4314 1 3536 1464 1330 1279 3523 36.30429 0.8215 1 34 1223 2.780049 0.23780 0 321 1111 28.892889 0.75870 1 67 219 30.59361 0.2305 0 388 1330 29.17293 0.5075 0 306 2380 12.857143 0.6480 0 415 3496 11.870709 0.7535 1 547 15.46946 0.4760 0 982 27.77149 0.8327 1 729 2514 28.99761 0.9488 1 95 880 10.79545 0.3601 0 0 3394 0.0000000 0.09479 0 985 3536 27.85633 0.4608 0 1464 0 0.0000000 0.1079 0 364 24.8633880 0.9300 1 0 1330 0.0000000 0.09796 0 17 1330 1.278196 0.1463 0 0 3536 0.000000 0.1831 0 2.96830 0.6434 2 2.71239 0.6156 2 0.4608 0.4569 0 1.46526 0.08976 1 7.60675 0.4440 5

NMTC Data Wrangling

Now let’s process our NMTC data. We will begin by exploring the details of our data sets:

Code
colnames(orig_nmtc)
 [1] "2010 Census Tract Number FIPS code. GEOID"                                                   
 [2] "OMB Metro/Non-metro Designation, July 2015 (OMB 15-01)"                                      
 [3] "Does Census Tract Qualify For NMTC Low-Income Community (LIC) on Poverty or Income Criteria?"
 [4] "Census Tract Poverty Rate % (2011-2015 ACS)"                                                 
 [5] "Does Census Tract Qualify on Poverty Criteria>=20%?"                                         
 [6] "Census Tract Percent of Benchmarked Median Family Income (%) 2011-2015 ACS"                  
 [7] "Does Census Tract Qualify on Median Family Income Criteria<=80%?"                            
 [8] "Census Tract Unemployment Rate (%) 2011-2015"                                                
 [9] "County Code"                                                                                 
[10] "State Abbreviation"                                                                          
[11] "State Name"                                                                                  
[12] "County Name"                                                                                 
[13] "Census Tract Unemployment to National Unemployment Ratio"                                    
[14] "Is Tract Unemployment to National Unemployment Ratio >1.5?"                                  
[15] "Population for whom poverty status is determined 2011-2015 ACS"                              

Let’s rename a few columns to make them easier for processing:

Code
orig_nmtc_df <- orig_nmtc %>% 
  rename("GEOID10" = "2010 Census Tract Number FIPS code. GEOID",
         "nmtc_eligibility_orig" = "Does Census Tract Qualify For NMTC Low-Income Community (LIC) on Poverty or Income Criteria?")

orig_nmtc_df %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID10 OMB Metro/Non-metro Designation, July 2015 (OMB 15-01) nmtc_eligibility_orig Census Tract Poverty Rate % (2011-2015 ACS) Does Census Tract Qualify on Poverty Criteria>=20%? Census Tract Percent of Benchmarked Median Family Income (%) 2011-2015 ACS Does Census Tract Qualify on Median Family Income Criteria<=80%? Census Tract Unemployment Rate (%) 2011-2015 County Code State Abbreviation State Name County Name Census Tract Unemployment to National Unemployment Ratio Is Tract Unemployment to National Unemployment Ratio >1.5? Population for whom poverty status is determined 2011-2015 ACS
01001020100 Metropolitan No 8.1 No 122.930646878856 No 5.4 01001 AL Alabama Autauga 0.6506024096385542 No 1948
01001020200 Metropolitan Yes 25.5 Yes 82.402258244451573 No 13.3 01001 AL Alabama Autauga 1.6024096385542168 Yes 1983
01001020300 Metropolitan No 12.7 No 94.261422220719723 No 6.2 01001 AL Alabama Autauga 0.74698795180722888 No 2968
01001020400 Metropolitan No 2.1 No 116.82358310373388 No 10.8 01001 AL Alabama Autauga 1.3012048192771084 No 4423
01001020500 Metropolitan No 11.4 No 127.74293876033198 No 4.2 01001 AL Alabama Autauga 0.50602409638554213 No 10563
01001020600 Metropolitan No 14.4 No 111.98255607579317 No 10.9 01001 AL Alabama Autauga 1.3132530120481927 No 3851

We also have additional census tracts that have been deemed eligible for the program due to high migration:

Code
colnames(high_migration_nmtc)
[1] "2010 Census Tract Number FIPS code GEOID"                                  
[2] "20-year County population loss 1990-2010 census"                           
[3] "% Median Family Income (MFI) / Area Income 2011-2015 (between 80%-85% MFI)"

We will also rename the GEOID column in this data set:

Code
high_migration_nmtc_df <- high_migration_nmtc %>% rename("GEOID10" = "2010 Census Tract Number FIPS code GEOID")

high_migration_nmtc_df %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID10 20-year County population loss 1990-2010 census % Median Family Income (MFI) / Area Income 2011-2015 (between 80%-85% MFI)
01087231601 -0.1394416 82.06754
05039970300 -0.1558144 84.78236
08017960600 -0.2340426 84.36239
17067953800 -0.1061620 80.36788
17067954200 -0.1061620 84.48551
17067954300 -0.1061620 84.44497

If we look back at our original data set, we can see that it doesn’t have the census tracts in the high migration data set coded as being eligible for the NMTC since eligibility for these tracts were added at a later date. See below as an example:

Code
# See original doesn't have high migration tracts coded as eligible
orig_nmtc_df %>% filter(GEOID10 == "01087231601") %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID10 OMB Metro/Non-metro Designation, July 2015 (OMB 15-01) nmtc_eligibility_orig Census Tract Poverty Rate % (2011-2015 ACS) Does Census Tract Qualify on Poverty Criteria>=20%? Census Tract Percent of Benchmarked Median Family Income (%) 2011-2015 ACS Does Census Tract Qualify on Median Family Income Criteria<=80%? Census Tract Unemployment Rate (%) 2011-2015 County Code State Abbreviation State Name County Name Census Tract Unemployment to National Unemployment Ratio Is Tract Unemployment to National Unemployment Ratio >1.5? Population for whom poverty status is determined 2011-2015 ACS
01087231601 Non-Metropolitan No 16.2 No 82.067544858242542 No 11.3 01087 AL Alabama Macon 1.3614457831325302 No 888

In order to address this, we need to update eligibility in our original data set for the census tracts in the high migration of data set:

Code
# Add column to label tracts as high migration
high_migration_nmtc_df <- high_migration_nmtc_df %>% mutate(high_migration = "Yes")

# Join to original column
orig_nmtc_df <- left_join(orig_nmtc_df, high_migration_nmtc_df, join_by(GEOID10 == GEOID10))

# Update eligibility column with coalesce()
nmtc_df <- orig_nmtc_df %>% 
  mutate(nmtc_eligibility = coalesce(high_migration, nmtc_eligibility_orig))

nmtc_df %>% filter(GEOID10 == "01087231601") %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID10 OMB Metro/Non-metro Designation, July 2015 (OMB 15-01) nmtc_eligibility_orig Census Tract Poverty Rate % (2011-2015 ACS) Does Census Tract Qualify on Poverty Criteria>=20%? Census Tract Percent of Benchmarked Median Family Income (%) 2011-2015 ACS Does Census Tract Qualify on Median Family Income Criteria<=80%? Census Tract Unemployment Rate (%) 2011-2015 County Code State Abbreviation State Name County Name Census Tract Unemployment to National Unemployment Ratio Is Tract Unemployment to National Unemployment Ratio >1.5? Population for whom poverty status is determined 2011-2015 ACS 20-year County population loss 1990-2010 census % Median Family Income (MFI) / Area Income 2011-2015 (between 80%-85% MFI) high_migration nmtc_eligibility
01087231601 Non-Metropolitan No 16.2 No 82.067544858242542 No 11.3 01087 AL Alabama Macon 1.3614457831325302 No 888 -0.1394416 82.06754 Yes Yes

Create a data set only of our NMTC eligible census tracts:

Code
nmtc_eligible <- nmtc_df %>% 
  select(GEOID10, nmtc_eligibility, `County Code`, `County Name`, `State Abbreviation`, `State Name`) %>% 
  filter(tolower(nmtc_eligibility) == "yes")

nmtc_eligible %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID10 nmtc_eligibility County Code County Name State Abbreviation State Name
01001020200 Yes 01001 Autauga AL Alabama
01001020700 Yes 01001 Autauga AL Alabama
01001021100 Yes 01001 Autauga AL Alabama
01003010200 Yes 01003 Baldwin AL Alabama
01003010500 Yes 01003 Baldwin AL Alabama
01003010600 Yes 01003 Baldwin AL Alabama

To merge to our SVI data, we only need the eligibility flag and the GEOID so we will limit our data set to these columns:

Code
# Save just tract ID and eligibility
nmtc_eligible_df <- nmtc_eligible %>% select(GEOID10, nmtc_eligibility)
nmtc_eligible_df %>% head()
# A tibble: 6 × 2
  GEOID10     nmtc_eligibility
  <chr>       <chr>           
1 01001020200 Yes             
2 01001020700 Yes             
3 01001021100 Yes             
4 01003010200 Yes             
5 01003010500 Yes             
6 01003010600 Yes             

Now let’s look at our NMTC award data:

Code
nmtc_awards_data %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
Project ID 2010 Census Tract Metro/Non-Metro, 2010 Census Origination Year Community Development Entity (CDE) Name Project QLICI Amount Estimated Total Project Cost City State Zip Code QALICB Type Multi-CDE Multi-Tract Project
AK0001 2070000100 Non-Metropolitan 2008 Alaska Growth Capital BIDCO, Inc. 300000 300000 Aleknagik Alaska 99555 NRE NO NO
AK0002 2020001000 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 1008750 1345000 Anchorage Alaska 99501 NRE NO NO
AK0003 2020000600 Metropolitan 2006 HEDC New Markets, Inc 5061506 8694457 Anchorage Alaska 99508 NRE NO NO
AK0004 2020001000 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 187500 250000 Anchorage Alaska 99501 NRE NO NO
AK0006 2020001802 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 750000 1180000 Anchorage Alaska 99507 NRE NO NO
AK0007 2020001900 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 127500 150000 Anchorage Alaska 99503 NRE NO NO

Here we can see that our 2010 Census Tract column is missing leading zeroes. We need to fix this to allow for joining with our SVI data. To do this, we can pad our census tract data column to 11 to ensure that the leading zeroes are added back:

Code
nmtc_awards <- nmtc_awards_data %>% 
  mutate(`2010 Census Tract` = str_pad(`2010 Census Tract`, 11, "left", pad=0)) %>%
  rename("GEOID10" =`2010 Census Tract`)

nmtc_awards %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
Project ID GEOID10 Metro/Non-Metro, 2010 Census Origination Year Community Development Entity (CDE) Name Project QLICI Amount Estimated Total Project Cost City State Zip Code QALICB Type Multi-CDE Multi-Tract Project
AK0001 02070000100 Non-Metropolitan 2008 Alaska Growth Capital BIDCO, Inc. 300000 300000 Aleknagik Alaska 99555 NRE NO NO
AK0002 02020001000 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 1008750 1345000 Anchorage Alaska 99501 NRE NO NO
AK0003 02020000600 Metropolitan 2006 HEDC New Markets, Inc 5061506 8694457 Anchorage Alaska 99508 NRE NO NO
AK0004 02020001000 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 187500 250000 Anchorage Alaska 99501 NRE NO NO
AK0006 02020001802 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 750000 1180000 Anchorage Alaska 99507 NRE NO NO
AK0007 02020001900 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 127500 150000 Anchorage Alaska 99503 NRE NO NO
Code
# Create character zip_code column:
nmtc_awards <- nmtc_awards %>% 
  mutate(zip_code = str_pad(`Zip Code`, 5, "left", pad=0))

nmtc_awards %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
Project ID GEOID10 Metro/Non-Metro, 2010 Census Origination Year Community Development Entity (CDE) Name Project QLICI Amount Estimated Total Project Cost City State Zip Code QALICB Type Multi-CDE Multi-Tract Project zip_code
AK0001 02070000100 Non-Metropolitan 2008 Alaska Growth Capital BIDCO, Inc. 300000 300000 Aleknagik Alaska 99555 NRE NO NO 99555
AK0002 02020001000 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 1008750 1345000 Anchorage Alaska 99501 NRE NO NO 99501
AK0003 02020000600 Metropolitan 2006 HEDC New Markets, Inc 5061506 8694457 Anchorage Alaska 99508 NRE NO NO 99508
AK0004 02020001000 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 187500 250000 Anchorage Alaska 99501 NRE NO NO 99501
AK0006 02020001802 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 750000 1180000 Anchorage Alaska 99507 NRE NO NO 99507
AK0007 02020001900 Metropolitan 2006 Alaska Growth Capital BIDCO, Inc. 127500 150000 Anchorage Alaska 99503 NRE NO NO 99503

Now that we have our awards data formatted, we can view the years of data before 2010:

Code
# View years
nmtc_awards_data %>% 
  filter(`Origination Year` <= 2010)  %>% 
  select(`Origination Year`) %>% 
  unique()
# A tibble: 10 × 1
   `Origination Year`
                <dbl>
 1               2008
 2               2006
 3               2007
 4               2009
 5               2010
 6               2004
 7               2003
 8               2005
 9               2002
10               2001

Now let’s find the number of projects in each tract before 2010:

Code
# View tracts
nmtc_awards_pre2010 <- nmtc_awards %>% 
  filter(`Origination Year` <= 2010) %>% 
  count(GEOID10) %>% 
  rename("pre10_nmtc_project_cnt" = "n")

nmtc_awards_dollars_pre2010 <- nmtc_awards %>% 
  filter(`Origination Year` <= 2010) %>% 
  group_by(GEOID10) %>% 
  summarise(pre10_nmtc_dollars = sum(`Project QLICI Amount`, na.rm = TRUE))

nmtc_awards_pre2010 <- left_join(nmtc_awards_pre2010, 
                                 nmtc_awards_dollars_pre2010, 
                                 join_by(GEOID10 == GEOID10))

nmtc_awards_pre2010$pre10_nmtc_dollars_formatted <- scales::dollar_format()(nmtc_awards_pre2010$pre10_nmtc_dollars)

nmtc_awards_pre2010 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID10 pre10_nmtc_project_cnt pre10_nmtc_dollars pre10_nmtc_dollars_formatted
01059973500 1 5000000 $5,000,000
01069041400 1 2500000 $2,500,000
01073001902 1 14400000 $14,400,000
01073002700 1 1000000 $1,000,000
01073004200 1 5908129 $5,908,129
01073004500 3 37950000 $37,950,000

Let’s view the years after 2010:

Code
# View years
nmtc_awards_data %>% 
  filter(`Origination Year` > 2010)  %>% 
  select(`Origination Year`) %>% 
  unique()
# A tibble: 11 × 1
   `Origination Year`
                <dbl>
 1               2011
 2               2012
 3               2017
 4               2013
 5               2014
 6               2016
 7               2015
 8               2018
 9               2019
10               2020
11               2021

Now let’s view what states have data for years 2011-2020 and we can see we have all 50 and D.C.:

Code
nmtc_awards_data %>% 
  filter(`Origination Year` > 2010 & `Origination Year` <= 2020) %>% 
  select(State) %>% 
  filter(!State %in% c("American Samoa", "Guam", "Puerto Rico")) %>% 
  unique() %>% 
  mutate(n = row_number()) %>% 
  kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State n
Alaska 1
Alabama 2
Arkansas 3
Arizona 4
California 5
Oregon 6
Colorado 7
Connecticut 8
Delaware 9
District of Columbia 10
Florida 11
Illinois 12
Georgia 13
Oklahoma 14
Hawaii 15
Iowa 16
Idaho 17
Missouri 18
New York 19
Indiana 20
Kansas 21
Kentucky 22
Louisiana 23
Massachusetts 24
New Jersey 25
Maryland 26
Maine 27
Michigan 28
Minnesota 29
Mississippi 30
Montana 31
North Carolina 32
North Dakota 33
Nebraska 34
New Hampshire 35
New Mexico 36
Nevada 37
Ohio 38
Pennsylvania 39
Rhode Island 40
South Carolina 41
South Dakota 42
Tennessee 43
Texas 44
Utah 45
Virginia 46
Vermont 47
Washington 48
Wisconsin 49
West Virginia 50
Wyoming 51
Code
nmtc_awards_post2010 <- nmtc_awards %>% 
  filter(`Origination Year` > 2010 & `Origination Year` <= 2020) %>% 
  count(GEOID10) %>% 
  rename("post10_nmtc_project_cnt" = "n")

nmtc_awards_dollars_post2010 <- nmtc_awards %>% 
  filter(`Origination Year` > 2010 & `Origination Year` <= 2020) %>% 
  group_by(GEOID10) %>% 
  summarise(post10_nmtc_dollars = sum(`Project QLICI Amount`, na.rm = TRUE))

nmtc_awards_post2010 <- left_join(nmtc_awards_post2010, 
                                  nmtc_awards_dollars_post2010, 
                                  join_by(GEOID10 == GEOID10))

nmtc_awards_post2010$post10_nmtc_dollars_formatted <- scales::dollar_format()(nmtc_awards_post2010$post10_nmtc_dollars)

nmtc_awards_post2010 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID10 post10_nmtc_project_cnt post10_nmtc_dollars post10_nmtc_dollars_formatted
0000000000. 3 24200000 $24,200,000
01003010200 1 408000 $408,000
01003010300 1 9880000 $9,880,000
01003010600 1 8000000 $8,000,000
01003010904 1 22460000 $22,460,000
01003011501 6 37147460 $37,147,460

SVI Data

Now that all of our SVI data is loaded, we can merge the NMTC data with our SVI data:

Code
# Divisional data
svi_divisional %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.977974 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.291860 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0.000000 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.7464 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.0000000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9
Code
# National data
svi_national %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20
01001020100 01 001 020100 AL Alabama Autauga County 3 South Region 6 East South Central Division 1809 771 696 297 1809 16.41791 0.3871 0 36 889 4.049494 0.1790 0 127 598 21.23746 0.20770 0 47 98 47.95918 0.5767 0 174 696 25.00000 0.18790 0 196 1242 15.780998 0.6093 0 186 1759 10.574190 0.3790 0 222 12.271973 0.4876 0 445 24.59923 0.5473 0 298 1335 22.32210 0.8454 1 27 545 4.954128 0.09275 0 36 1705 2.1114370 0.59040 0 385 1809 21.282477 0.4524 0 771 0 0.0000000 0.1224 0 92 11.9325551 0.8005 1 0 696 0.0000000 0.1238 0 50 696 7.183908 0.6134 0 0 1809 0 0.364 0 1.74230 0.28200 0 2.56345 0.5296 1 0.4524 0.4482 0 2.0241 0.2519 1 6.78225 0.3278 2 1941 710 693 352 1941 18.13498 0.4630 0 18 852 2.112676 0.15070 0 81 507 15.976331 0.26320 0 63 186 33.87097 0.2913 0 144 693 20.77922 0.2230 0 187 1309 14.285714 0.6928 0 187 1941 9.634209 0.6617 0 295 15.19835 0.4601 0 415 21.38073 0.4681 0 391 1526 25.62254 0.9011 1 58 555 10.45045 0.3451 0 0 1843 0.0000000 0.09479 0 437 1941 22.51417 0.3902 0 710 0 0.0000000 0.1079 0 88 12.3943662 0.8263 1 0 693 0.0000000 0.09796 0 10 693 1.443001 0.1643 0 0 1941 0.000000 0.1831 0 2.19120 0.4084 0 2.26919 0.3503 1 0.3902 0.3869 0 1.37956 0.07216 1 6.23015 0.2314 2
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.5754 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.3019 0 154 730 21.09589 0.09312 0 339 1265 26.798419 0.8392 1 313 2012 15.556660 0.6000 0 204 10.099010 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.83510 1 15 1890 0.7936508 0.40130 0 1243 2020 61.534653 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.7808219 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0 0.364 0 2.70312 0.56650 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.41320 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.4041 0 139 1313 10.586443 0.5601 0 91 1533 5.936073 0.4343 0 284 16.16392 0.5169 0 325 18.49744 0.2851 0 164 1208 13.57616 0.4127 0 42 359 11.69916 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.46880 0 57 573 9.947644 0.7317 0 212 1757 12.066022 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.91300 0.68620 1 7.83579 0.4802 2
01001020300 01 001 020300 AL Alabama Autauga County 3 South Region 6 East South Central Division 3543 1403 1287 656 3533 18.56779 0.4443 0 93 1552 5.992268 0.3724 0 273 957 28.52665 0.45780 0 178 330 53.93939 0.7152 0 451 1287 35.04274 0.49930 0 346 2260 15.309734 0.5950 0 252 3102 8.123791 0.2596 0 487 13.745413 0.5868 0 998 28.16822 0.7606 1 371 2224 16.68165 0.6266 0 126 913 13.800657 0.46350 0 0 3365 0.0000000 0.09298 0 637 3543 17.979114 0.4049 0 1403 10 0.7127584 0.3015 0 2 0.1425517 0.4407 0 0 1287 0.0000000 0.1238 0 101 1287 7.847708 0.6443 0 0 3543 0 0.364 0 2.17060 0.41010 0 2.53048 0.5116 1 0.4049 0.4011 0 1.8743 0.1942 0 6.98028 0.3576 1 3694 1464 1351 842 3694 22.79372 0.5833 0 53 1994 2.657974 0.22050 0 117 967 12.099276 0.11370 0 147 384 38.28125 0.3856 0 264 1351 19.54108 0.1827 0 317 2477 12.797739 0.6460 0 127 3673 3.457664 0.2308 0 464 12.56091 0.3088 0 929 25.14889 0.7080 0 473 2744 17.23761 0.6211 0 263 975 26.97436 0.8234 1 128 3586 3.5694367 0.70770 0 1331 3694 36.03140 0.5515 0 1464 26 1.7759563 0.3675 0 14 0.9562842 0.5389 0 35 1351 2.5906736 0.60550 0 42 1351 3.108808 0.3415 0 0 3694 0.000000 0.1831 0 1.86330 0.3063 0 3.16900 0.8380 1 0.5515 0.5468 0 2.03650 0.26830 0 7.62030 0.4460 1
01001020400 01 001 020400 AL Alabama Autauga County 3 South Region 6 East South Central Division 4840 1957 1839 501 4840 10.35124 0.2177 0 101 2129 4.744011 0.2447 0 310 1549 20.01291 0.17080 0 89 290 30.68966 0.2044 0 399 1839 21.69657 0.10540 0 274 3280 8.353658 0.3205 0 399 4293 9.294200 0.3171 0 955 19.731405 0.8643 1 1195 24.69008 0.5530 0 625 3328 18.78005 0.7233 0 152 1374 11.062591 0.34710 0 10 4537 0.2204100 0.22560 0 297 4840 6.136364 0.1647 0 1957 33 1.6862545 0.3843 0 25 1.2774655 0.5516 0 14 1839 0.7612833 0.3564 0 19 1839 1.033170 0.1127 0 0 4840 0 0.364 0 1.20540 0.13470 0 2.71330 0.6129 1 0.1647 0.1632 0 1.7690 0.1591 0 5.85240 0.1954 1 3539 1741 1636 503 3539 14.21305 0.3472 0 39 1658 2.352232 0.17990 0 219 1290 16.976744 0.30880 0 74 346 21.38728 0.1037 0 293 1636 17.90954 0.1333 0 173 2775 6.234234 0.3351 0 169 3529 4.788892 0.3448 0 969 27.38062 0.9225 1 510 14.41085 0.1208 0 670 3019 22.19278 0.8194 1 148 1137 13.01671 0.4541 0 89 3409 2.6107363 0.64690 0 454 3539 12.82848 0.2364 0 1741 143 8.2136703 0.6028 0 0 0.0000000 0.2186 0 10 1636 0.6112469 0.28340 0 72 1636 4.400978 0.4538 0 0 3539 0.000000 0.1831 0 1.34030 0.1575 0 2.96370 0.7496 2 0.2364 0.2344 0 1.74170 0.16270 0 6.28210 0.2389 2
01001020500 01 001 020500 AL Alabama Autauga County 3 South Region 6 East South Central Division 9938 3969 3741 1096 9938 11.02838 0.2364 0 188 4937 3.807981 0.1577 0 426 2406 17.70574 0.11050 0 528 1335 39.55056 0.3753 0 954 3741 25.50120 0.20140 0 293 5983 4.897209 0.1655 0 740 10110 7.319486 0.2211 0 837 8.422218 0.2408 0 3012 30.30791 0.8455 1 759 7155 10.60797 0.2668 0 476 2529 18.821669 0.63540 0 78 9297 0.8389803 0.41110 0 1970 9938 19.822902 0.4330 0 3969 306 7.7097506 0.6153 0 0 0.0000000 0.2198 0 7 3741 0.1871157 0.2535 0 223 3741 5.960973 0.5483 0 0 9938 0 0.364 0 0.98210 0.08468 0 2.39960 0.4381 1 0.4330 0.4290 0 2.0009 0.2430 0 5.81560 0.1905 1 10674 4504 4424 1626 10509 15.47245 0.3851 0 81 5048 1.604596 0.09431 0 321 2299 13.962592 0.17970 0 711 2125 33.45882 0.2836 0 1032 4424 23.32731 0.3109 0 531 6816 7.790493 0.4251 0 301 10046 2.996217 0.1894 0 1613 15.11149 0.4553 0 2765 25.90407 0.7494 0 1124 7281 15.43744 0.5253 0 342 2912 11.74451 0.4019 0 52 9920 0.5241935 0.35230 0 2603 10674 24.38636 0.4160 0 4504 703 15.6083481 0.7378 0 29 0.6438721 0.5037 0 37 4424 0.8363472 0.33420 0 207 4424 4.679023 0.4754 0 176 10674 1.648866 0.7598 1 1.40481 0.1743 0 2.48420 0.4802 0 0.4160 0.4125 0 2.81090 0.63730 1 7.11591 0.3654 1
01001020600 01 001 020600 AL Alabama Autauga County 3 South Region 6 East South Central Division 3402 1456 1308 735 3402 21.60494 0.5199 0 134 1720 7.790698 0.5436 0 242 1032 23.44961 0.28010 0 62 276 22.46377 0.1035 0 304 1308 23.24159 0.14070 0 301 2151 13.993491 0.5510 0 355 3445 10.304790 0.3656 0 386 11.346267 0.4232 0 931 27.36626 0.7200 0 440 2439 18.04018 0.6912 0 143 924 15.476190 0.52900 0 4 3254 0.1229256 0.19840 0 723 3402 21.252205 0.4519 0 1456 18 1.2362637 0.3507 0 433 29.7390110 0.9468 1 16 1308 1.2232416 0.4493 0 28 1308 2.140673 0.2298 0 0 3402 0 0.364 0 2.12080 0.39510 0 2.56180 0.5288 0 0.4519 0.4477 0 2.3406 0.4048 1 7.47510 0.4314 1 3536 1464 1330 1279 3523 36.30429 0.8215 1 34 1223 2.780049 0.23780 0 321 1111 28.892889 0.75870 1 67 219 30.59361 0.2305 0 388 1330 29.17293 0.5075 0 306 2380 12.857143 0.6480 0 415 3496 11.870709 0.7535 1 547 15.46946 0.4760 0 982 27.77149 0.8327 1 729 2514 28.99761 0.9488 1 95 880 10.79545 0.3601 0 0 3394 0.0000000 0.09479 0 985 3536 27.85633 0.4608 0 1464 0 0.0000000 0.1079 0 364 24.8633880 0.9300 1 0 1330 0.0000000 0.09796 0 17 1330 1.278196 0.1463 0 0 3536 0.000000 0.1831 0 2.96830 0.6434 2 2.71239 0.6156 2 0.4608 0.4569 0 1.46526 0.08976 1 7.60675 0.4440 5

Next, let’s filter our dataset only to NMTC eligible tracts:

Code
# Divisional data
svi_divisional_nmtc_eligible <- left_join(svi_divisional, nmtc_eligible_df, join_by("GEOID_2010_trt" == "GEOID10")) %>% filter(tolower(nmtc_eligibility) == "yes")

svi_divisional_nmtc_eligible %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 nmtc_eligibility
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10 Yes
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10 Yes
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11 Yes
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.977974 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.291860 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10 Yes
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9 Yes
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0.000000 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.7464 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.0000000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9 Yes
Code
# National data
svi_national_nmtc_eligible <- left_join(svi_national, nmtc_eligible_df, join_by("GEOID_2010_trt" == "GEOID10")) %>% filter(tolower(nmtc_eligibility) == "yes")

svi_national_nmtc_eligible %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 nmtc_eligibility
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.57540 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.30190 0 154 730 21.09589 0.09312 0 339 1265 26.79842 0.8392 1 313 2012 15.55666 0.6000 0 204 10.09901 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.8351 1 15 1890 0.7936508 0.40130 0 1243 2020 61.53465 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.780822 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0.0000 0.3640 0 2.70312 0.5665 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.4132 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.40410 0 139 1313 10.58644 0.5601 0 91 1533 5.936073 0.4343 0 284 16.163916 0.5169 0 325 18.49744 0.2851 0 164 1208.000 13.57616 0.4127 0 42 359.0000 11.699164 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757.000 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.4688 0 57 573.000 9.947644 0.7317 0 212 1757 12.0660216 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.9130 0.6862 1 7.83579 0.4802 2 Yes
01001020700 01 001 020700 AL Alabama Autauga County 3 South Region 6 East South Central Division 2664 1254 1139 710 2664 26.65165 0.6328 0 29 1310 2.213741 0.05255 0 134 710 18.87324 0.13890 0 187 429 43.58974 0.47090 0 321 1139 28.18262 0.28130 0 396 1852 21.38229 0.7478 0 345 2878 11.98749 0.4459 0 389 14.60210 0.6417 0 599 22.48499 0.4007 0 510 2168 23.52399 0.8752 1 228 712 32.022472 0.8712 1 0 2480 0.0000000 0.09298 0 694 2664 26.05105 0.5138 0 1254 8 0.6379585 0.2931 0 460 36.6826156 0.9714 1 0 1139 0.000000 0.1238 0 125 1139 10.974539 0.7477 0 0 2664 0.0000 0.3640 0 2.16035 0.4069 0 2.88178 0.6997 2 0.5138 0.5090 0 2.5000 0.4882 1 8.05593 0.5185 3 3562 1313 1248 1370 3528 38.83220 0.8512 1 128 1562 8.194622 0.7935 1 168 844 19.905213 0.44510 0 237 404 58.66337 0.8359 1 405 1248 32.45192 0.60420 0 396 2211 17.91045 0.7857 1 444 3547 12.517620 0.7758 1 355 9.966311 0.1800 0 954 26.78271 0.7923 1 629 2593.000 24.25762 0.8730 1 171 797.0000 21.455458 0.7186 0 0 3211 0.0000000 0.09479 0 1009 3562.000 28.32678 0.4668 0 1313 14 1.0662605 0.3165 0 443 33.7395278 0.9663 1 73 1248 5.8493590 0.8211 1 17 1248.000 1.362180 0.1554 0 112 3562 3.1443010 0.8514 1 3.81040 0.8569 4 2.65869 0.5847 2 0.4668 0.4629 0 3.1107 0.7714 3 10.04659 0.7851 9 Yes
01001021100 01 001 021100 AL Alabama Autauga County 3 South Region 6 East South Central Division 3298 1502 1323 860 3298 26.07641 0.6211 0 297 1605 18.504673 0.94340 1 250 1016 24.60630 0.32070 0 74 307 24.10423 0.11920 0 324 1323 24.48980 0.17380 0 710 2231 31.82429 0.8976 1 654 3565 18.34502 0.7018 0 411 12.46210 0.5001 0 738 22.37720 0.3934 0 936 2861 32.71583 0.9807 1 138 825 16.727273 0.5715 0 9 3155 0.2852615 0.25010 0 1979 3298 60.00606 0.7703 1 1502 14 0.9320905 0.3234 0 659 43.8748336 0.9849 1 44 1323 3.325775 0.7062 0 137 1323 10.355253 0.7313 0 0 3298 0.0000 0.3640 0 3.33770 0.7351 2 2.69580 0.6028 1 0.7703 0.7631 1 3.1098 0.7827 1 9.91360 0.7557 5 3499 1825 1462 1760 3499 50.30009 0.9396 1 42 966 4.347826 0.4539 0 426 1274 33.437991 0.85200 1 52 188 27.65957 0.1824 0 478 1462 32.69494 0.61110 0 422 2488 16.96141 0.7638 1 497 3499 14.204058 0.8246 1 853 24.378394 0.8688 1 808 23.09231 0.5829 0 908 2691.100 33.74084 0.9808 1 179 811.6985 22.052524 0.7323 0 8 3248 0.2463054 0.26220 0 1986 3498.713 56.76373 0.7175 0 1825 29 1.5890411 0.3551 0 576 31.5616438 0.9594 1 88 1462 6.0191518 0.8269 1 148 1461.993 10.123166 0.7364 0 38 3499 1.0860246 0.7013 0 3.59300 0.8073 3 3.42700 0.9156 2 0.7175 0.7114 0 3.5791 0.9216 2 11.31660 0.9150 7 Yes
01003010200 01 003 010200 AL Alabama Baldwin County 3 South Region 6 East South Central Division 2612 1220 1074 338 2605 12.97505 0.2907 0 44 1193 3.688181 0.14720 0 172 928 18.53448 0.13090 0 31 146 21.23288 0.09299 0 203 1074 18.90130 0.05657 0 455 1872 24.30556 0.8016 1 456 2730 16.70330 0.6445 0 401 15.35222 0.6847 0 563 21.55436 0.3406 0 410 2038 20.11776 0.7755 1 64 779 8.215661 0.2181 0 0 2510 0.0000000 0.09298 0 329 2612 12.59571 0.3113 0 1220 38 3.1147541 0.4648 0 385 31.5573770 0.9545 1 20 1074 1.862197 0.5509 0 43 1074 4.003724 0.4088 0 0 2612 0.0000 0.3640 0 1.94057 0.3398 1 2.11188 0.2802 1 0.3113 0.3084 0 2.7430 0.6129 1 7.10675 0.3771 3 2928 1312 1176 884 2928 30.19126 0.7334 0 29 1459 1.987663 0.1356 0 71 830 8.554217 0.03726 0 134 346 38.72832 0.3964 0 205 1176 17.43197 0.12010 0 294 2052 14.32749 0.6940 0 219 2925 7.487179 0.5423 0 556 18.989071 0.6705 0 699 23.87295 0.6339 0 489 2226.455 21.96317 0.8122 1 191 783.8820 24.365914 0.7799 1 0 2710 0.0000000 0.09479 0 398 2927.519 13.59513 0.2511 0 1312 13 0.9908537 0.3111 0 400 30.4878049 0.9557 1 6 1176 0.5102041 0.2590 0 81 1176.202 6.886570 0.6115 0 7 2928 0.2390710 0.4961 0 2.22540 0.4183 0 2.99129 0.7634 2 0.2511 0.2490 0 2.6334 0.5496 1 8.10119 0.5207 3 Yes
01003010500 01 003 010500 AL Alabama Baldwin County 3 South Region 6 East South Central Division 4230 1779 1425 498 3443 14.46413 0.3337 0 166 1625 10.215385 0.71790 0 151 1069 14.12535 0.04638 0 196 356 55.05618 0.73830 0 347 1425 24.35088 0.17010 0 707 2945 24.00679 0.7967 1 528 4001 13.19670 0.5005 0 619 14.63357 0.6436 0 790 18.67612 0.1937 0 536 3096 17.31266 0.6572 0 165 920 17.934783 0.6102 0 20 4021 0.4973887 0.32320 0 754 4230 17.82506 0.4023 0 1779 97 5.4525014 0.5525 0 8 0.4496908 0.4600 0 63 1425 4.421053 0.7762 1 90 1425 6.315790 0.5691 0 787 4230 18.6052 0.9649 1 2.51890 0.5121 1 2.42790 0.4539 0 0.4023 0.3986 0 3.3227 0.8628 2 8.67180 0.6054 3 5877 1975 1836 820 5244 15.63692 0.3902 0 90 2583 3.484321 0.3361 0 159 1345 11.821561 0.10530 0 139 491 28.30957 0.1924 0 298 1836 16.23094 0.09053 0 570 4248 13.41808 0.6669 0 353 5247 6.727654 0.4924 0 1109 18.870172 0.6645 0 1144 19.46571 0.3411 0 717 4102.545 17.47696 0.6332 0 103 1286.1180 8.008596 0.2341 0 0 5639 0.0000000 0.09479 0 868 5877.481 14.76823 0.2709 0 1975 26 1.3164557 0.3359 0 45 2.2784810 0.6271 0 9 1836 0.4901961 0.2540 0 116 1835.798 6.318779 0.5811 0 633 5877 10.7708014 0.9507 1 1.97613 0.3410 0 1.96769 0.1961 0 0.2709 0.2686 0 2.7488 0.6077 1 6.96352 0.3406 1 Yes
01003010600 01 003 010600 AL Alabama Baldwin County 3 South Region 6 East South Central Division 3724 1440 1147 1973 3724 52.98067 0.9342 1 142 1439 9.867964 0.69680 0 235 688 34.15698 0.62950 0 187 459 40.74074 0.40290 0 422 1147 36.79163 0.55150 0 497 1876 26.49254 0.8354 1 511 3661 13.95794 0.5334 0 246 6.60580 0.1481 0 1256 33.72718 0.9305 1 496 2522 19.66693 0.7587 1 274 838 32.696897 0.8779 1 32 3479 0.9198045 0.42810 0 2606 3724 69.97852 0.8184 1 1440 21 1.4583333 0.3683 0 321 22.2916667 0.9036 1 97 1147 8.456844 0.8956 1 167 1147 14.559721 0.8209 1 0 3724 0.0000 0.3640 0 3.55130 0.7859 2 3.14330 0.8145 3 0.8184 0.8108 1 3.3524 0.8725 3 10.86540 0.8550 9 4115 1534 1268 1676 3997 41.93145 0.8814 1 294 1809 16.252073 0.9674 1 341 814 41.891892 0.94320 1 204 454 44.93392 0.5438 0 545 1268 42.98107 0.83620 1 624 2425 25.73196 0.9002 1 994 4115 24.155529 0.9602 1 642 15.601458 0.4841 0 1126 27.36331 0.8175 1 568 2989.000 19.00301 0.7045 0 212 715.0000 29.650350 0.8592 1 56 3825 1.4640523 0.53120 0 2715 4115.000 65.97813 0.7732 1 1534 0 0.0000000 0.1079 0 529 34.4850065 0.9685 1 101 1268 7.9652997 0.8795 1 89 1268.000 7.018927 0.6184 0 17 4115 0.4131227 0.5707 0 4.54540 0.9754 5 3.39650 0.9081 2 0.7732 0.7667 1 3.1450 0.7858 2 11.86010 0.9520 10 Yes

Find count of pre2010 NMTC projects:

Code
# Join divisional data to nmtc_awards_pre2010, set count to 0 if no data
svi_divisional_nmtc_eligible <- 
  left_join(svi_divisional_nmtc_eligible, nmtc_awards_pre2010, join_by("GEOID_2010_trt" == "GEOID10")) %>%
  mutate(pre10_nmtc_project_cnt = if_else(is.na(pre10_nmtc_project_cnt), 0, pre10_nmtc_project_cnt)) %>%
    mutate(pre10_nmtc_dollars = if_else(is.na(pre10_nmtc_dollars), 0, pre10_nmtc_dollars)) %>%
    mutate(pre10_nmtc_dollars_formatted = if_else(is.na(pre10_nmtc_dollars_formatted), "$0", pre10_nmtc_dollars_formatted))

# View table
svi_divisional_nmtc_eligible %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 nmtc_eligibility pre10_nmtc_project_cnt pre10_nmtc_dollars pre10_nmtc_dollars_formatted
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10 Yes 0 0 $0
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10 Yes 0 0 $0
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11 Yes 0 0 $0
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.977974 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.291860 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10 Yes 1 4200000 $4,200,000
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9 Yes 0 0 $0
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0.000000 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.7464 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.0000000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9 Yes 0 0 $0
Code
# Join national data to nmtc_awards_pre2010, set count to 0 if no data
svi_national_nmtc_eligible <- 
  left_join(svi_national_nmtc_eligible, nmtc_awards_pre2010, join_by("GEOID_2010_trt" == "GEOID10")) %>%
  mutate(pre10_nmtc_project_cnt = if_else(is.na(pre10_nmtc_project_cnt), 0, pre10_nmtc_project_cnt)) %>%
    mutate(pre10_nmtc_dollars = if_else(is.na(pre10_nmtc_dollars), 0, pre10_nmtc_dollars))%>%
    mutate(pre10_nmtc_dollars_formatted = if_else(is.na(pre10_nmtc_dollars_formatted), "$0", pre10_nmtc_dollars_formatted))

# View table
svi_national_nmtc_eligible %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 nmtc_eligibility pre10_nmtc_project_cnt pre10_nmtc_dollars pre10_nmtc_dollars_formatted
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.57540 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.30190 0 154 730 21.09589 0.09312 0 339 1265 26.79842 0.8392 1 313 2012 15.55666 0.6000 0 204 10.09901 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.8351 1 15 1890 0.7936508 0.40130 0 1243 2020 61.53465 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.780822 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0.0000 0.3640 0 2.70312 0.5665 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.4132 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.40410 0 139 1313 10.58644 0.5601 0 91 1533 5.936073 0.4343 0 284 16.163916 0.5169 0 325 18.49744 0.2851 0 164 1208.000 13.57616 0.4127 0 42 359.0000 11.699164 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757.000 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.4688 0 57 573.000 9.947644 0.7317 0 212 1757 12.0660216 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.9130 0.6862 1 7.83579 0.4802 2 Yes 0 0 $0
01001020700 01 001 020700 AL Alabama Autauga County 3 South Region 6 East South Central Division 2664 1254 1139 710 2664 26.65165 0.6328 0 29 1310 2.213741 0.05255 0 134 710 18.87324 0.13890 0 187 429 43.58974 0.47090 0 321 1139 28.18262 0.28130 0 396 1852 21.38229 0.7478 0 345 2878 11.98749 0.4459 0 389 14.60210 0.6417 0 599 22.48499 0.4007 0 510 2168 23.52399 0.8752 1 228 712 32.022472 0.8712 1 0 2480 0.0000000 0.09298 0 694 2664 26.05105 0.5138 0 1254 8 0.6379585 0.2931 0 460 36.6826156 0.9714 1 0 1139 0.000000 0.1238 0 125 1139 10.974539 0.7477 0 0 2664 0.0000 0.3640 0 2.16035 0.4069 0 2.88178 0.6997 2 0.5138 0.5090 0 2.5000 0.4882 1 8.05593 0.5185 3 3562 1313 1248 1370 3528 38.83220 0.8512 1 128 1562 8.194622 0.7935 1 168 844 19.905213 0.44510 0 237 404 58.66337 0.8359 1 405 1248 32.45192 0.60420 0 396 2211 17.91045 0.7857 1 444 3547 12.517620 0.7758 1 355 9.966311 0.1800 0 954 26.78271 0.7923 1 629 2593.000 24.25762 0.8730 1 171 797.0000 21.455458 0.7186 0 0 3211 0.0000000 0.09479 0 1009 3562.000 28.32678 0.4668 0 1313 14 1.0662605 0.3165 0 443 33.7395278 0.9663 1 73 1248 5.8493590 0.8211 1 17 1248.000 1.362180 0.1554 0 112 3562 3.1443010 0.8514 1 3.81040 0.8569 4 2.65869 0.5847 2 0.4668 0.4629 0 3.1107 0.7714 3 10.04659 0.7851 9 Yes 0 0 $0
01001021100 01 001 021100 AL Alabama Autauga County 3 South Region 6 East South Central Division 3298 1502 1323 860 3298 26.07641 0.6211 0 297 1605 18.504673 0.94340 1 250 1016 24.60630 0.32070 0 74 307 24.10423 0.11920 0 324 1323 24.48980 0.17380 0 710 2231 31.82429 0.8976 1 654 3565 18.34502 0.7018 0 411 12.46210 0.5001 0 738 22.37720 0.3934 0 936 2861 32.71583 0.9807 1 138 825 16.727273 0.5715 0 9 3155 0.2852615 0.25010 0 1979 3298 60.00606 0.7703 1 1502 14 0.9320905 0.3234 0 659 43.8748336 0.9849 1 44 1323 3.325775 0.7062 0 137 1323 10.355253 0.7313 0 0 3298 0.0000 0.3640 0 3.33770 0.7351 2 2.69580 0.6028 1 0.7703 0.7631 1 3.1098 0.7827 1 9.91360 0.7557 5 3499 1825 1462 1760 3499 50.30009 0.9396 1 42 966 4.347826 0.4539 0 426 1274 33.437991 0.85200 1 52 188 27.65957 0.1824 0 478 1462 32.69494 0.61110 0 422 2488 16.96141 0.7638 1 497 3499 14.204058 0.8246 1 853 24.378394 0.8688 1 808 23.09231 0.5829 0 908 2691.100 33.74084 0.9808 1 179 811.6985 22.052524 0.7323 0 8 3248 0.2463054 0.26220 0 1986 3498.713 56.76373 0.7175 0 1825 29 1.5890411 0.3551 0 576 31.5616438 0.9594 1 88 1462 6.0191518 0.8269 1 148 1461.993 10.123166 0.7364 0 38 3499 1.0860246 0.7013 0 3.59300 0.8073 3 3.42700 0.9156 2 0.7175 0.7114 0 3.5791 0.9216 2 11.31660 0.9150 7 Yes 0 0 $0
01003010200 01 003 010200 AL Alabama Baldwin County 3 South Region 6 East South Central Division 2612 1220 1074 338 2605 12.97505 0.2907 0 44 1193 3.688181 0.14720 0 172 928 18.53448 0.13090 0 31 146 21.23288 0.09299 0 203 1074 18.90130 0.05657 0 455 1872 24.30556 0.8016 1 456 2730 16.70330 0.6445 0 401 15.35222 0.6847 0 563 21.55436 0.3406 0 410 2038 20.11776 0.7755 1 64 779 8.215661 0.2181 0 0 2510 0.0000000 0.09298 0 329 2612 12.59571 0.3113 0 1220 38 3.1147541 0.4648 0 385 31.5573770 0.9545 1 20 1074 1.862197 0.5509 0 43 1074 4.003724 0.4088 0 0 2612 0.0000 0.3640 0 1.94057 0.3398 1 2.11188 0.2802 1 0.3113 0.3084 0 2.7430 0.6129 1 7.10675 0.3771 3 2928 1312 1176 884 2928 30.19126 0.7334 0 29 1459 1.987663 0.1356 0 71 830 8.554217 0.03726 0 134 346 38.72832 0.3964 0 205 1176 17.43197 0.12010 0 294 2052 14.32749 0.6940 0 219 2925 7.487179 0.5423 0 556 18.989071 0.6705 0 699 23.87295 0.6339 0 489 2226.455 21.96317 0.8122 1 191 783.8820 24.365914 0.7799 1 0 2710 0.0000000 0.09479 0 398 2927.519 13.59513 0.2511 0 1312 13 0.9908537 0.3111 0 400 30.4878049 0.9557 1 6 1176 0.5102041 0.2590 0 81 1176.202 6.886570 0.6115 0 7 2928 0.2390710 0.4961 0 2.22540 0.4183 0 2.99129 0.7634 2 0.2511 0.2490 0 2.6334 0.5496 1 8.10119 0.5207 3 Yes 0 0 $0
01003010500 01 003 010500 AL Alabama Baldwin County 3 South Region 6 East South Central Division 4230 1779 1425 498 3443 14.46413 0.3337 0 166 1625 10.215385 0.71790 0 151 1069 14.12535 0.04638 0 196 356 55.05618 0.73830 0 347 1425 24.35088 0.17010 0 707 2945 24.00679 0.7967 1 528 4001 13.19670 0.5005 0 619 14.63357 0.6436 0 790 18.67612 0.1937 0 536 3096 17.31266 0.6572 0 165 920 17.934783 0.6102 0 20 4021 0.4973887 0.32320 0 754 4230 17.82506 0.4023 0 1779 97 5.4525014 0.5525 0 8 0.4496908 0.4600 0 63 1425 4.421053 0.7762 1 90 1425 6.315790 0.5691 0 787 4230 18.6052 0.9649 1 2.51890 0.5121 1 2.42790 0.4539 0 0.4023 0.3986 0 3.3227 0.8628 2 8.67180 0.6054 3 5877 1975 1836 820 5244 15.63692 0.3902 0 90 2583 3.484321 0.3361 0 159 1345 11.821561 0.10530 0 139 491 28.30957 0.1924 0 298 1836 16.23094 0.09053 0 570 4248 13.41808 0.6669 0 353 5247 6.727654 0.4924 0 1109 18.870172 0.6645 0 1144 19.46571 0.3411 0 717 4102.545 17.47696 0.6332 0 103 1286.1180 8.008596 0.2341 0 0 5639 0.0000000 0.09479 0 868 5877.481 14.76823 0.2709 0 1975 26 1.3164557 0.3359 0 45 2.2784810 0.6271 0 9 1836 0.4901961 0.2540 0 116 1835.798 6.318779 0.5811 0 633 5877 10.7708014 0.9507 1 1.97613 0.3410 0 1.96769 0.1961 0 0.2709 0.2686 0 2.7488 0.6077 1 6.96352 0.3406 1 Yes 0 0 $0
01003010600 01 003 010600 AL Alabama Baldwin County 3 South Region 6 East South Central Division 3724 1440 1147 1973 3724 52.98067 0.9342 1 142 1439 9.867964 0.69680 0 235 688 34.15698 0.62950 0 187 459 40.74074 0.40290 0 422 1147 36.79163 0.55150 0 497 1876 26.49254 0.8354 1 511 3661 13.95794 0.5334 0 246 6.60580 0.1481 0 1256 33.72718 0.9305 1 496 2522 19.66693 0.7587 1 274 838 32.696897 0.8779 1 32 3479 0.9198045 0.42810 0 2606 3724 69.97852 0.8184 1 1440 21 1.4583333 0.3683 0 321 22.2916667 0.9036 1 97 1147 8.456844 0.8956 1 167 1147 14.559721 0.8209 1 0 3724 0.0000 0.3640 0 3.55130 0.7859 2 3.14330 0.8145 3 0.8184 0.8108 1 3.3524 0.8725 3 10.86540 0.8550 9 4115 1534 1268 1676 3997 41.93145 0.8814 1 294 1809 16.252073 0.9674 1 341 814 41.891892 0.94320 1 204 454 44.93392 0.5438 0 545 1268 42.98107 0.83620 1 624 2425 25.73196 0.9002 1 994 4115 24.155529 0.9602 1 642 15.601458 0.4841 0 1126 27.36331 0.8175 1 568 2989.000 19.00301 0.7045 0 212 715.0000 29.650350 0.8592 1 56 3825 1.4640523 0.53120 0 2715 4115.000 65.97813 0.7732 1 1534 0 0.0000000 0.1079 0 529 34.4850065 0.9685 1 101 1268 7.9652997 0.8795 1 89 1268.000 7.018927 0.6184 0 17 4115 0.4131227 0.5707 0 4.54540 0.9754 5 3.39650 0.9081 2 0.7732 0.7667 1 3.1450 0.7858 2 11.86010 0.9520 10 Yes 0 0 $0

Check row count:

Code
# See number of rows
svi_divisional_nmtc_eligible %>% nrow()
[1] 3920
Code
# See number of rows
svi_national_nmtc_eligible %>% nrow()
[1] 30847

Finally, we need to filter our data set to exclude tracts without SVI flag data for 2010 and/or 2020 (population may be too small), we also need to exclude tracts that had an NMTC project before 2010 since we want to measure the impact of the introduction of NMTC projects. We will discuss this more in-depth in Lab 05, but broadly we want to ensure that previous projects will not interfere with our interpretation of our study results. If tracts meet all criteria, we will flag it as 1 for tracts with NMTC projects and 0 for tracts without an NMTC project:

Code
# Find count of NMTC projects after 2010
# Remove all tracts that do not have SVI flag counts for 2010
# Remove all tracts that do not have SVI flag counts for 2020
# Remove all tracts that had an NMTC project before 2010
svi_divisional_nmtc <- 
  left_join(svi_divisional_nmtc_eligible, nmtc_awards_post2010, join_by("GEOID_2010_trt" == "GEOID10")) %>%
  mutate(post10_nmtc_project_cnt = if_else(is.na(post10_nmtc_project_cnt), 0, post10_nmtc_project_cnt)) %>%
  mutate(post10_nmtc_dollars = if_else(is.na(post10_nmtc_dollars), 0, post10_nmtc_dollars))%>%
  mutate(post10_nmtc_dollars_formatted = if_else(is.na(post10_nmtc_dollars_formatted), "$0", post10_nmtc_dollars_formatted)) %>%
  mutate(nmtc_flag = if_else(post10_nmtc_project_cnt > 0, 1, 0)) %>% 
  filter(!is.na(F_TOTAL_10)) %>% 
  filter(!is.na(F_TOTAL_20)) %>% 
  filter(pre10_nmtc_project_cnt < 1)

svi_divisional_nmtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 nmtc_eligibility pre10_nmtc_project_cnt pre10_nmtc_dollars pre10_nmtc_dollars_formatted post10_nmtc_project_cnt post10_nmtc_dollars post10_nmtc_dollars_formatted nmtc_flag
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.87100 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.00000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10 Yes 0 0 $0 0 0 $0 0
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.90620 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.00000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10 Yes 0 0 $0 0 0 $0 0
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.97280 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.00000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11 Yes 0 0 $0 0 0 $0 0
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.95690 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.00000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9 Yes 0 0 $0 0 0 $0 0
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.74640 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.00000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9 Yes 0 0 $0 0 0 $0 0
34001001300 34 001 001300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2153 1026 857 695 2153 32.28054 0.7840 1 266 1112 23.920863 0.9840 1 168 432 38.88889 0.6425 0 271 425 63.76471 0.8714 1 439 857 51.22520 0.8184 1 210 1471 14.27600 0.5989 0 463 2215 20.90293 0.8974 1 334 15.513237 0.6436 0 539 25.03484 0.66990 0 222 1687 13.15945 0.4984 0 265 608 43.585526 0.9249 1 92 1905 4.829396 0.7187 0 1993 2153 92.56851 0.8890 1 1026 147 14.327485 0.6885 0 0 0.0000000 0.3251 0 20 857 2.333722 0.6326 0 142 857 16.56943 0.6382 0 0 2153 0 0.3512 0 4.0827 0.8798 4 3.45550 0.9039 1 0.8890 0.8804 1 2.6356 0.5687 0 11.06280 0.8673 6 1632 917 770 591 1632 36.21324 0.8455 1 203 854 23.770492 0.9928 1 164 291 56.35739 0.9604 1 364 479 75.99165 0.9710 1 528 770 68.57143 0.9914 1 150 1056 14.20455 0.7232 0 97 1632 5.943627 0.6352 0 301 18.443628 0.60940 0 271 16.60539 0.2292 0 314 1361 23.071271 0.88960 1 148 410 36.09756 0.9025 1 0 1585 0.000000 0.06953 0 1512 1632 92.64706 0.8931 1 917 246 26.8266085 0.7912 1 16 1.74482 0.7855 1 0 770 0.000000 0.1194 0 219 770 28.44156 0.7606 1 14 1632 0.8578431 0.6722 0 4.1881 0.9131 3 2.70023 0.6211 2 0.8931 0.8850 1 3.1289 0.7740 3 10.91033 0.8638 9 Yes 0 0 $0 0 0 $0 0
Code
# Find count of NMTC projects after 2010
# Remove all tracts that do not have SVI flag counts for 2010
# Remove all tracts that do not have SVI flag counts for 2020
# Remove all tracts that had an NMTC project before 2010
svi_national_nmtc <- 
  left_join(svi_national_nmtc_eligible, nmtc_awards_post2010, join_by("GEOID_2010_trt" == "GEOID10")) %>%
  mutate(post10_nmtc_project_cnt = if_else(is.na(post10_nmtc_project_cnt), 0, post10_nmtc_project_cnt)) %>%
  mutate(post10_nmtc_dollars = if_else(is.na(post10_nmtc_dollars), 0, post10_nmtc_dollars))%>%
  mutate(post10_nmtc_dollars_formatted = if_else(is.na(post10_nmtc_dollars_formatted), "$0", post10_nmtc_dollars_formatted)) %>%
  mutate(nmtc_flag = if_else(post10_nmtc_project_cnt > 0, 1, 0)) %>% 
  filter(!is.na(F_TOTAL_10)) %>% 
  filter(!is.na(F_TOTAL_20)) %>% 
  filter(pre10_nmtc_project_cnt < 1)

svi_national_nmtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 nmtc_eligibility pre10_nmtc_project_cnt pre10_nmtc_dollars pre10_nmtc_dollars_formatted post10_nmtc_project_cnt post10_nmtc_dollars post10_nmtc_dollars_formatted nmtc_flag
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.57540 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.30190 0 154 730 21.09589 0.09312 0 339 1265 26.79842 0.8392 1 313 2012 15.55666 0.6000 0 204 10.09901 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.8351 1 15 1890 0.7936508 0.40130 0 1243 2020 61.53465 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.780822 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0.0000 0.3640 0 2.70312 0.5665 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.4132 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.40410 0 139 1313 10.58644 0.5601 0 91 1533 5.936073 0.4343 0 284 16.163916 0.5169 0 325 18.49744 0.2851 0 164 1208.000 13.57616 0.4127 0 42 359.0000 11.699164 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757.000 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.4688 0 57 573.000 9.947644 0.7317 0 212 1757 12.0660216 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.9130 0.6862 1 7.83579 0.4802 2 Yes 0 0 $0 0 0 $0 0
01001020700 01 001 020700 AL Alabama Autauga County 3 South Region 6 East South Central Division 2664 1254 1139 710 2664 26.65165 0.6328 0 29 1310 2.213741 0.05255 0 134 710 18.87324 0.13890 0 187 429 43.58974 0.47090 0 321 1139 28.18262 0.28130 0 396 1852 21.38229 0.7478 0 345 2878 11.98749 0.4459 0 389 14.60210 0.6417 0 599 22.48499 0.4007 0 510 2168 23.52399 0.8752 1 228 712 32.022472 0.8712 1 0 2480 0.0000000 0.09298 0 694 2664 26.05105 0.5138 0 1254 8 0.6379585 0.2931 0 460 36.6826156 0.9714 1 0 1139 0.000000 0.1238 0 125 1139 10.974539 0.7477 0 0 2664 0.0000 0.3640 0 2.16035 0.4069 0 2.88178 0.6997 2 0.5138 0.5090 0 2.5000 0.4882 1 8.05593 0.5185 3 3562 1313 1248 1370 3528 38.83220 0.8512 1 128 1562 8.194622 0.7935 1 168 844 19.905213 0.44510 0 237 404 58.66337 0.8359 1 405 1248 32.45192 0.60420 0 396 2211 17.91045 0.7857 1 444 3547 12.517620 0.7758 1 355 9.966311 0.1800 0 954 26.78271 0.7923 1 629 2593.000 24.25762 0.8730 1 171 797.0000 21.455458 0.7186 0 0 3211 0.0000000 0.09479 0 1009 3562.000 28.32678 0.4668 0 1313 14 1.0662605 0.3165 0 443 33.7395278 0.9663 1 73 1248 5.8493590 0.8211 1 17 1248.000 1.362180 0.1554 0 112 3562 3.1443010 0.8514 1 3.81040 0.8569 4 2.65869 0.5847 2 0.4668 0.4629 0 3.1107 0.7714 3 10.04659 0.7851 9 Yes 0 0 $0 0 0 $0 0
01001021100 01 001 021100 AL Alabama Autauga County 3 South Region 6 East South Central Division 3298 1502 1323 860 3298 26.07641 0.6211 0 297 1605 18.504673 0.94340 1 250 1016 24.60630 0.32070 0 74 307 24.10423 0.11920 0 324 1323 24.48980 0.17380 0 710 2231 31.82429 0.8976 1 654 3565 18.34502 0.7018 0 411 12.46210 0.5001 0 738 22.37720 0.3934 0 936 2861 32.71583 0.9807 1 138 825 16.727273 0.5715 0 9 3155 0.2852615 0.25010 0 1979 3298 60.00606 0.7703 1 1502 14 0.9320905 0.3234 0 659 43.8748336 0.9849 1 44 1323 3.325775 0.7062 0 137 1323 10.355253 0.7313 0 0 3298 0.0000 0.3640 0 3.33770 0.7351 2 2.69580 0.6028 1 0.7703 0.7631 1 3.1098 0.7827 1 9.91360 0.7557 5 3499 1825 1462 1760 3499 50.30009 0.9396 1 42 966 4.347826 0.4539 0 426 1274 33.437991 0.85200 1 52 188 27.65957 0.1824 0 478 1462 32.69494 0.61110 0 422 2488 16.96141 0.7638 1 497 3499 14.204058 0.8246 1 853 24.378394 0.8688 1 808 23.09231 0.5829 0 908 2691.100 33.74084 0.9808 1 179 811.6985 22.052524 0.7323 0 8 3248 0.2463054 0.26220 0 1986 3498.713 56.76373 0.7175 0 1825 29 1.5890411 0.3551 0 576 31.5616438 0.9594 1 88 1462 6.0191518 0.8269 1 148 1461.993 10.123166 0.7364 0 38 3499 1.0860246 0.7013 0 3.59300 0.8073 3 3.42700 0.9156 2 0.7175 0.7114 0 3.5791 0.9216 2 11.31660 0.9150 7 Yes 0 0 $0 0 0 $0 0
01003010200 01 003 010200 AL Alabama Baldwin County 3 South Region 6 East South Central Division 2612 1220 1074 338 2605 12.97505 0.2907 0 44 1193 3.688181 0.14720 0 172 928 18.53448 0.13090 0 31 146 21.23288 0.09299 0 203 1074 18.90130 0.05657 0 455 1872 24.30556 0.8016 1 456 2730 16.70330 0.6445 0 401 15.35222 0.6847 0 563 21.55436 0.3406 0 410 2038 20.11776 0.7755 1 64 779 8.215661 0.2181 0 0 2510 0.0000000 0.09298 0 329 2612 12.59571 0.3113 0 1220 38 3.1147541 0.4648 0 385 31.5573770 0.9545 1 20 1074 1.862197 0.5509 0 43 1074 4.003724 0.4088 0 0 2612 0.0000 0.3640 0 1.94057 0.3398 1 2.11188 0.2802 1 0.3113 0.3084 0 2.7430 0.6129 1 7.10675 0.3771 3 2928 1312 1176 884 2928 30.19126 0.7334 0 29 1459 1.987663 0.1356 0 71 830 8.554217 0.03726 0 134 346 38.72832 0.3964 0 205 1176 17.43197 0.12010 0 294 2052 14.32749 0.6940 0 219 2925 7.487179 0.5423 0 556 18.989071 0.6705 0 699 23.87295 0.6339 0 489 2226.455 21.96317 0.8122 1 191 783.8820 24.365914 0.7799 1 0 2710 0.0000000 0.09479 0 398 2927.519 13.59513 0.2511 0 1312 13 0.9908537 0.3111 0 400 30.4878049 0.9557 1 6 1176 0.5102041 0.2590 0 81 1176.202 6.886570 0.6115 0 7 2928 0.2390710 0.4961 0 2.22540 0.4183 0 2.99129 0.7634 2 0.2511 0.2490 0 2.6334 0.5496 1 8.10119 0.5207 3 Yes 0 0 $0 1 408000 $408,000 1
01003010500 01 003 010500 AL Alabama Baldwin County 3 South Region 6 East South Central Division 4230 1779 1425 498 3443 14.46413 0.3337 0 166 1625 10.215385 0.71790 0 151 1069 14.12535 0.04638 0 196 356 55.05618 0.73830 0 347 1425 24.35088 0.17010 0 707 2945 24.00679 0.7967 1 528 4001 13.19670 0.5005 0 619 14.63357 0.6436 0 790 18.67612 0.1937 0 536 3096 17.31266 0.6572 0 165 920 17.934783 0.6102 0 20 4021 0.4973887 0.32320 0 754 4230 17.82506 0.4023 0 1779 97 5.4525014 0.5525 0 8 0.4496908 0.4600 0 63 1425 4.421053 0.7762 1 90 1425 6.315790 0.5691 0 787 4230 18.6052 0.9649 1 2.51890 0.5121 1 2.42790 0.4539 0 0.4023 0.3986 0 3.3227 0.8628 2 8.67180 0.6054 3 5877 1975 1836 820 5244 15.63692 0.3902 0 90 2583 3.484321 0.3361 0 159 1345 11.821561 0.10530 0 139 491 28.30957 0.1924 0 298 1836 16.23094 0.09053 0 570 4248 13.41808 0.6669 0 353 5247 6.727654 0.4924 0 1109 18.870172 0.6645 0 1144 19.46571 0.3411 0 717 4102.545 17.47696 0.6332 0 103 1286.1180 8.008596 0.2341 0 0 5639 0.0000000 0.09479 0 868 5877.481 14.76823 0.2709 0 1975 26 1.3164557 0.3359 0 45 2.2784810 0.6271 0 9 1836 0.4901961 0.2540 0 116 1835.798 6.318779 0.5811 0 633 5877 10.7708014 0.9507 1 1.97613 0.3410 0 1.96769 0.1961 0 0.2709 0.2686 0 2.7488 0.6077 1 6.96352 0.3406 1 Yes 0 0 $0 0 0 $0 0
01003010600 01 003 010600 AL Alabama Baldwin County 3 South Region 6 East South Central Division 3724 1440 1147 1973 3724 52.98067 0.9342 1 142 1439 9.867964 0.69680 0 235 688 34.15698 0.62950 0 187 459 40.74074 0.40290 0 422 1147 36.79163 0.55150 0 497 1876 26.49254 0.8354 1 511 3661 13.95794 0.5334 0 246 6.60580 0.1481 0 1256 33.72718 0.9305 1 496 2522 19.66693 0.7587 1 274 838 32.696897 0.8779 1 32 3479 0.9198045 0.42810 0 2606 3724 69.97852 0.8184 1 1440 21 1.4583333 0.3683 0 321 22.2916667 0.9036 1 97 1147 8.456844 0.8956 1 167 1147 14.559721 0.8209 1 0 3724 0.0000 0.3640 0 3.55130 0.7859 2 3.14330 0.8145 3 0.8184 0.8108 1 3.3524 0.8725 3 10.86540 0.8550 9 4115 1534 1268 1676 3997 41.93145 0.8814 1 294 1809 16.252073 0.9674 1 341 814 41.891892 0.94320 1 204 454 44.93392 0.5438 0 545 1268 42.98107 0.83620 1 624 2425 25.73196 0.9002 1 994 4115 24.155529 0.9602 1 642 15.601458 0.4841 0 1126 27.36331 0.8175 1 568 2989.000 19.00301 0.7045 0 212 715.0000 29.650350 0.8592 1 56 3825 1.4640523 0.53120 0 2715 4115.000 65.97813 0.7732 1 1534 0 0.0000000 0.1079 0 529 34.4850065 0.9685 1 101 1268 7.9652997 0.8795 1 89 1268.000 7.018927 0.6184 0 17 4115 0.4131227 0.5707 0 4.54540 0.9754 5 3.39650 0.9081 2 0.7732 0.7667 1 3.1450 0.7858 2 11.86010 0.9520 10 Yes 0 0 $0 1 8000000 $8,000,000 1
Code
# See all the states in data set with eligible tracts
svi_national_nmtc %>% 
  select(state) %>% 
  arrange(state) %>% 
  unique() %>% 
  mutate(n = row_number()) %>% 
  kbl() %>% kable_styling() %>% scroll_box(width = "100%")
state n
AK 1
AL 2
AR 3
AZ 4
CA 5
CO 6
CT 7
DC 8
DE 9
FL 10
GA 11
HI 12
IA 13
ID 14
IL 15
IN 16
KS 17
KY 18
LA 19
MA 20
MD 21
ME 22
MI 23
MN 24
MO 25
MS 26
MT 27
NC 28
ND 29
NE 30
NH 31
NJ 32
NM 33
NV 34
NY 35
OH 36
OK 37
OR 38
PA 39
RI 40
SC 41
SD 42
TN 43
TX 44
UT 45
VA 46
VT 47
WA 48
WI 49
WV 50
WY 51
Code
# See all the states in data set with projects
svi_national_nmtc %>% 
  filter(nmtc_flag == 1) %>% 
  select(state) %>% 
  arrange(state) %>% 
  unique() %>% 
  mutate(n = row_number()) %>% 
  kbl() %>% kable_styling() %>% scroll_box(width = "100%")
state n
AK 1
AL 2
AR 3
AZ 4
CA 5
CO 6
CT 7
DC 8
DE 9
FL 10
GA 11
HI 12
IA 13
ID 14
IL 15
IN 16
KS 17
KY 18
LA 19
MA 20
MD 21
ME 22
MI 23
MN 24
MO 25
MS 26
MT 27
NC 28
ND 29
NE 30
NH 31
NJ 32
NM 33
NV 34
NY 35
OH 36
OK 37
OR 38
PA 39
RI 40
SC 41
SD 42
TN 43
TX 44
UT 45
VA 46
VT 47
WA 48
WI 49
WV 50
WY 51

View final number of rows in data set:

National

Code
# See number of rows
svi_national_nmtc %>% nrow()
[1] 29068
Code
# View number of tracts with NMTC projects
svi_national_nmtc %>% filter(nmtc_flag == 1) %>% nrow()
[1] 2054
Code
# View number of tracts without NMTC projects
svi_national_nmtc %>% filter(nmtc_flag == 0) %>% nrow()
[1] 27014
Code
# See distribution of flags for SVI themes in top quarter in 2010
table(svi_national_nmtc$F_TOTAL_10)

   0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
 324 1177 2071 2679 2922 2975 2906 2849 2831 2776 2557 1782  904  264   45    6 
Code
# Average number of flags in 2010
mean(svi_national_nmtc$F_TOTAL_10)
[1] 6.367896
Code
# See distribution of flags for SVI themes in top quarter in 2020
table(svi_national_nmtc$F_TOTAL_20)

   0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
 329 1070 1930 2620 3074 3195 3304 3243 3045 2745 2188 1415  674  203   32    1 
Code
# Average number of flags in 2020
mean(svi_national_nmtc$F_TOTAL_20)
[1] 6.236618

Divisional

Code
# See number of rows
svi_divisional_nmtc %>% nrow()
[1] 3704
Code
# View number of tracts with NMTC projects
svi_divisional_nmtc %>% filter(nmtc_flag == 1) %>% nrow()
[1] 174
Code
# View number of tracts without NMTC projects
svi_divisional_nmtc %>% filter(nmtc_flag == 0) %>% nrow()
[1] 3530
Code
# See distribution of flags for SVI themes in top quarter in 2010
table(svi_divisional_nmtc$F_TOTAL_10)

  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 
 40 148 241 350 321 323 340 346 361 331 336 282 183  90  11   1 
Code
# Average number of flags in 2010
mean(svi_divisional_nmtc$F_TOTAL_10)
[1] 6.723812
Code
# See distribution of flags for SVI themes in top quarter in 2020
table(svi_divisional_nmtc$F_TOTAL_20)

  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 
 42 119 217 349 396 348 349 346 371 356 296 255 156  86  17   1 
Code
# Average number of flags in 2020
mean(svi_divisional_nmtc$F_TOTAL_20)
[1] 6.646868

County-Level SVI NMTC Data

Recall that we have data on counties in our data set:

Code
colnames(svi_divisional_nmtc) %>% head(11)
 [1] "GEOID_2010_trt"  "FIPS_st"         "FIPS_county"     "FIPS_tract"     
 [5] "state"           "state_name"      "county"          "region_number"  
 [9] "region"          "division_number" "division"       

Therefore we can summarize our project counts up to the county-level for easier visualizations with the following function NOTE: Remember to add all functions to project_data_steps.R :

Code
summarize_county_nmtc <- function(df) {
  # Find count of new NMTC projects after 2010 by county
  county_nmtc_project_cnt <- aggregate(df$post10_nmtc_project_cnt,
                                       by=list(State=df$state,
                                               County=df$county,
                                               Division=df$division), 
                                       FUN=sum) %>% 
                                      arrange(State, County) %>%
                                      rename("post10_nmtc_project_cnt" = "x")
  
  # Find count of census tracts in each county
  county_nmtc_tracts <- aggregate(df$GEOID_2010_trt,
                                  by=list(State=df$state,
                                          County=df$county,
                                          Division=df$division), 
                                  FUN=length) %>% 
                                  mutate(tract_cnt = x) %>% 
                                  select (-x)
  
  # Find sum of NMTC project dollars in each county
  county_nmtc_dollars <- aggregate(df$post10_nmtc_dollars,
                                   by=list(State=df$state,
                                           County=df$county,
                                           Division=df$division), 
                                   FUN=sum) %>% 
                                  arrange(State, County) %>%
                                  rename("post10_nmtc_project_dollars" = "x")
  
  # Create character column with NMTC dollars formatted as currency
  county_nmtc_dollars$post10_nmtc_dollars_formatted <-
    scales::dollar_format()(county_nmtc_dollars$post10_nmtc_project_dollars)

  # Join project counts and census tract counts datasets
  county_nmtc0 <- left_join(county_nmtc_project_cnt, county_nmtc_tracts,
                            join_by("State" == "State",
                                    "County" == "County",
                                    "Division" == "Division"))

  # Add dollar amounts
  county_nmtc <- left_join(county_nmtc0, county_nmtc_dollars,
                         join_by("State" == "State",
                                 "County" == "County",
                                 "Division" == "Division"))
  
  # Output data
  return(county_nmtc)
}
Code
svi_national_nmtc_county_sum <- summarize_county_nmtc(svi_national_nmtc)

svi_national_nmtc_county_sum %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted
AK Aleutians East Borough Pacific Division 1 1 15762500 $15,762,500
AK Aleutians West Census Area Pacific Division 0 1 0 $0
AK Anchorage Municipality Pacific Division 1 13 9800000 $9,800,000
AK Bethel Census Area Pacific Division 0 1 0 $0
AK Fairbanks North Star Borough Pacific Division 0 4 0 $0
AK Hoonah-Angoon Census Area Pacific Division 0 1 0 $0
Code
svi_divisional_nmtc_county_sum <- summarize_county_nmtc(svi_divisional_nmtc)
svi_divisional_nmtc_county_sum %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted
NJ Atlantic County Middle Atlantic Division 0 29 0 $0
NJ Bergen County Middle Atlantic Division 1 30 10000000 $10,000,000
NJ Burlington County Middle Atlantic Division 0 20 0 $0
NJ Camden County Middle Atlantic Division 5 47 79664200 $79,664,200
NJ Cape May County Middle Atlantic Division 0 12 0 $0
NJ Cumberland County Middle Atlantic Division 2 21 33187593 $33,187,593

We can then utilize our flag_summarize function from Lab 03 to find our county-level SVI flag calculations:

Code
# Create data frame of NMTC eligible tracts 2010 nationally
svi_national_nmtc10 <- svi_national_nmtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_10, E_TOTPOP_10) %>% rename("F_TOTAL" = "F_TOTAL_10")

# Count national-level SVI flags for 2010, create unified fips column
svi_2010_national_county_flags_nmtc <- flag_summarize(svi_national_nmtc10, "E_TOTPOP_10") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Add suffix to flag columns 2010
colnames(svi_2010_national_county_flags_nmtc)[11:15] <- paste0(colnames(svi_2010_national_county_flags_nmtc)[11:15], 10)

# Create data frame of NMTC eligible tracts 2020 nationally
svi_national_nmtc20 <- svi_national_nmtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_20, E_TOTPOP_20) %>% rename("F_TOTAL" = "F_TOTAL_20")

# Count national-level SVI flags for 2020, create unified fips column
svi_2020_national_county_flags_nmtc <- flag_summarize(svi_national_nmtc20, "E_TOTPOP_20") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Identify needed columns for 2020, add suffix
colnames(svi_2020_national_county_flags_nmtc)[11:15] <- paste0(colnames(svi_2020_national_county_flags_nmtc)[11:15], "20")

# Filter to needed columns for 2020 to avoid duplicate column column names
svi_2020_national_county_flags_join_nmtc <- svi_2020_national_county_flags_nmtc %>% ungroup() %>% select("fips_county_st", all_of(colnames(svi_2020_national_county_flags_nmtc)[11:15]))
 
# Join 2010 and 2020 data
svi_national_county_flags_nmtc <- left_join(svi_2010_national_county_flags_nmtc, svi_2020_national_county_flags_join_nmtc, join_by("fips_county_st" == "fips_county_st")) 

svi_national_county_flags_nmtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
fips_county_st FIPS_st FIPS_county state state_name county region_number region division_number division flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20
01001 01 001 AL Alabama Autauga County 3 South Region 6 East South Central Division 14 7982 0.0017539 0.6 0.8 18 8818 0.0020413 0.6 1.0
01003 01 003 AL Alabama Baldwin County 3 South Region 6 East South Central Division 34 38458 0.0008841 0.8 0.4 34 46255 0.0007351 0.8 0.2
01005 01 005 AL Alabama Barbour County 3 South Region 6 East South Central Division 43 21287 0.0020200 0.8 1.0 44 18811 0.0023391 0.8 1.0
01007 01 007 AL Alabama Bibb County 3 South Region 6 East South Central Division 11 17570 0.0006261 0.4 0.2 16 17663 0.0009058 0.6 0.4
01009 01 009 AL Alabama Blount County 3 South Region 6 East South Central Division 12 16995 0.0007061 0.4 0.2 8 16546 0.0004835 0.4 0.2
01011 01 011 AL Alabama Bullock County 3 South Region 6 East South Central Division 21 10923 0.0019225 0.6 1.0 18 10173 0.0017694 0.6 0.8

Join flags with NMTC county project summary data:

Code
svi_national_county_nmtc <- left_join(svi_national_nmtc_county_sum,
                                      svi_national_county_flags_nmtc,
                                    join_by("State" == "state", "County" == "county",
                                            "Division" == "division"))

svi_national_county_nmtc$post10_nmtc_project_cnt[is.na(svi_national_county_nmtc$post10_nmtc_project_cnt)] <- 0

svi_national_county_nmtc$county_name <- paste0(svi_national_county_nmtc$County, ", ", svi_national_county_nmtc$State)

svi_national_county_nmtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name
AK Aleutians East Borough Pacific Division 1 1 15762500 $15,762,500 02013 02 013 Alaska 4 West Region 9 8 3703 0.0021604 0.4 1.0 5 3389 0.0014754 0.2 0.8 Aleutians East Borough, AK
AK Aleutians West Census Area Pacific Division 0 1 0 $0 02016 02 016 Alaska 4 West Region 9 6 1774 0.0033822 0.2 1.0 6 950 0.0063158 0.2 1.0 Aleutians West Census Area, AK
AK Anchorage Municipality Pacific Division 1 13 9800000 $9,800,000 02020 02 020 Alaska 4 West Region 9 72 64432 0.0011175 1.0 0.4 87 69679 0.0012486 1.0 0.6 Anchorage Municipality, AK
AK Bethel Census Area Pacific Division 0 1 0 $0 02050 02 050 Alaska 4 West Region 9 8 1386 0.0057720 0.4 1.0 10 1404 0.0071225 0.4 1.0 Bethel Census Area, AK
AK Fairbanks North Star Borough Pacific Division 0 4 0 $0 02090 02 090 Alaska 4 West Region 9 13 17281 0.0007523 0.4 0.2 17 20094 0.0008460 0.6 0.4 Fairbanks North Star Borough, AK
AK Hoonah-Angoon Census Area Pacific Division 0 1 0 $0 02105 02 105 Alaska 4 West Region 9 4 1888 0.0021186 0.2 1.0 5 2073 0.0024120 0.2 1.0 Hoonah-Angoon Census Area, AK
Code
# Create data frame of NMTC eligible tracts 2020 nationally
svi_divisional_nmtc10 <- svi_divisional_nmtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_10, E_TOTPOP_10) %>% rename("F_TOTAL" = "F_TOTAL_10")

# Count divisional-level SVI flags for 2010, create unified fips column
svi_2010_divisional_county_flags_nmtc <- flag_summarize(svi_divisional_nmtc10, "E_TOTPOP_10") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Add suffix to flag columns 2010
colnames(svi_2010_divisional_county_flags_nmtc)[11:15] <- paste0(colnames(svi_2010_divisional_county_flags_nmtc)[11:15], "10")

# Create data frame of NMTC eligible tracts 2020 nationally
svi_divisional_nmtc20 <- svi_divisional_nmtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_20, E_TOTPOP_20) %>% rename("F_TOTAL" = "F_TOTAL_20")

# Count divisional-level SVI flags for 2020, create unified fips column
svi_2020_divisional_county_flags_nmtc <- flag_summarize(svi_divisional_nmtc20, "E_TOTPOP_20") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Identify needed columns for 2020
colnames(svi_2020_divisional_county_flags_nmtc)[11:15] <- paste0(colnames(svi_2020_divisional_county_flags_nmtc)[11:15], "20")

# Filter to needed columns for 2020 to avoid duplicate column column names
svi_2020_divisional_county_flags_join_nmtc <- svi_2020_divisional_county_flags_nmtc %>% ungroup() %>% select("fips_county_st", all_of(colnames(svi_2020_divisional_county_flags_nmtc)[11:15]))
 
# Join 2010 and 2020 data
svi_divisional_county_flags_nmtc <- left_join(svi_2010_divisional_county_flags_nmtc, svi_2020_divisional_county_flags_join_nmtc, join_by("fips_county_st" == "fips_county_st")) 

svi_divisional_county_flags_nmtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
fips_county_st FIPS_st FIPS_county state state_name county region_number region division_number division flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20
34001 34 001 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 202 111752 0.0018076 1.0 1.0 220 108778 0.0020225 1.0 1.0
34003 34 003 NJ New Jersey Bergen County 1 Northeast Region 2 Middle Atlantic Division 146 143973 0.0010141 1.0 0.4 165 154365 0.0010689 1.0 0.4
34005 34 005 NJ New Jersey Burlington County 1 Northeast Region 2 Middle Atlantic Division 84 62519 0.0013436 0.8 0.6 86 61250 0.0014041 0.8 0.6
34007 34 007 NJ New Jersey Camden County 1 Northeast Region 2 Middle Atlantic Division 332 183630 0.0018080 1.0 1.0 315 180659 0.0017436 1.0 0.8
34009 34 009 NJ New Jersey Cape May County 1 Northeast Region 2 Middle Atlantic Division 59 39917 0.0014781 0.8 0.8 47 39348 0.0011945 0.6 0.6
34011 34 011 NJ New Jersey Cumberland County 1 Northeast Region 2 Middle Atlantic Division 138 101151 0.0013643 0.8 0.6 135 97989 0.0013777 0.8 0.6

Join flags with NMTC county project summary data for division:

Code
svi_divisional_county_nmtc <- left_join(svi_divisional_nmtc_county_sum, 
                                        svi_divisional_county_flags_nmtc,
                                    join_by("State" == "state", "County" == "county",
                                            "Division" == "division"))

svi_divisional_county_nmtc$post10_nmtc_project_cnt[is.na(svi_divisional_county_nmtc $post10_nmtc_project_cnt)] <- 0

svi_divisional_county_nmtc$county_name <- paste0(svi_divisional_county_nmtc$County, ", ", svi_divisional_county_nmtc$State)

svi_divisional_county_nmtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name
NJ Atlantic County Middle Atlantic Division 0 29 0 $0 34001 34 001 New Jersey 1 Northeast Region 2 202 111752 0.0018076 1.0 1.0 220 108778 0.0020225 1.0 1.0 Atlantic County, NJ
NJ Bergen County Middle Atlantic Division 1 30 10000000 $10,000,000 34003 34 003 New Jersey 1 Northeast Region 2 146 143973 0.0010141 1.0 0.4 165 154365 0.0010689 1.0 0.4 Bergen County, NJ
NJ Burlington County Middle Atlantic Division 0 20 0 $0 34005 34 005 New Jersey 1 Northeast Region 2 84 62519 0.0013436 0.8 0.6 86 61250 0.0014041 0.8 0.6 Burlington County, NJ
NJ Camden County Middle Atlantic Division 5 47 79664200 $79,664,200 34007 34 007 New Jersey 1 Northeast Region 2 332 183630 0.0018080 1.0 1.0 315 180659 0.0017436 1.0 0.8 Camden County, NJ
NJ Cape May County Middle Atlantic Division 0 12 0 $0 34009 34 009 New Jersey 1 Northeast Region 2 59 39917 0.0014781 0.8 0.8 47 39348 0.0011945 0.6 0.6 Cape May County, NJ
NJ Cumberland County Middle Atlantic Division 2 21 33187593 $33,187,593 34011 34 011 New Jersey 1 Northeast Region 2 138 101151 0.0013643 0.8 0.6 135 97989 0.0013777 0.8 0.6 Cumberland County, NJ

LIHTC Data Wrangling

Now that we have our NMTC data wrangled, we need to repeat these steps for our LIHTC data:

Code
# View column names
colnames(lihtc_eligible)
 [1] "state"    "county"   "stcnty"   "tract"    "fips"     "splittr" 
 [7] "qct_id"   "old_cnty" "metro"    "areapop"  "cbsa"     "cbsasub" 
[13] "amgi2000" "amgi60pc" "pop100"   "p015001"  "p016001"  "p087001" 
[19] "p087002"  "hhinc01"  "hhinc02"  "hhinc03"  "hhinc04"  "hhinc05" 
[25] "hhinc06"  "hhinc07"  "hhinc08"  "hhinc09"  "hhinc10"  "hhinc11" 
[31] "hhinc12"  "hhinc13"  "hhinc14"  "hhinc15"  "hhinc16"  "hhinc17" 
[37] "hhinc18"  "hhinc19"  "hhinc20"  "hhinc21"  "hhinc22"  "hhinc23" 
[43] "hhinc24"  "hhinc25"  "hhinc26"  "hhinc27"  "hhinc28"  "hhinc29" 
[49] "hhinc30"  "hhinc31"  "hhinc32"  "hhinc33"  "hhinc34"  "hhinc35" 
[55] "hhinc36"  "pctinc"   "povrate"  "qct_2010"

First we need to process our LIHTC eligibility data set to identify all census tracts eligible for the program:

Code
lihtc_eligible_flag <- lihtc_eligible %>% 
  select("fips", "state", "county", "stcnty", "tract", "metro", "cbsa", "qct_2010") %>% 
  rename("GEOID10" = "fips") %>% 
  mutate(lihtc_eligibility = if_else(qct_2010 == 1, "Yes", "No")) %>% 
  filter(tolower(lihtc_eligibility) == "yes") %>% 
  select(GEOID10, lihtc_eligibility)

lihtc_eligible_flag %>% head() 
# A tibble: 6 × 2
  GEOID10     lihtc_eligibility
  <chr>       <chr>            
1 01003010600 Yes              
2 01005950200 Yes              
3 01005950300 Yes              
4 01005950400 Yes              
5 01005950600 Yes              
6 01005950700 Yes              

Now we need to process our LIHTC projects data set to filter out the null values in our data set (we can identify these because we should not have any data for years in the 8000s or later (at least not yet 😉)). We also need to filter to only keep projects in 2010 or before:

Code
lihtc_projects10 <- lihtc_projects %>% 
  filter(yr_alloc < 8000) %>% 
  filter(yr_alloc <= 2010) %>% 
  count(fips2010) %>% 
  rename("pre10_lihtc_project_cnt" = "n")

lihtc_projects10 %>% head() 
     fips2010 pre10_lihtc_project_cnt
1 01001020300                       2
2 01001020500                       5
3 01001021100                       1
4 01003010200                       1
5 01003010600                       1
6 01003010703                       1

Next, we can find the number of dollars in tax credits each tract received during this time:

Code
lihtc_dollars10 <- lihtc_projects %>% 
  filter(yr_alloc < 8000) %>% 
  filter(yr_alloc <= 2010) %>%
  select(fips2010, allocamt)

lihtc_dollars10$allocamt[is.na(lihtc_dollars10$allocamt)] <- 0

lihtc_dollars10 <- lihtc_dollars10 %>% 
  group_by(fips2010) %>% 
  summarise(pre10_lihtc_project_dollars = sum(allocamt, na.rm = TRUE))

lihtc_dollars10 %>% head() 
# A tibble: 6 × 2
  fips2010    pre10_lihtc_project_dollars
  <chr>                             <dbl>
1 01001020300                      216593
2 01001020500                     2250459
3 01001021100                       53109
4 01003010200                           0
5 01003010600                      376889
6 01003010703                      717113

We can then join this to our projects data set:

Code
lihtc_projects10 <- left_join(lihtc_projects10, lihtc_dollars10, join_by(fips2010 == fips2010))

lihtc_projects10 %>% head()
     fips2010 pre10_lihtc_project_cnt pre10_lihtc_project_dollars
1 01001020300                       2                      216593
2 01001020500                       5                     2250459
3 01001021100                       1                       53109
4 01003010200                       1                           0
5 01003010600                       1                      376889
6 01003010703                       1                      717113

Now we need to create a second data set of projects after 2010 and before 2021 (2011-2020):

Code
colnames(lihtc_projects)
 [1] "hud_id"            "project"           "proj_add"         
 [4] "proj_cty"          "proj_st"           "proj_zip"         
 [7] "state_id"          "latitude"          "longitude"        
[10] "place1990"         "place2000"         "place2010"        
[13] "fips1990"          "fips2000"          "fips2010"         
[16] "st2010"            "cnty2010"          "scattered_site_cd"
[19] "resyndication_cd"  "allocamt"          "n_units"          
[22] "li_units"          "n_0br"             "n_1br"            
[25] "n_2br"             "n_3br"             "n_4br"            
[28] "inc_ceil"          "low_ceil"          "ceilunit"         
[31] "yr_pis"            "yr_alloc"          "non_prof"         
[34] "basis"             "bond"              "mff_ra"           
[37] "fmha_514"          "fmha_515"          "fmha_538"         
[40] "home"              "home_amt"          "tcap"             
[43] "tcap_amt"          "cdbg"              "cdbg_amt"         
[46] "htf"               "htf_amt"           "fha"              
[49] "hopevi"            "hpvi_amt"          "tcep"             
[52] "tcep_amt"          "rad"               "qozf"             
[55] "qozf_amt"          "rentassist"        "trgt_pop"         
[58] "trgt_fam"          "trgt_eld"          "trgt_dis"         
[61] "trgt_hml"          "trgt_other"        "trgt_spc"         
[64] "type"              "credit"            "n_unitsr"         
[67] "li_unitr"          "metro"             "dda"              
[70] "qct"               "nonprog"           "nlm_reason"       
[73] "nlm_spc"           "datanote"          "record_stat"      
Code
lihtc_projects20 <- lihtc_projects %>% 
  filter(yr_alloc < 8000) %>% 
  filter(yr_alloc > 2010) %>% 
  filter(yr_alloc < 2021) %>% 
  count(fips2010) %>% 
  rename("post10_lihtc_project_cnt" = "n")

lihtc_projects20 %>% head() 
     fips2010 post10_lihtc_project_cnt
1 01003010500                        1
2 01003011403                        1
3 01003011601                        1
4 01005950900                        1
5 01009050102                        1
6 01017954600                        2

Once again, we need to find the number of dollars in tax credits each tract received during this time:

Code
lihtc_dollars20 <- lihtc_projects %>% 
  filter(yr_alloc < 8000) %>% 
  filter(yr_alloc > 2010) %>% 
  filter(yr_alloc < 2021) %>% 
  select(fips2010, allocamt)

lihtc_dollars20$allocamt[is.na(lihtc_dollars20$allocamt)] <- 0

lihtc_dollars20 <- lihtc_dollars20 %>% 
  group_by(fips2010) %>% 
  summarise(post10_lihtc_project_dollars = sum(allocamt, na.rm = TRUE))

lihtc_dollars20 %>% head() 
# A tibble: 6 × 2
  fips2010    post10_lihtc_project_dollars
  <chr>                              <dbl>
1 01003010500                       481325
2 01003011403                       828342
3 01003011601                       887856
4 01005950900                       400758
5 01009050102                       463000
6 01017954600                       950192
Code
lihtc_projects20 <- left_join(lihtc_projects20, lihtc_dollars20, join_by(fips2010 == fips2010))

lihtc_projects20 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
fips2010 post10_lihtc_project_cnt post10_lihtc_project_dollars
01003010500 1 481325
01003011403 1 828342
01003011601 1 887856
01005950900 1 400758
01009050102 1 463000
01017954600 2 950192

Next, we need to join with our SVI divisional and national data:

Code
svi_divisional_lihtc10 <- left_join(svi_divisional, lihtc_projects10, join_by("GEOID_2010_trt" == "fips2010"))

svi_divisional_lihtc10 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10 NA NA
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10 NA NA
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11 NA NA
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.977974 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.291860 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10 NA NA
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9 NA NA
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0.000000 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.7464 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.0000000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9 1 0
Code
svi_national_lihtc10 <- left_join(svi_national, lihtc_projects10, join_by("GEOID_2010_trt" == "fips2010"))

svi_national_lihtc10 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars
01001020100 01 001 020100 AL Alabama Autauga County 3 South Region 6 East South Central Division 1809 771 696 297 1809 16.41791 0.3871 0 36 889 4.049494 0.1790 0 127 598 21.23746 0.20770 0 47 98 47.95918 0.5767 0 174 696 25.00000 0.18790 0 196 1242 15.780998 0.6093 0 186 1759 10.574190 0.3790 0 222 12.271973 0.4876 0 445 24.59923 0.5473 0 298 1335 22.32210 0.8454 1 27 545 4.954128 0.09275 0 36 1705 2.1114370 0.59040 0 385 1809 21.282477 0.4524 0 771 0 0.0000000 0.1224 0 92 11.9325551 0.8005 1 0 696 0.0000000 0.1238 0 50 696 7.183908 0.6134 0 0 1809 0 0.364 0 1.74230 0.28200 0 2.56345 0.5296 1 0.4524 0.4482 0 2.0241 0.2519 1 6.78225 0.3278 2 1941 710 693 352 1941 18.13498 0.4630 0 18 852 2.112676 0.15070 0 81 507 15.976331 0.26320 0 63 186 33.87097 0.2913 0 144 693 20.77922 0.2230 0 187 1309 14.285714 0.6928 0 187 1941 9.634209 0.6617 0 295 15.19835 0.4601 0 415 21.38073 0.4681 0 391 1526 25.62254 0.9011 1 58 555 10.45045 0.3451 0 0 1843 0.0000000 0.09479 0 437 1941 22.51417 0.3902 0 710 0 0.0000000 0.1079 0 88 12.3943662 0.8263 1 0 693 0.0000000 0.09796 0 10 693 1.443001 0.1643 0 0 1941 0.000000 0.1831 0 2.19120 0.4084 0 2.26919 0.3503 1 0.3902 0.3869 0 1.37956 0.07216 1 6.23015 0.2314 2 NA NA
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.5754 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.3019 0 154 730 21.09589 0.09312 0 339 1265 26.798419 0.8392 1 313 2012 15.556660 0.6000 0 204 10.099010 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.83510 1 15 1890 0.7936508 0.40130 0 1243 2020 61.534653 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.7808219 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0 0.364 0 2.70312 0.56650 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.41320 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.4041 0 139 1313 10.586443 0.5601 0 91 1533 5.936073 0.4343 0 284 16.16392 0.5169 0 325 18.49744 0.2851 0 164 1208 13.57616 0.4127 0 42 359 11.69916 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.46880 0 57 573 9.947644 0.7317 0 212 1757 12.066022 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.91300 0.68620 1 7.83579 0.4802 2 NA NA
01001020300 01 001 020300 AL Alabama Autauga County 3 South Region 6 East South Central Division 3543 1403 1287 656 3533 18.56779 0.4443 0 93 1552 5.992268 0.3724 0 273 957 28.52665 0.45780 0 178 330 53.93939 0.7152 0 451 1287 35.04274 0.49930 0 346 2260 15.309734 0.5950 0 252 3102 8.123791 0.2596 0 487 13.745413 0.5868 0 998 28.16822 0.7606 1 371 2224 16.68165 0.6266 0 126 913 13.800657 0.46350 0 0 3365 0.0000000 0.09298 0 637 3543 17.979114 0.4049 0 1403 10 0.7127584 0.3015 0 2 0.1425517 0.4407 0 0 1287 0.0000000 0.1238 0 101 1287 7.847708 0.6443 0 0 3543 0 0.364 0 2.17060 0.41010 0 2.53048 0.5116 1 0.4049 0.4011 0 1.8743 0.1942 0 6.98028 0.3576 1 3694 1464 1351 842 3694 22.79372 0.5833 0 53 1994 2.657974 0.22050 0 117 967 12.099276 0.11370 0 147 384 38.28125 0.3856 0 264 1351 19.54108 0.1827 0 317 2477 12.797739 0.6460 0 127 3673 3.457664 0.2308 0 464 12.56091 0.3088 0 929 25.14889 0.7080 0 473 2744 17.23761 0.6211 0 263 975 26.97436 0.8234 1 128 3586 3.5694367 0.70770 0 1331 3694 36.03140 0.5515 0 1464 26 1.7759563 0.3675 0 14 0.9562842 0.5389 0 35 1351 2.5906736 0.60550 0 42 1351 3.108808 0.3415 0 0 3694 0.000000 0.1831 0 1.86330 0.3063 0 3.16900 0.8380 1 0.5515 0.5468 0 2.03650 0.26830 0 7.62030 0.4460 1 2 216593
01001020400 01 001 020400 AL Alabama Autauga County 3 South Region 6 East South Central Division 4840 1957 1839 501 4840 10.35124 0.2177 0 101 2129 4.744011 0.2447 0 310 1549 20.01291 0.17080 0 89 290 30.68966 0.2044 0 399 1839 21.69657 0.10540 0 274 3280 8.353658 0.3205 0 399 4293 9.294200 0.3171 0 955 19.731405 0.8643 1 1195 24.69008 0.5530 0 625 3328 18.78005 0.7233 0 152 1374 11.062591 0.34710 0 10 4537 0.2204100 0.22560 0 297 4840 6.136364 0.1647 0 1957 33 1.6862545 0.3843 0 25 1.2774655 0.5516 0 14 1839 0.7612833 0.3564 0 19 1839 1.033170 0.1127 0 0 4840 0 0.364 0 1.20540 0.13470 0 2.71330 0.6129 1 0.1647 0.1632 0 1.7690 0.1591 0 5.85240 0.1954 1 3539 1741 1636 503 3539 14.21305 0.3472 0 39 1658 2.352232 0.17990 0 219 1290 16.976744 0.30880 0 74 346 21.38728 0.1037 0 293 1636 17.90954 0.1333 0 173 2775 6.234234 0.3351 0 169 3529 4.788892 0.3448 0 969 27.38062 0.9225 1 510 14.41085 0.1208 0 670 3019 22.19278 0.8194 1 148 1137 13.01671 0.4541 0 89 3409 2.6107363 0.64690 0 454 3539 12.82848 0.2364 0 1741 143 8.2136703 0.6028 0 0 0.0000000 0.2186 0 10 1636 0.6112469 0.28340 0 72 1636 4.400978 0.4538 0 0 3539 0.000000 0.1831 0 1.34030 0.1575 0 2.96370 0.7496 2 0.2364 0.2344 0 1.74170 0.16270 0 6.28210 0.2389 2 NA NA
01001020500 01 001 020500 AL Alabama Autauga County 3 South Region 6 East South Central Division 9938 3969 3741 1096 9938 11.02838 0.2364 0 188 4937 3.807981 0.1577 0 426 2406 17.70574 0.11050 0 528 1335 39.55056 0.3753 0 954 3741 25.50120 0.20140 0 293 5983 4.897209 0.1655 0 740 10110 7.319486 0.2211 0 837 8.422218 0.2408 0 3012 30.30791 0.8455 1 759 7155 10.60797 0.2668 0 476 2529 18.821669 0.63540 0 78 9297 0.8389803 0.41110 0 1970 9938 19.822902 0.4330 0 3969 306 7.7097506 0.6153 0 0 0.0000000 0.2198 0 7 3741 0.1871157 0.2535 0 223 3741 5.960973 0.5483 0 0 9938 0 0.364 0 0.98210 0.08468 0 2.39960 0.4381 1 0.4330 0.4290 0 2.0009 0.2430 0 5.81560 0.1905 1 10674 4504 4424 1626 10509 15.47245 0.3851 0 81 5048 1.604596 0.09431 0 321 2299 13.962592 0.17970 0 711 2125 33.45882 0.2836 0 1032 4424 23.32731 0.3109 0 531 6816 7.790493 0.4251 0 301 10046 2.996217 0.1894 0 1613 15.11149 0.4553 0 2765 25.90407 0.7494 0 1124 7281 15.43744 0.5253 0 342 2912 11.74451 0.4019 0 52 9920 0.5241935 0.35230 0 2603 10674 24.38636 0.4160 0 4504 703 15.6083481 0.7378 0 29 0.6438721 0.5037 0 37 4424 0.8363472 0.33420 0 207 4424 4.679023 0.4754 0 176 10674 1.648866 0.7598 1 1.40481 0.1743 0 2.48420 0.4802 0 0.4160 0.4125 0 2.81090 0.63730 1 7.11591 0.3654 1 5 2250459
01001020600 01 001 020600 AL Alabama Autauga County 3 South Region 6 East South Central Division 3402 1456 1308 735 3402 21.60494 0.5199 0 134 1720 7.790698 0.5436 0 242 1032 23.44961 0.28010 0 62 276 22.46377 0.1035 0 304 1308 23.24159 0.14070 0 301 2151 13.993491 0.5510 0 355 3445 10.304790 0.3656 0 386 11.346267 0.4232 0 931 27.36626 0.7200 0 440 2439 18.04018 0.6912 0 143 924 15.476190 0.52900 0 4 3254 0.1229256 0.19840 0 723 3402 21.252205 0.4519 0 1456 18 1.2362637 0.3507 0 433 29.7390110 0.9468 1 16 1308 1.2232416 0.4493 0 28 1308 2.140673 0.2298 0 0 3402 0 0.364 0 2.12080 0.39510 0 2.56180 0.5288 0 0.4519 0.4477 0 2.3406 0.4048 1 7.47510 0.4314 1 3536 1464 1330 1279 3523 36.30429 0.8215 1 34 1223 2.780049 0.23780 0 321 1111 28.892889 0.75870 1 67 219 30.59361 0.2305 0 388 1330 29.17293 0.5075 0 306 2380 12.857143 0.6480 0 415 3496 11.870709 0.7535 1 547 15.46946 0.4760 0 982 27.77149 0.8327 1 729 2514 28.99761 0.9488 1 95 880 10.79545 0.3601 0 0 3394 0.0000000 0.09479 0 985 3536 27.85633 0.4608 0 1464 0 0.0000000 0.1079 0 364 24.8633880 0.9300 1 0 1330 0.0000000 0.09796 0 17 1330 1.278196 0.1463 0 0 3536 0.000000 0.1831 0 2.96830 0.6434 2 2.71239 0.6156 2 0.4608 0.4569 0 1.46526 0.08976 1 7.60675 0.4440 5 NA NA

We will add in our 2020 data:

Code
svi_divisional_lihtc20 <- left_join(svi_divisional_lihtc10, lihtc_projects20, join_by("GEOID_2010_trt" == "fips2010"))

svi_divisional_lihtc20 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.331943 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.425743 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10 NA NA NA NA
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.085470 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.822222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10 NA NA NA NA
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.019206 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.647059 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11 NA NA NA NA
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.977974 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.291860 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10 NA NA NA NA
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.802068 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.439532 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9 NA NA NA NA
34001001100 34 001 001100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2204 1204 1204 1185 2204 53.76588 0.9457 1 219 927 23.624596 0.9830 1 97 172 56.39535 0.9094 1 462 1032 44.76744 0.4746 0 559 1204 46.42857 0.7197 0 346 1440 24.02778 0.8306 1 469 1942 24.15036 0.9360 1 363 16.470054 0.7020 0 578 26.22505 0.74410 0 442 1558 28.36970 0.9675 1 247 396 62.373737 0.9898 1 104 2051 5.070697 0.7260 0 2118 2204 96.09800 0.9204 1 1204 570 47.342193 0.8858 1 0 0.0000000 0.3251 0 14 1204 1.162791 0.4877 0 817 1204 67.85714 0.9413 1 0 2204 0.000000 0.3512 0 4.4150 0.9451 4 4.12940 0.9805 2 0.9204 0.9114 1 2.9911 0.7243 2 12.45590 0.9597 9 1950 1267 1096 1131 1950 58.00000 0.9678 1 66 706 9.348442 0.8395 1 42 101 41.58416 0.8612 1 309 995 31.05528 0.1959 0 351 1096 32.02555 0.4782 0 510 1379 36.98332 0.9763 1 155 1950 7.948718 0.7660 1 392 20.102564 0.69880 0 447 22.92308 0.6712 0 570 1503 37.924152 0.99200 1 143 374 38.23529 0.9167 1 109 1841 5.920695 0.7464 0 1909 1950 97.89744 0.9529 1 1267 479 37.8058406 0.8464 1 0 0.0000000 0.3216 0 33 1096 3.010949 0.6446 0 743 1096 67.79197 0.9414 1 0 1950 0.0000000 0.1517 0 4.0278 0.8848 4 4.02510 0.9798 2 0.9529 0.9442 1 2.9057 0.6869 2 11.91150 0.9365 9 1 0 1 1290441
Code
svi_national_lihtc20 <- left_join(svi_national_lihtc10, lihtc_projects20, join_by("GEOID_2010_trt" == "fips2010"))

svi_national_lihtc20 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars
01001020100 01 001 020100 AL Alabama Autauga County 3 South Region 6 East South Central Division 1809 771 696 297 1809 16.41791 0.3871 0 36 889 4.049494 0.1790 0 127 598 21.23746 0.20770 0 47 98 47.95918 0.5767 0 174 696 25.00000 0.18790 0 196 1242 15.780998 0.6093 0 186 1759 10.574190 0.3790 0 222 12.271973 0.4876 0 445 24.59923 0.5473 0 298 1335 22.32210 0.8454 1 27 545 4.954128 0.09275 0 36 1705 2.1114370 0.59040 0 385 1809 21.282477 0.4524 0 771 0 0.0000000 0.1224 0 92 11.9325551 0.8005 1 0 696 0.0000000 0.1238 0 50 696 7.183908 0.6134 0 0 1809 0 0.364 0 1.74230 0.28200 0 2.56345 0.5296 1 0.4524 0.4482 0 2.0241 0.2519 1 6.78225 0.3278 2 1941 710 693 352 1941 18.13498 0.4630 0 18 852 2.112676 0.15070 0 81 507 15.976331 0.26320 0 63 186 33.87097 0.2913 0 144 693 20.77922 0.2230 0 187 1309 14.285714 0.6928 0 187 1941 9.634209 0.6617 0 295 15.19835 0.4601 0 415 21.38073 0.4681 0 391 1526 25.62254 0.9011 1 58 555 10.45045 0.3451 0 0 1843 0.0000000 0.09479 0 437 1941 22.51417 0.3902 0 710 0 0.0000000 0.1079 0 88 12.3943662 0.8263 1 0 693 0.0000000 0.09796 0 10 693 1.443001 0.1643 0 0 1941 0.000000 0.1831 0 2.19120 0.4084 0 2.26919 0.3503 1 0.3902 0.3869 0 1.37956 0.07216 1 6.23015 0.2314 2 NA NA NA NA
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.5754 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.3019 0 154 730 21.09589 0.09312 0 339 1265 26.798419 0.8392 1 313 2012 15.556660 0.6000 0 204 10.099010 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.83510 1 15 1890 0.7936508 0.40130 0 1243 2020 61.534653 0.7781 1 816 0 0.0000000 0.1224 0 34 4.1666667 0.6664 0 13 730 1.7808219 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0 0.364 0 2.70312 0.56650 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.41320 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.4041 0 139 1313 10.586443 0.5601 0 91 1533 5.936073 0.4343 0 284 16.16392 0.5169 0 325 18.49744 0.2851 0 164 1208 13.57616 0.4127 0 42 359 11.69916 0.3998 0 0 1651 0.0000000 0.09479 0 1116 1757 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.46880 0 57 573 9.947644 0.7317 0 212 1757 12.066022 0.9549 1 2.45440 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.91300 0.68620 1 7.83579 0.4802 2 NA NA NA NA
01001020300 01 001 020300 AL Alabama Autauga County 3 South Region 6 East South Central Division 3543 1403 1287 656 3533 18.56779 0.4443 0 93 1552 5.992268 0.3724 0 273 957 28.52665 0.45780 0 178 330 53.93939 0.7152 0 451 1287 35.04274 0.49930 0 346 2260 15.309734 0.5950 0 252 3102 8.123791 0.2596 0 487 13.745413 0.5868 0 998 28.16822 0.7606 1 371 2224 16.68165 0.6266 0 126 913 13.800657 0.46350 0 0 3365 0.0000000 0.09298 0 637 3543 17.979114 0.4049 0 1403 10 0.7127584 0.3015 0 2 0.1425517 0.4407 0 0 1287 0.0000000 0.1238 0 101 1287 7.847708 0.6443 0 0 3543 0 0.364 0 2.17060 0.41010 0 2.53048 0.5116 1 0.4049 0.4011 0 1.8743 0.1942 0 6.98028 0.3576 1 3694 1464 1351 842 3694 22.79372 0.5833 0 53 1994 2.657974 0.22050 0 117 967 12.099276 0.11370 0 147 384 38.28125 0.3856 0 264 1351 19.54108 0.1827 0 317 2477 12.797739 0.6460 0 127 3673 3.457664 0.2308 0 464 12.56091 0.3088 0 929 25.14889 0.7080 0 473 2744 17.23761 0.6211 0 263 975 26.97436 0.8234 1 128 3586 3.5694367 0.70770 0 1331 3694 36.03140 0.5515 0 1464 26 1.7759563 0.3675 0 14 0.9562842 0.5389 0 35 1351 2.5906736 0.60550 0 42 1351 3.108808 0.3415 0 0 3694 0.000000 0.1831 0 1.86330 0.3063 0 3.16900 0.8380 1 0.5515 0.5468 0 2.03650 0.26830 0 7.62030 0.4460 1 2 216593 NA NA
01001020400 01 001 020400 AL Alabama Autauga County 3 South Region 6 East South Central Division 4840 1957 1839 501 4840 10.35124 0.2177 0 101 2129 4.744011 0.2447 0 310 1549 20.01291 0.17080 0 89 290 30.68966 0.2044 0 399 1839 21.69657 0.10540 0 274 3280 8.353658 0.3205 0 399 4293 9.294200 0.3171 0 955 19.731405 0.8643 1 1195 24.69008 0.5530 0 625 3328 18.78005 0.7233 0 152 1374 11.062591 0.34710 0 10 4537 0.2204100 0.22560 0 297 4840 6.136364 0.1647 0 1957 33 1.6862545 0.3843 0 25 1.2774655 0.5516 0 14 1839 0.7612833 0.3564 0 19 1839 1.033170 0.1127 0 0 4840 0 0.364 0 1.20540 0.13470 0 2.71330 0.6129 1 0.1647 0.1632 0 1.7690 0.1591 0 5.85240 0.1954 1 3539 1741 1636 503 3539 14.21305 0.3472 0 39 1658 2.352232 0.17990 0 219 1290 16.976744 0.30880 0 74 346 21.38728 0.1037 0 293 1636 17.90954 0.1333 0 173 2775 6.234234 0.3351 0 169 3529 4.788892 0.3448 0 969 27.38062 0.9225 1 510 14.41085 0.1208 0 670 3019 22.19278 0.8194 1 148 1137 13.01671 0.4541 0 89 3409 2.6107363 0.64690 0 454 3539 12.82848 0.2364 0 1741 143 8.2136703 0.6028 0 0 0.0000000 0.2186 0 10 1636 0.6112469 0.28340 0 72 1636 4.400978 0.4538 0 0 3539 0.000000 0.1831 0 1.34030 0.1575 0 2.96370 0.7496 2 0.2364 0.2344 0 1.74170 0.16270 0 6.28210 0.2389 2 NA NA NA NA
01001020500 01 001 020500 AL Alabama Autauga County 3 South Region 6 East South Central Division 9938 3969 3741 1096 9938 11.02838 0.2364 0 188 4937 3.807981 0.1577 0 426 2406 17.70574 0.11050 0 528 1335 39.55056 0.3753 0 954 3741 25.50120 0.20140 0 293 5983 4.897209 0.1655 0 740 10110 7.319486 0.2211 0 837 8.422218 0.2408 0 3012 30.30791 0.8455 1 759 7155 10.60797 0.2668 0 476 2529 18.821669 0.63540 0 78 9297 0.8389803 0.41110 0 1970 9938 19.822902 0.4330 0 3969 306 7.7097506 0.6153 0 0 0.0000000 0.2198 0 7 3741 0.1871157 0.2535 0 223 3741 5.960973 0.5483 0 0 9938 0 0.364 0 0.98210 0.08468 0 2.39960 0.4381 1 0.4330 0.4290 0 2.0009 0.2430 0 5.81560 0.1905 1 10674 4504 4424 1626 10509 15.47245 0.3851 0 81 5048 1.604596 0.09431 0 321 2299 13.962592 0.17970 0 711 2125 33.45882 0.2836 0 1032 4424 23.32731 0.3109 0 531 6816 7.790493 0.4251 0 301 10046 2.996217 0.1894 0 1613 15.11149 0.4553 0 2765 25.90407 0.7494 0 1124 7281 15.43744 0.5253 0 342 2912 11.74451 0.4019 0 52 9920 0.5241935 0.35230 0 2603 10674 24.38636 0.4160 0 4504 703 15.6083481 0.7378 0 29 0.6438721 0.5037 0 37 4424 0.8363472 0.33420 0 207 4424 4.679023 0.4754 0 176 10674 1.648866 0.7598 1 1.40481 0.1743 0 2.48420 0.4802 0 0.4160 0.4125 0 2.81090 0.63730 1 7.11591 0.3654 1 5 2250459 NA NA
01001020600 01 001 020600 AL Alabama Autauga County 3 South Region 6 East South Central Division 3402 1456 1308 735 3402 21.60494 0.5199 0 134 1720 7.790698 0.5436 0 242 1032 23.44961 0.28010 0 62 276 22.46377 0.1035 0 304 1308 23.24159 0.14070 0 301 2151 13.993491 0.5510 0 355 3445 10.304790 0.3656 0 386 11.346267 0.4232 0 931 27.36626 0.7200 0 440 2439 18.04018 0.6912 0 143 924 15.476190 0.52900 0 4 3254 0.1229256 0.19840 0 723 3402 21.252205 0.4519 0 1456 18 1.2362637 0.3507 0 433 29.7390110 0.9468 1 16 1308 1.2232416 0.4493 0 28 1308 2.140673 0.2298 0 0 3402 0 0.364 0 2.12080 0.39510 0 2.56180 0.5288 0 0.4519 0.4477 0 2.3406 0.4048 1 7.47510 0.4314 1 3536 1464 1330 1279 3523 36.30429 0.8215 1 34 1223 2.780049 0.23780 0 321 1111 28.892889 0.75870 1 67 219 30.59361 0.2305 0 388 1330 29.17293 0.5075 0 306 2380 12.857143 0.6480 0 415 3496 11.870709 0.7535 1 547 15.46946 0.4760 0 982 27.77149 0.8327 1 729 2514 28.99761 0.9488 1 95 880 10.79545 0.3601 0 0 3394 0.0000000 0.09479 0 985 3536 27.85633 0.4608 0 1464 0 0.0000000 0.1079 0 364 24.8633880 0.9300 1 0 1330 0.0000000 0.09796 0 17 1330 1.278196 0.1463 0 0 3536 0.000000 0.1831 0 2.96830 0.6434 2 2.71239 0.6156 2 0.4608 0.4569 0 1.46526 0.08976 1 7.60675 0.4440 5 NA NA NA NA

Now we need to check our data set to see if there are any 0 counts for our pre10 LIHTC projects. We can see there are none and only NA values:

Code
# Check for 0 counts:
svi_divisional_lihtc20  %>% filter(pre10_lihtc_project_cnt == 0)
# A tibble: 0 × 225
# ℹ 225 variables: GEOID_2010_trt <chr>, FIPS_st <chr>, FIPS_county <chr>,
#   FIPS_tract <chr>, state <chr>, state_name <chr>, county <chr>,
#   region_number <dbl>, region <chr>, division_number <dbl>, division <chr>,
#   E_TOTPOP_10 <dbl>, E_HU_10 <dbl>, E_HH_10 <dbl>, E_POV150_10 <dbl>,
#   ET_POVSTATUS_10 <dbl>, EP_POV150_10 <dbl>, EPL_POV150_10 <dbl>,
#   F_POV150_10 <dbl>, E_UNEMP_10 <dbl>, ET_EMPSTATUS_10 <dbl>,
#   EP_UNEMP_10 <dbl>, EPL_UNEMP_10 <dbl>, F_UNEMP_10 <dbl>, …
Code
# Check for null counts:
svi_divisional_lihtc20  %>% filter(is.na(pre10_lihtc_project_cnt)) %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars
34001000100 34 001 000100 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2907 1088 983 1127 2907 38.76849 0.8482 1 144 1433 10.048849 0.7544 1 280 435 64.36782 0.9529 1 204 548 37.22628 0.2998 0 484 983 49.23703 0.7813 1 468 1759 26.60603 0.8634 1 532 2543 20.92017 0.8978 1 250 8.599931 0.1777 0 944 32.47334 0.94170 1 186 1851 10.04862 0.2706 0 266 678 39.233038 0.8981 1 177 2611 6.779012 0.7778 1 1928 2907 66.32267 0.7743 1 1088 113 10.386029 0.6229 0 9 0.8272059 0.7223 0 80 983 8.138352 0.8657 1 265 983 26.95829 0.7354 0 0 2907 0.000000 0.3512 0 4.1451 0.8935 5 3.06590 0.7944 3 0.7743 0.7667 1 3.2975 0.8414 1 11.28280 0.8862 10 2157 941 784 1182 2157 54.79833 0.9571 1 242 1058 22.873346 0.9922 1 215 342 62.86550 0.9780 1 316 442 71.49321 0.9481 1 531 784 67.72959 0.9893 1 396 1274 31.08320 0.9497 1 266 2157 12.33194 0.9041 1 185 8.576727 0.09430 0 552 25.59110 0.8128 1 297 1605 18.504673 0.74880 0 83 510 16.27451 0.6090 0 251 2020 12.42574 0.8710 1 1852 2157 85.85999 0.8476 1 941 118 12.5398512 0.6385 0 0 0.0000000 0.3216 0 67 784 8.545918 0.8657 1 212 784 27.04082 0.7502 1 0 2157 0.0000000 0.1517 0 4.7924 0.9850 5 3.13590 0.8217 2 0.8476 0.8400 1 2.7277 0.6085 2 11.50360 0.9104 10 NA NA NA NA
34001000200 34 001 000200 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3189 2217 1473 519 3189 16.27469 0.4806 0 109 1558 6.996149 0.5179 0 573 955 60.00000 0.9323 1 199 518 38.41699 0.3261 0 772 1473 52.41005 0.8418 1 405 2579 15.70376 0.6491 0 484 3547 13.64533 0.7154 0 847 26.560050 0.9629 1 436 13.67200 0.08181 0 608 3005 20.23295 0.8466 1 42 857 4.900817 0.1204 0 422 3072 13.736979 0.8799 1 1792 3189 56.19316 0.7390 0 2217 901 40.640505 0.8693 1 0 0.0000000 0.3251 0 48 1473 3.258656 0.7064 0 250 1473 16.97217 0.6444 0 0 3189 0.000000 0.3512 0 3.2048 0.6963 1 2.89161 0.7231 3 0.7390 0.7317 0 2.8964 0.6887 1 9.73181 0.7340 5 3510 2046 1353 1021 3510 29.08832 0.7682 1 121 1852 6.533477 0.6717 0 343 696 49.28161 0.9273 1 416 657 63.31811 0.8696 1 759 1353 56.09756 0.9321 1 553 2338 23.65269 0.8871 1 354 3510 10.08547 0.8530 1 643 18.319088 0.60310 0 1002 28.54701 0.9055 1 450 2508 17.942584 0.72330 0 237 786 30.15267 0.8539 1 534 3375 15.82222 0.9062 1 2534 3510 72.19373 0.7818 1 2046 906 44.2815249 0.8690 1 0 0.0000000 0.3216 0 119 1353 8.795270 0.8711 1 324 1353 23.94678 0.7255 0 0 3510 0.0000000 0.1517 0 4.1121 0.9003 4 3.99200 0.9781 3 0.7818 0.7747 1 2.9389 0.7011 2 11.82480 0.9310 10 NA NA NA NA
34001000300 34 001 000300 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3997 1823 1357 1401 3968 35.30746 0.8164 1 382 2238 17.068811 0.9376 1 176 329 53.49544 0.8855 1 604 1028 58.75486 0.7947 1 780 1357 57.47973 0.9165 1 920 2677 34.36683 0.9346 1 1351 4149 32.56206 0.9811 1 314 7.855892 0.1437 0 937 23.44258 0.55900 0 319 3054 10.44532 0.3000 0 187 782 23.913044 0.7498 0 1080 3671 29.419777 0.9742 1 3357 3997 83.98799 0.8419 1 1823 363 19.912233 0.7535 1 0 0.0000000 0.3251 0 150 1357 11.053795 0.9136 1 651 1357 47.97347 0.8585 1 0 3997 0.000000 0.3512 0 4.5862 0.9691 5 2.72670 0.6360 1 0.8419 0.8336 1 3.2019 0.8054 3 11.35670 0.8920 10 3801 1640 1226 1857 3801 48.85556 0.9333 1 226 1800 12.555556 0.9267 1 111 280 39.64286 0.8339 1 608 946 64.27061 0.8842 1 719 1226 58.64600 0.9528 1 650 2275 28.57143 0.9337 1 1027 3801 27.01921 0.9914 1 380 9.997369 0.14040 0 1223 32.17574 0.9607 1 219 2578 8.494957 0.15680 0 268 909 29.48295 0.8456 1 940 3400 27.64706 0.9728 1 3318 3801 87.29282 0.8579 1 1640 262 15.9756098 0.6917 0 0 0.0000000 0.3216 0 124 1226 10.114192 0.8955 1 477 1226 38.90701 0.8258 1 0 3801 0.0000000 0.1517 0 4.7379 0.9829 5 3.07630 0.8013 3 0.8579 0.8501 1 2.8863 0.6781 2 11.55840 0.9150 11 NA NA NA NA
34001000400 34 001 000400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 2902 2683 1401 1172 2902 40.38594 0.8615 1 190 1389 13.678906 0.8811 1 364 707 51.48515 0.8627 1 507 694 73.05476 0.9503 1 871 1401 62.16988 0.9572 1 481 1981 24.28067 0.8339 1 674 3204 21.03620 0.8998 1 434 14.955203 0.6083 0 596 20.53756 0.33980 0 426 2607 16.34062 0.6886 0 111 652 17.024540 0.6204 0 215 2736 7.858187 0.8008 1 1792 2902 61.75052 0.7584 1 2683 2049 76.369735 0.9401 1 0 0.0000000 0.3251 0 69 1401 4.925053 0.7847 1 511 1401 36.47395 0.7992 1 72 2902 2.481048 0.8114 1 4.4335 0.9468 5 3.05790 0.7908 1 0.7584 0.7510 1 3.6605 0.9391 4 11.91030 0.9339 11 3178 2264 1390 1508 3176 47.48111 0.9246 1 172 1804 9.534368 0.8460 1 205 468 43.80342 0.8858 1 622 922 67.46204 0.9192 1 827 1390 59.49640 0.9587 1 364 2076 17.53372 0.8013 1 476 3178 14.97797 0.9390 1 483 15.198238 0.41220 0 539 16.96035 0.2484 0 319 2639 12.087912 0.38790 0 101 565 17.87611 0.6539 0 583 3022 19.29186 0.9349 1 2186 3178 68.78540 0.7658 1 2264 1609 71.0689046 0.9266 1 15 0.6625442 0.7078 0 226 1390 16.258993 0.9567 1 599 1390 43.09353 0.8474 1 20 3178 0.6293266 0.6292 0 4.4696 0.9558 5 2.63730 0.5864 1 0.7658 0.7588 1 4.0677 0.9762 3 11.94040 0.9387 10 NA NA NA NA
34001000500 34 001 000500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3483 1241 1027 1938 3483 55.64169 0.9533 1 124 1630 7.607362 0.5830 0 227 446 50.89686 0.8549 1 478 581 82.27194 0.9799 1 705 1027 68.64654 0.9863 1 733 2077 35.29129 0.9396 1 727 3258 22.31430 0.9149 1 377 10.824002 0.3081 0 1055 30.28998 0.90140 1 268 2401 11.16202 0.3549 0 209 763 27.391874 0.7940 1 911 3077 29.606760 0.9746 1 3036 3483 87.16624 0.8550 1 1241 52 4.190169 0.4505 0 4 0.3223207 0.6567 0 113 1027 11.002921 0.9128 1 422 1027 41.09056 0.8250 1 0 3483 0.000000 0.3512 0 4.3771 0.9379 4 3.33300 0.8766 3 0.8550 0.8467 1 3.1962 0.8026 2 11.76130 0.9229 10 3385 1185 945 1682 3364 50.00000 0.9391 1 72 1577 4.565631 0.4586 0 185 468 39.52991 0.8332 1 362 477 75.89099 0.9703 1 547 945 57.88360 0.9477 1 592 1983 29.85376 0.9422 1 738 3385 21.80207 0.9817 1 240 7.090103 0.05988 0 1129 33.35303 0.9689 1 135 2256 5.984043 0.04817 0 110 717 15.34170 0.5822 0 721 3076 23.43953 0.9569 1 3029 3385 89.48301 0.8727 1 1185 9 0.7594937 0.2382 0 0 0.0000000 0.3216 0 103 945 10.899471 0.9072 1 263 945 27.83069 0.7560 1 0 3385 0.0000000 0.1517 0 4.2693 0.9283 4 2.61605 0.5709 2 0.8727 0.8648 1 2.3747 0.4357 2 10.13275 0.7921 9 NA NA NA NA
Code
# Check for 0 counts:
svi_national_lihtc20  %>% filter(pre10_lihtc_project_cnt == 0)
# A tibble: 0 × 225
# ℹ 225 variables: GEOID_2010_trt <chr>, FIPS_st <chr>, FIPS_county <chr>,
#   FIPS_tract <chr>, state <chr>, state_name <chr>, county <chr>,
#   region_number <dbl>, region <chr>, division_number <dbl>, division <chr>,
#   E_TOTPOP_10 <dbl>, E_HU_10 <dbl>, E_HH_10 <dbl>, E_POV150_10 <dbl>,
#   ET_POVSTATUS_10 <dbl>, EP_POV150_10 <dbl>, EPL_POV150_10 <dbl>,
#   F_POV150_10 <dbl>, E_UNEMP_10 <dbl>, ET_EMPSTATUS_10 <dbl>,
#   EP_UNEMP_10 <dbl>, EPL_UNEMP_10 <dbl>, F_UNEMP_10 <dbl>, …
Code
# Check for null counts:
svi_national_lihtc20  %>% filter(is.na(pre10_lihtc_project_cnt)) %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars
01001020100 01 001 020100 AL Alabama Autauga County 3 South Region 6 East South Central Division 1809 771 696 297 1809 16.41791 0.3871 0 36 889 4.049494 0.17900 0 127 598 21.23746 0.20770 0 47 98 47.95918 0.5767 0 174 696 25.00000 0.18790 0 196 1242 15.780998 0.6093 0 186 1759 10.57419 0.3790 0 222 12.27197 0.4876 0 445 24.59923 0.5473 0 298 1335 22.32210 0.8454 1 27 545 4.954128 0.09275 0 36 1705 2.1114370 0.59040 0 385 1809 21.282477 0.4524 0 771 0 0.0000000 0.1224 0 92 11.932555 0.8005 1 0 696 0.0000000 0.1238 0 50 696 7.183908 0.6134 0 0 1809 0 0.364 0 1.74230 0.2820 0 2.56345 0.5296 1 0.4524 0.4482 0 2.0241 0.2519 1 6.78225 0.3278 2 1941 710 693 352 1941 18.13498 0.4630 0 18 852 2.112676 0.1507 0 81 507 15.976331 0.26320 0 63 186 33.87097 0.2913 0 144 693 20.77922 0.2230 0 187 1309 14.285714 0.6928 0 187 1941 9.634209 0.6617 0 295 15.198351 0.4601 0 415 21.38073 0.4681 0 391 1526 25.62254 0.9011 1 58 555 10.45045 0.3451 0 0 1843 0.000000 0.09479 0 437 1941 22.51417 0.3902 0 710 0 0.0000000 0.1079 0 88 12.3943662 0.8263 1 0 693 0.0000000 0.09796 0 10 693 1.443001 0.1643 0 0 1941 0.000000 0.1831 0 2.1912 0.4084 0 2.26919 0.3503 1 0.3902 0.3869 0 1.37956 0.07216 1 6.23015 0.2314 2 NA NA NA NA
01001020200 01 001 020200 AL Alabama Autauga County 3 South Region 6 East South Central Division 2020 816 730 495 1992 24.84940 0.5954 0 68 834 8.153477 0.57540 0 49 439 11.16173 0.02067 0 105 291 36.08247 0.3019 0 154 730 21.09589 0.09312 0 339 1265 26.798419 0.8392 1 313 2012 15.55666 0.6000 0 204 10.09901 0.3419 0 597 29.55446 0.8192 1 359 1515 23.69637 0.8791 1 132 456 28.947368 0.83510 1 15 1890 0.7936508 0.40130 0 1243 2020 61.534653 0.7781 1 816 0 0.0000000 0.1224 0 34 4.166667 0.6664 0 13 730 1.7808219 0.5406 0 115 730 15.753425 0.8382 1 0 2020 0 0.364 0 2.70312 0.5665 1 3.27660 0.8614 3 0.7781 0.7709 1 2.5316 0.5047 1 9.28942 0.6832 6 1757 720 573 384 1511 25.41363 0.6427 0 29 717 4.044630 0.4132 0 33 392 8.418367 0.03542 0 116 181 64.08840 0.9086 1 149 573 26.00349 0.4041 0 139 1313 10.586443 0.5601 0 91 1533 5.936073 0.4343 0 284 16.163916 0.5169 0 325 18.49744 0.2851 0 164 1208 13.57616 0.4127 0 42 359 11.69916 0.3998 0 0 1651 0.000000 0.09479 0 1116 1757 63.51736 0.7591 1 720 3 0.4166667 0.2470 0 5 0.6944444 0.5106 0 9 573 1.5706806 0.46880 0 57 573 9.947644 0.7317 0 212 1757 12.066022 0.9549 1 2.4544 0.4888 0 1.70929 0.1025 0 0.7591 0.7527 1 2.91300 0.68620 1 7.83579 0.4802 2 NA NA NA NA
01001020400 01 001 020400 AL Alabama Autauga County 3 South Region 6 East South Central Division 4840 1957 1839 501 4840 10.35124 0.2177 0 101 2129 4.744011 0.24470 0 310 1549 20.01291 0.17080 0 89 290 30.68966 0.2044 0 399 1839 21.69657 0.10540 0 274 3280 8.353658 0.3205 0 399 4293 9.29420 0.3171 0 955 19.73140 0.8643 1 1195 24.69008 0.5530 0 625 3328 18.78005 0.7233 0 152 1374 11.062591 0.34710 0 10 4537 0.2204100 0.22560 0 297 4840 6.136364 0.1647 0 1957 33 1.6862545 0.3843 0 25 1.277465 0.5516 0 14 1839 0.7612833 0.3564 0 19 1839 1.033170 0.1127 0 0 4840 0 0.364 0 1.20540 0.1347 0 2.71330 0.6129 1 0.1647 0.1632 0 1.7690 0.1591 0 5.85240 0.1954 1 3539 1741 1636 503 3539 14.21305 0.3472 0 39 1658 2.352232 0.1799 0 219 1290 16.976744 0.30880 0 74 346 21.38728 0.1037 0 293 1636 17.90954 0.1333 0 173 2775 6.234234 0.3351 0 169 3529 4.788892 0.3448 0 969 27.380616 0.9225 1 510 14.41085 0.1208 0 670 3019 22.19278 0.8194 1 148 1137 13.01671 0.4541 0 89 3409 2.610736 0.64690 0 454 3539 12.82848 0.2364 0 1741 143 8.2136703 0.6028 0 0 0.0000000 0.2186 0 10 1636 0.6112469 0.28340 0 72 1636 4.400978 0.4538 0 0 3539 0.000000 0.1831 0 1.3403 0.1575 0 2.96370 0.7496 2 0.2364 0.2344 0 1.74170 0.16270 0 6.28210 0.2389 2 NA NA NA NA
01001020600 01 001 020600 AL Alabama Autauga County 3 South Region 6 East South Central Division 3402 1456 1308 735 3402 21.60494 0.5199 0 134 1720 7.790698 0.54360 0 242 1032 23.44961 0.28010 0 62 276 22.46377 0.1035 0 304 1308 23.24159 0.14070 0 301 2151 13.993491 0.5510 0 355 3445 10.30479 0.3656 0 386 11.34627 0.4232 0 931 27.36626 0.7200 0 440 2439 18.04018 0.6912 0 143 924 15.476190 0.52900 0 4 3254 0.1229256 0.19840 0 723 3402 21.252205 0.4519 0 1456 18 1.2362637 0.3507 0 433 29.739011 0.9468 1 16 1308 1.2232416 0.4493 0 28 1308 2.140673 0.2298 0 0 3402 0 0.364 0 2.12080 0.3951 0 2.56180 0.5288 0 0.4519 0.4477 0 2.3406 0.4048 1 7.47510 0.4314 1 3536 1464 1330 1279 3523 36.30429 0.8215 1 34 1223 2.780049 0.2378 0 321 1111 28.892889 0.75870 1 67 219 30.59361 0.2305 0 388 1330 29.17293 0.5075 0 306 2380 12.857143 0.6480 0 415 3496 11.870709 0.7535 1 547 15.469457 0.4760 0 982 27.77149 0.8327 1 729 2514 28.99761 0.9488 1 95 880 10.79545 0.3601 0 0 3394 0.000000 0.09479 0 985 3536 27.85633 0.4608 0 1464 0 0.0000000 0.1079 0 364 24.8633880 0.9300 1 0 1330 0.0000000 0.09796 0 17 1330 1.278196 0.1463 0 0 3536 0.000000 0.1831 0 2.9683 0.6434 2 2.71239 0.6156 2 0.4608 0.4569 0 1.46526 0.08976 1 7.60675 0.4440 5 NA NA NA NA
01001020700 01 001 020700 AL Alabama Autauga County 3 South Region 6 East South Central Division 2664 1254 1139 710 2664 26.65165 0.6328 0 29 1310 2.213741 0.05255 0 134 710 18.87324 0.13890 0 187 429 43.58974 0.4709 0 321 1139 28.18262 0.28130 0 396 1852 21.382289 0.7478 0 345 2878 11.98749 0.4459 0 389 14.60210 0.6417 0 599 22.48499 0.4007 0 510 2168 23.52399 0.8752 1 228 712 32.022472 0.87120 1 0 2480 0.0000000 0.09298 0 694 2664 26.051051 0.5138 0 1254 8 0.6379585 0.2931 0 460 36.682616 0.9714 1 0 1139 0.0000000 0.1238 0 125 1139 10.974539 0.7477 0 0 2664 0 0.364 0 2.16035 0.4069 0 2.88178 0.6997 2 0.5138 0.5090 0 2.5000 0.4882 1 8.05593 0.5185 3 3562 1313 1248 1370 3528 38.83220 0.8512 1 128 1562 8.194622 0.7935 1 168 844 19.905213 0.44510 0 237 404 58.66337 0.8359 1 405 1248 32.45192 0.6042 0 396 2211 17.910448 0.7857 1 444 3547 12.517620 0.7758 1 355 9.966311 0.1800 0 954 26.78271 0.7923 1 629 2593 24.25762 0.8730 1 171 797 21.45546 0.7186 0 0 3211 0.000000 0.09479 0 1009 3562 28.32678 0.4668 0 1313 14 1.0662605 0.3165 0 443 33.7395278 0.9663 1 73 1248 5.8493590 0.82110 1 17 1248 1.362180 0.1554 0 112 3562 3.144301 0.8514 1 3.8104 0.8569 4 2.65869 0.5847 2 0.4668 0.4629 0 3.11070 0.77140 3 10.04659 0.7851 9 NA NA NA NA

We can now filter our data set to only keep the census tracts that have a null (NA) for pre10 projects, indicating there were no projects in the tract. We also only want to keep tracts with a project after 2010:

Code
svi_divisional_lihtc20 <- svi_divisional_lihtc20 %>% 
  filter(is.na(pre10_lihtc_project_cnt)) %>% 
  filter(post10_lihtc_project_cnt >= 1) %>% 
  select(GEOID_2010_trt, pre10_lihtc_project_cnt, pre10_lihtc_project_dollars, post10_lihtc_project_cnt, post10_lihtc_project_dollars)

# View data
svi_divisional_lihtc20 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars
34001001500 NA NA 1 1497998
34001010600 NA NA 1 1369830
34001011803 NA NA 1 0
34003002200 NA NA 1 0
34003007001 NA NA 1 601714
34003013001 NA NA 1 307351
Code
svi_national_lihtc20 <- svi_national_lihtc20 %>% 
  filter(is.na(pre10_lihtc_project_cnt)) %>% 
  filter(post10_lihtc_project_cnt >= 1) %>% 
  select(GEOID_2010_trt, pre10_lihtc_project_cnt, pre10_lihtc_project_dollars, post10_lihtc_project_cnt, post10_lihtc_project_dollars)

# View data
svi_national_lihtc20 %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars
01003010500 NA NA 1 481325
01003011601 NA NA 1 887856
01017954600 NA NA 2 950192
01021060101 NA NA 1 812048
01039962600 NA NA 1 434742
01043964900 NA NA 1 1046201

Now we need to create our final data set:

Code
# Filter SVI divisional data to remove all tracts that had a project in 2010 or before:
svi_divisional_lihtc <-  svi_divisional %>% 
  filter(! GEOID_2010_trt %in% lihtc_projects10$fips2010)

# Merge SVI divisional data with post 2010 project data, create flag for projects (1 for tracts that have LIHTC project, 0 for those that do not):
svi_divisional_lihtc <- left_join(svi_divisional_lihtc, 
                                  svi_divisional_lihtc20, 
                                  join_by("GEOID_2010_trt" == "GEOID_2010_trt")) %>% 
                        mutate(pre10_lihtc_project_cnt = replace_na(pre10_lihtc_project_cnt, 0),
                               post10_lihtc_project_cnt = replace_na(post10_lihtc_project_cnt, 0),
                               pre10_lihtc_project_dollars = replace_na(pre10_lihtc_project_dollars, 0),
                               post10_lihtc_project_dollars = replace_na(post10_lihtc_project_dollars, 0),
                               lihtc_flag = if_else(post10_lihtc_project_cnt >= 1, 1, 0))

# Finally, we want to filter our dataset to only have tracts that are eligible for the LIHTC program and that have SVI data:
svi_divisional_lihtc <- left_join(svi_divisional_lihtc, lihtc_eligible_flag, 
                                  join_by("GEOID_2010_trt" == "GEOID10")) %>%
                        filter(tolower(lihtc_eligibility) == "yes") %>%
                        filter(!is.na(F_TOTAL_10)) %>% 
                        filter(!is.na(F_TOTAL_20)) 


# View data
svi_divisional_lihtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars lihtc_flag lihtc_eligibility
34001001400 34 001 001400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3736 1893 1503 2135 3736 57.14668 0.9592 1 411 1635 25.137615 0.9866 1 267 401 66.58354 0.9617 1 715 1102 64.88203 0.8844 1 982 1503 65.33599 0.9764 1 511 1696 30.129717 0.90050 1 527 4199 12.5506073 0.672800 0 269 7.200214 0.115100 0 1598 42.77302 0.9935 1 345 2252 15.319716 0.63090 0 787 941 83.63443 0.9990 1 63 3192 1.973684 0.54480 0 3463 3736 92.69272 0.8905 1 1893 427 22.556788 0.7770 1 0 0.000000 0.3251 0 22 1503 1.463739 0.5339 0 705 1503 46.90619 0.85330 1 0 3736 0.000000 0.3512 0 4.495500 0.9585 4 3.283300 0.8640 2 0.8905 0.8818 1 2.84050 0.66710 2 11.509800 0.9048 9 3812 1724 1549 2291 3754 61.028236 0.9760 1 380 1547 24.563672 0.9934 1 117 240 48.75000 0.9237 1 753 1309 57.52483 0.7816 1 870 1549 56.16527 0.9326 1 472 1913 24.673288 0.8987 1 294 3802 7.7327722 0.7558 1 363 9.52256 0.123100 0 1463 38.37880 0.9885 1 508 2339.000 21.718683 0.85640 1 564 948.000 59.49367 0.9910 1 201 3159 6.3627730 0.7613 1 3389 3812.000 88.90346 0.8683 1 1724 571 33.1206497 0.8294 1 0 0 0.3216 0 83 1549 5.358296 0.7754 1 661 1549.000 42.672692 0.8448 1 10 3812 0.2623295 0.4739 0 4.5565 0.9673 5 3.720300 0.9522 4 0.8683 0.8605 1 3.2451 0.81590 3 12.390200 0.9595 13 0 0 0 0 0 Yes
34001001500 34 001 001500 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 1074 901 752 656 1074 61.08007 0.9700 1 43 270 15.925926 0.9242 1 30 70 42.85714 0.7276 0 366 682 53.66569 0.6910 0 396 752 52.65957 0.8458 1 266 921 28.881650 0.88860 1 121 1064 11.3721805 0.613100 0 385 35.847300 0.990200 1 129 12.01117 0.0617 0 321 993 32.326284 0.98460 1 62 195 31.79487 0.8408 1 125 1050 11.904762 0.85620 1 965 1074 89.85102 0.8717 1 901 636 70.588235 0.9304 1 0 0.000000 0.3251 0 10 752 1.329787 0.5133 0 626 752 83.24468 0.98880 1 0 1074 0.000000 0.3512 0 4.241700 0.9134 4 3.733500 0.9515 4 0.8717 0.8632 1 3.10880 0.77090 2 11.955700 0.9362 11 1601 976 810 1001 1601 62.523423 0.9797 1 204 563 36.234458 0.9989 1 74 110 67.27273 0.9848 1 224 700 32.00000 0.2097 0 298 810 36.79012 0.6089 0 379 1145 33.100437 0.9610 1 272 1601 16.9893816 0.9572 1 451 28.16989 0.936300 1 251 15.67770 0.1835 0 411 1350.000 30.444444 0.97330 1 196 446.000 43.94619 0.9511 1 220 1532 14.3603133 0.8929 1 1435 1601.000 89.63148 0.8738 1 976 451 46.2090164 0.8742 1 0 0 0.3216 0 24 810 2.962963 0.6412 0 546 810.000 67.407407 0.9401 1 15 1601 0.9369144 0.6832 0 4.5057 0.9617 4 3.937100 0.9752 4 0.8738 0.8659 1 3.4603 0.87740 2 12.776900 0.9705 11 0 0 1 1497998 1 Yes
34001002400 34 001 002400 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 3129 1759 1375 1916 3129 61.23362 0.9705 1 205 1075 19.069767 0.9574 1 28 60 46.66667 0.7987 1 670 1315 50.95057 0.6297 0 698 1375 50.76364 0.8102 1 632 2059 30.694512 0.90660 1 461 2365 19.4926004 0.873700 1 539 17.225951 0.744100 0 850 27.16523 0.7907 1 575 1736 33.122120 0.98650 1 237 594 39.89899 0.9035 1 312 2663 11.716110 0.85490 1 2357 3129 75.32758 0.8038 1 1759 1091 62.023877 0.9176 1 29 1.648664 0.7742 1 57 1375 4.145454 0.7529 1 696 1375 50.61818 0.87140 1 209 3129 6.679450 0.9003 1 4.518400 0.9608 5 4.279700 0.9831 4 0.8038 0.7960 1 4.21640 0.98320 5 13.818300 0.9835 15 2614 1726 1217 1579 2612 60.451761 0.9744 1 290 1171 24.765158 0.9939 1 69 127 54.33071 0.9521 1 538 1090 49.35780 0.5970 0 607 1217 49.87675 0.8624 1 697 1998 34.884885 0.9695 1 551 2614 21.0788064 0.9797 1 516 19.73986 0.679400 0 503 19.24254 0.3999 0 576 2111.000 27.285647 0.95060 1 257 567.000 45.32628 0.9571 1 556 2368 23.4797297 0.9570 1 2029 2614.000 77.62050 0.8058 1 1726 1166 67.5550406 0.9204 1 0 0 0.3216 0 115 1217 9.449466 0.8840 1 673 1217.000 55.299918 0.8978 1 223 2614 8.5309870 0.9307 1 4.7799 0.9845 5 3.944000 0.9756 3 0.8058 0.7985 1 3.9545 0.96510 4 13.484200 0.9845 13 0 0 0 0 0 Yes
34003015400 34 003 015400 NJ New Jersey Bergen County 1 Northeast Region 2 Middle Atlantic Division 5086 2258 2100 1485 5063 29.33044 0.7447 0 195 2873 6.787330 0.4938 0 223 478 46.65272 0.7984 1 876 1622 54.00740 0.6974 0 1099 2100 52.33333 0.8405 1 640 3682 17.381858 0.70160 0 1579 6178 25.5584331 0.949900 1 603 11.856075 0.377400 0 961 18.89501 0.2410 0 534 5000 10.680000 0.31600 0 254 1232 20.61688 0.6975 0 681 4763 14.297712 0.88510 1 3916 5086 76.99567 0.8096 1 2258 1028 45.527015 0.8820 1 0 0.000000 0.3251 0 28 2100 1.333333 0.5139 0 643 2100 30.61905 0.76370 1 57 5086 1.120724 0.7485 0 3.730500 0.8072 2 2.517000 0.5136 1 0.8096 0.8017 1 3.23320 0.81730 2 10.290300 0.7914 6 7543 3570 3054 1638 7543 21.715498 0.6364 0 320 4251 7.527641 0.7462 0 238 752 31.64894 0.6832 0 1211 2302 52.60643 0.6776 0 1449 3054 47.44597 0.8252 1 877 5631 15.574498 0.7611 1 1093 7543 14.4902559 0.9339 1 981 13.00544 0.282700 0 1174 15.56410 0.1785 0 756 6369.000 11.869995 0.37380 0 303 2013.000 15.05216 0.5737 0 970 7103 13.6562016 0.8846 1 5610 7543.000 74.37359 0.7916 1 3570 1871 52.4089636 0.8898 1 0 0 0.3216 0 258 3054 8.447937 0.8637 1 301 3054.000 9.855927 0.5207 0 15 7543 0.1988599 0.4315 0 3.9028 0.8603 3 2.293300 0.3701 1 0.7916 0.7845 1 3.0273 0.73680 2 10.015000 0.7805 7 0 0 0 0 0 Yes
34003018100 34 003 018100 NJ New Jersey Bergen County 1 Northeast Region 2 Middle Atlantic Division 6907 2665 2569 1865 6863 27.17470 0.7140 0 242 3781 6.400423 0.4509 0 434 834 52.03837 0.8694 1 1123 1735 64.72622 0.8830 1 1557 2569 60.60724 0.9450 1 1521 4649 32.716713 0.92270 1 2703 7124 37.9421673 0.992200 1 1024 14.825539 0.598800 0 1336 19.34270 0.2674 0 452 5848 7.729138 0.11920 0 363 1614 22.49071 0.7280 0 1324 6571 20.149140 0.93510 1 4209 6907 60.93818 0.7551 1 2665 517 19.399625 0.7487 0 0 0.000000 0.3251 0 136 2569 5.293889 0.7960 1 1043 2569 40.59945 0.82350 1 0 6907 0.000000 0.3512 0 4.024800 0.8697 3 2.648500 0.5885 1 0.7551 0.7477 1 3.04450 0.74620 2 10.472900 0.8112 7 7668 2912 2816 1803 7664 23.525574 0.6750 0 370 4727 7.827375 0.7646 1 441 819 53.84615 0.9501 1 1122 1997 56.18428 0.7544 1 1563 2816 55.50426 0.9274 1 1879 5775 32.536797 0.9576 1 1695 7668 22.1048513 0.9829 1 1041 13.57590 0.316600 0 1193 15.55816 0.1784 0 711 6474.819 10.981001 0.31250 0 197 1914.175 10.29164 0.3928 0 2045 7161 28.5574640 0.9756 1 5637 7667.630 73.51685 0.7875 1 2912 806 27.6785714 0.7973 1 0 0 0.3216 0 150 2816 5.326704 0.7742 1 833 2816.042 29.580522 0.7679 1 10 7668 0.1304121 0.3642 0 4.3075 0.9336 4 2.175900 0.2971 1 0.7875 0.7803 1 3.0252 0.73590 3 10.296100 0.8061 9 0 0 0 0 0 Yes
34005702101 34 005 702101 NJ New Jersey Burlington County 1 Northeast Region 2 Middle Atlantic Division 1637 702 483 445 1637 27.18387 0.7142 0 63 456 13.815789 0.8857 1 0 0 NaN NA NA 222 483 45.96273 0.5037 0 222 483 45.96273 0.7085 0 31 903 3.433001 0.08742 0 14 1965 0.7124682 0.008765 0 0 0.000000 0.002836 0 696 42.51680 0.9928 1 62 898 6.904232 0.08018 0 103 452 22.78761 0.7331 0 0 1379 0.000000 0.07335 0 248 1637 15.14966 0.4224 0 702 25 3.561254 0.4247 0 0 0.000000 0.3251 0 0 483 0.000000 0.1459 0 0 483 0.00000 0.01044 0 0 1637 0.000000 0.3512 0 2.404585 0.4890 1 1.882266 0.1557 1 0.4224 0.4183 0 1.25734 0.03853 0 5.966591 0.2021 2 3997 1271 1235 304 3996 7.607608 0.1919 0 46 901 5.105438 0.5252 0 0 0 NaN NA NA 731 1235 59.19028 0.8107 1 731 1235 59.19028 0.9566 1 49 1973 2.483528 0.0993 0 27 3057 0.8832188 0.0568 0 0 0.00000 0.001592 0 1651 41.30598 0.9924 1 58 1412.011 4.107616 0.01556 0 91 1092.793 8.32729 0.3046 0 32 3347 0.9560801 0.3989 0 1411 3996.883 35.30251 0.5750 0 1271 10 0.7867821 0.2414 0 0 0 0.3216 0 27 1235 2.186235 0.5699 0 11 1234.974 0.890707 0.0533 0 0 3997 0.0000000 0.1517 0 1.8298 0.3066 1 1.713052 0.1034 1 0.5750 0.5698 0 1.3379 0.06021 0 5.455752 0.1329 2 0 0 0 0 0 Yes
Code
# See total number of rows in data
svi_divisional_lihtc %>% nrow()
[1] 658
Code
# Filter SVI national data to remove all tracts that had a project in 2010 or before:
svi_national_lihtc <-  svi_national %>% 
  filter(! GEOID_2010_trt %in% lihtc_projects10$fips2010)

# Merge SVI national data with post 2010 project data, create flag for projects (1 for tracts that have LIHTC project, 0 for those that do not):
svi_national_lihtc <- left_join(svi_national_lihtc, 
                                  svi_national_lihtc20, 
                                  join_by("GEOID_2010_trt" == "GEOID_2010_trt")) %>% 
                        mutate(pre10_lihtc_project_cnt = replace_na(pre10_lihtc_project_cnt, 0),
                               post10_lihtc_project_cnt = replace_na(post10_lihtc_project_cnt, 0),
                                pre10_lihtc_project_dollars = replace_na(pre10_lihtc_project_dollars, 0),
                               post10_lihtc_project_dollars = replace_na(post10_lihtc_project_dollars, 0),
                               lihtc_flag = if_else(post10_lihtc_project_cnt >= 1, 1, 0))

# Finally, we want to filter our dataset to only have tracts that are eligible for the LIHTC program and that have SVI data:
svi_national_lihtc <- left_join(svi_national_lihtc, lihtc_eligible_flag, 
                                  join_by("GEOID_2010_trt" == "GEOID10")) %>%
                        filter(tolower(lihtc_eligibility) == "yes") %>%
                        filter(!is.na(F_TOTAL_10)) %>% 
                        filter(!is.na(F_TOTAL_20)) 


# View data
svi_national_lihtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
GEOID_2010_trt FIPS_st FIPS_county FIPS_tract state state_name county region_number region division_number division E_TOTPOP_10 E_HU_10 E_HH_10 E_POV150_10 ET_POVSTATUS_10 EP_POV150_10 EPL_POV150_10 F_POV150_10 E_UNEMP_10 ET_EMPSTATUS_10 EP_UNEMP_10 EPL_UNEMP_10 F_UNEMP_10 E_HBURD_OWN_10 ET_HOUSINGCOST_OWN_10 EP_HBURD_OWN_10 EPL_HBURD_OWN_10 F_HBURD_OWN_10 E_HBURD_RENT_10 ET_HOUSINGCOST_RENT_10 EP_HBURD_RENT_10 EPL_HBURD_RENT_10 F_HBURD_RENT_10 E_HBURD_10 ET_HOUSINGCOST_10 EP_HBURD_10 EPL_HBURD_10 F_HBURD_10 E_NOHSDP_10 ET_EDSTATUS_10 EP_NOHSDP_10 EPL_NOHSDP_10 F_NOHSDP_10 E_UNINSUR_12 ET_INSURSTATUS_12 EP_UNINSUR_12 EPL_UNINSUR_12 F_UNINSUR_12 E_AGE65_10 EP_AGE65_10 EPL_AGE65_10 F_AGE65_10 E_AGE17_10 EP_AGE17_10 EPL_AGE17_10 F_AGE17_10 E_DISABL_12 ET_DISABLSTATUS_12 EP_DISABL_12 EPL_DISABL_12 F_DISABL_12 E_SNGPNT_10 ET_FAMILIES_10 EP_SNGPNT_10 EPL_SNGPNT_10 F_SNGPNT_10 E_LIMENG_10 ET_POPAGE5UP_10 EP_LIMENG_10 EPL_LIMENG_10 F_LIMENG_10 E_MINRTY_10 ET_POPETHRACE_10 EP_MINRTY_10 EPL_MINRTY_10 F_MINRTY_10 E_STRHU_10 E_MUNIT_10 EP_MUNIT_10 EPL_MUNIT_10 F_MUNIT_10 E_MOBILE_10 EP_MOBILE_10 EPL_MOBILE_10 F_MOBILE_10 E_CROWD_10 ET_OCCUPANTS_10 EP_CROWD_10 EPL_CROWD_10 F_CROWD_10 E_NOVEH_10 ET_KNOWNVEH_10 EP_NOVEH_10 EPL_NOVEH_10 F_NOVEH_10 E_GROUPQ_10 ET_HHTYPE_10 EP_GROUPQ_10 EPL_GROUPQ_10 F_GROUPQ_10 SPL_THEME1_10 RPL_THEME1_10 F_THEME1_10 SPL_THEME2_10 RPL_THEME2_10 F_THEME2_10 SPL_THEME3_10 RPL_THEME3_10 F_THEME3_10 SPL_THEME4_10 RPL_THEME4_10 F_THEME4_10 SPL_THEMES_10 RPL_THEMES_10 F_TOTAL_10 E_TOTPOP_20 E_HU_20 E_HH_20 E_POV150_20 ET_POVSTATUS_20 EP_POV150_20 EPL_POV150_20 F_POV150_20 E_UNEMP_20 ET_EMPSTATUS_20 EP_UNEMP_20 EPL_UNEMP_20 F_UNEMP_20 E_HBURD_OWN_20 ET_HOUSINGCOST_OWN_20 EP_HBURD_OWN_20 EPL_HBURD_OWN_20 F_HBURD_OWN_20 E_HBURD_RENT_20 ET_HOUSINGCOST_RENT_20 EP_HBURD_RENT_20 EPL_HBURD_RENT_20 F_HBURD_RENT_20 E_HBURD_20 ET_HOUSINGCOST_20 EP_HBURD_20 EPL_HBURD_20 F_HBURD_20 E_NOHSDP_20 ET_EDSTATUS_20 EP_NOHSDP_20 EPL_NOHSDP_20 F_NOHSDP_20 E_UNINSUR_20 ET_INSURSTATUS_20 EP_UNINSUR_20 EPL_UNINSUR_20 F_UNINSUR_20 E_AGE65_20 EP_AGE65_20 EPL_AGE65_20 F_AGE65_20 E_AGE17_20 EP_AGE17_20 EPL_AGE17_20 F_AGE17_20 E_DISABL_20 ET_DISABLSTATUS_20 EP_DISABL_20 EPL_DISABL_20 F_DISABL_20 E_SNGPNT_20 ET_FAMILIES_20 EP_SNGPNT_20 EPL_SNGPNT_20 F_SNGPNT_20 E_LIMENG_20 ET_POPAGE5UP_20 EP_LIMENG_20 EPL_LIMENG_20 F_LIMENG_20 E_MINRTY_20 ET_POPETHRACE_20 EP_MINRTY_20 EPL_MINRTY_20 F_MINRTY_20 E_STRHU_20 E_MUNIT_20 EP_MUNIT_20 EPL_MUNIT_20 F_MUNIT_20 E_MOBILE_20 EP_MOBILE_20 EPL_MOBILE_20 F_MOBILE_20 E_CROWD_20 ET_OCCUPANTS_20 EP_CROWD_20 EPL_CROWD_20 F_CROWD_20 E_NOVEH_20 ET_KNOWNVEH_20 EP_NOVEH_20 EPL_NOVEH_20 F_NOVEH_20 E_GROUPQ_20 ET_HHTYPE_20 EP_GROUPQ_20 EPL_GROUPQ_20 F_GROUPQ_20 SPL_THEME1_20 RPL_THEME1_20 F_THEME1_20 SPL_THEME2_20 RPL_THEME2_20 F_THEME2_20 SPL_THEME3_20 RPL_THEME3_20 F_THEME3_20 SPL_THEME4_20 RPL_THEME4_20 F_THEME4_20 SPL_THEMES_20 RPL_THEMES_20 F_TOTAL_20 pre10_lihtc_project_cnt pre10_lihtc_project_dollars post10_lihtc_project_cnt post10_lihtc_project_dollars lihtc_flag lihtc_eligibility
01005950700 01 005 950700 AL Alabama Barbour County 3 South Region 6 East South Central Division 1753 687 563 615 1628 37.77641 0.8088 1 17 667 2.548726 0.06941 0 41 376 10.90426 0.01945 0 62 187 33.15508 0.2464 0 103 563 18.29485 0.04875 0 264 1208 21.85430 0.7570 1 201 1527 13.163065 0.4991 0 368 20.992584 0.89510 1 462 26.354820 0.66130 0 211 1085 19.44700 0.7505 1 107 399 26.81704 0.8048 1 0 1628 0.000000 0.09298 0 861 1753 49.11580 0.7101 0 687 17 2.474527 0.4324 0 38 5.5312955 0.6970 0 3 563 0.5328597 0.3037 0 19 563 3.374778 0.3529 0 233 1753 13.29150 0.9517 1 2.18306 0.4137 2 3.20468 0.8377 3 0.7101 0.7035 0 2.7377 0.6100 1 8.83554 0.6264 6 1527 691 595 565 1365 41.39194 0.8765 1 37 572 6.468532 0.6776 0 70 376 18.617021 0.38590 0 92 219 42.00913 0.4736 0 162 595 27.22689 0.4454 0 280 1114 25.13465 0.8942 1 105 1378 7.619739 0.5505 0 383 25.081860 0.88450 1 337 22.069417 0.51380 0 237 1041.0000 22.76657 0.8360 1 144 413.0000 34.86683 0.9114 1 11 1466 0.7503411 0.40700 0 711 1527.0000 46.56189 0.6441 0 691 13 1.881331 0.3740 0 37 5.3545586 0.7152 0 0 595 0.0000000 0.09796 0 115 595.0000 19.327731 0.8859 1 149 1527 9.757695 0.9470 1 3.4442 0.7707 2 3.55270 0.9403 3 0.6441 0.6387 0 3.02006 0.7337 2 10.66106 0.8537 7 0 0 0 0 0 Yes
01011952100 01 011 952100 AL Alabama Bullock County 3 South Region 6 East South Central Division 1652 796 554 564 1652 34.14044 0.7613 1 46 816 5.637255 0.33630 0 96 458 20.96070 0.19930 0 62 96 64.58333 0.8917 1 158 554 28.51986 0.29220 0 271 1076 25.18587 0.8163 1 155 1663 9.320505 0.3183 0 199 12.046005 0.47180 0 420 25.423729 0.60240 0 327 1279 25.56685 0.9151 1 137 375 36.53333 0.9108 1 0 1590 0.000000 0.09298 0 1428 1652 86.44068 0.8939 1 796 0 0.000000 0.1224 0 384 48.2412060 0.9897 1 19 554 3.4296029 0.7145 0 45 554 8.122744 0.6556 0 0 1652 0.00000 0.3640 0 2.52440 0.5138 2 2.99308 0.7515 2 0.8939 0.8856 1 2.8462 0.6637 1 9.25758 0.6790 6 1382 748 549 742 1382 53.69030 0.9560 1 40 511 7.827789 0.7730 1 110 402 27.363184 0.71780 0 45 147 30.61224 0.2307 0 155 549 28.23315 0.4773 0 181 905 20.00000 0.8253 1 232 1382 16.787265 0.8813 1 164 11.866860 0.27170 0 250 18.089725 0.26290 0 258 1132.0000 22.79152 0.8368 1 99 279.0000 35.48387 0.9162 1 33 1275 2.5882353 0.64520 0 1347 1382.0000 97.46744 0.9681 1 748 0 0.000000 0.1079 0 375 50.1336898 0.9922 1 0 549 0.0000000 0.09796 0 37 549.0000 6.739526 0.6039 0 0 1382 0.000000 0.1831 0 3.9129 0.8785 4 2.93280 0.7342 2 0.9681 0.9599 1 1.98506 0.2471 1 9.79886 0.7570 8 0 0 0 0 0 Yes
01015000300 01 015 000300 AL Alabama Calhoun County 3 South Region 6 East South Central Division 3074 1635 1330 1904 3067 62.08021 0.9710 1 293 1362 21.512482 0.96630 1 180 513 35.08772 0.65450 0 383 817 46.87882 0.5504 0 563 1330 42.33083 0.70280 0 720 2127 33.85049 0.9148 1 628 2835 22.151675 0.8076 1 380 12.361744 0.49340 0 713 23.194535 0.45030 0 647 2111 30.64898 0.9708 1 298 773 38.55110 0.9247 1 0 2878 0.000000 0.09298 0 2623 3074 85.32856 0.8883 1 1635 148 9.051988 0.6465 0 6 0.3669725 0.4502 0 68 1330 5.1127820 0.8082 1 303 1330 22.781955 0.9029 1 0 3074 0.00000 0.3640 0 4.36250 0.9430 4 2.93218 0.7233 2 0.8883 0.8800 1 3.1718 0.8070 2 11.35478 0.9009 9 2390 1702 1282 1287 2390 53.84937 0.9566 1 102 1066 9.568480 0.8541 1 158 609 25.944171 0.67520 0 286 673 42.49629 0.4856 0 444 1282 34.63339 0.6634 0 467 1685 27.71513 0.9180 1 369 2379 15.510719 0.8562 1 342 14.309623 0.40850 0 548 22.928870 0.57100 0 647 1831.0000 35.33588 0.9862 1 202 576.0000 35.06944 0.9130 1 16 2134 0.7497657 0.40690 0 1896 2390.0000 79.33054 0.8451 1 1702 96 5.640423 0.5329 0 0 0.0000000 0.2186 0 0 1282 0.0000000 0.09796 0 186 1282.0000 14.508580 0.8308 1 43 2390 1.799163 0.7727 1 4.2483 0.9395 4 3.28560 0.8773 2 0.8451 0.8379 1 2.45296 0.4602 2 10.83196 0.8718 9 0 0 0 0 0 Yes
01015000500 01 015 000500 AL Alabama Calhoun County 3 South Region 6 East South Central Division 1731 1175 743 1042 1619 64.36072 0.9767 1 124 472 26.271186 0.98460 1 136 461 29.50108 0.48970 0 163 282 57.80142 0.7919 1 299 743 40.24226 0.64910 0 340 1270 26.77165 0.8389 1 460 1794 25.641026 0.8722 1 271 15.655690 0.70190 0 368 21.259388 0.32190 0 507 1449 34.98965 0.9885 1 150 386 38.86010 0.9269 1 0 1677 0.000000 0.09298 0 1559 1731 90.06355 0.9123 1 1175 50 4.255319 0.5128 0 4 0.3404255 0.4480 0 0 743 0.0000000 0.1238 0 122 743 16.419919 0.8473 1 0 1731 0.00000 0.3640 0 4.32150 0.9362 4 3.03218 0.7679 2 0.9123 0.9038 1 2.2959 0.3818 1 10.56188 0.8244 8 940 907 488 586 940 62.34043 0.9815 1 59 297 19.865320 0.9833 1 100 330 30.303030 0.79220 1 58 158 36.70886 0.3497 0 158 488 32.37705 0.6020 0 199 795 25.03145 0.8930 1 118 940 12.553192 0.7770 1 246 26.170213 0.90530 1 118 12.553192 0.08233 0 383 822.5089 46.56484 0.9984 1 30 197.8892 15.16000 0.5363 0 0 889 0.0000000 0.09479 0 898 940.3866 95.49264 0.9489 1 907 0 0.000000 0.1079 0 2 0.2205072 0.4456 0 2 488 0.4098361 0.23670 0 146 487.6463 29.939736 0.9404 1 0 940 0.000000 0.1831 0 4.2368 0.9379 4 2.61712 0.5593 2 0.9489 0.9409 1 1.91370 0.2196 1 9.71652 0.7468 8 0 0 0 0 0 Yes
01015000600 01 015 000600 AL Alabama Calhoun County 3 South Region 6 East South Central Division 2571 992 796 1394 2133 65.35396 0.9789 1 263 905 29.060773 0.98990 1 121 306 39.54248 0.75940 1 209 490 42.65306 0.4481 0 330 796 41.45729 0.68030 0 641 1556 41.19537 0.9554 1 416 1760 23.636364 0.8383 1 220 8.556982 0.24910 0 584 22.714897 0.41610 0 539 1353 39.83740 0.9955 1 243 466 52.14592 0.9783 1 30 2366 1.267963 0.48990 0 1944 2571 75.61260 0.8440 1 992 164 16.532258 0.7673 1 8 0.8064516 0.5110 0 46 796 5.7788945 0.8329 1 184 796 23.115578 0.9049 1 614 2571 23.88176 0.9734 1 4.44280 0.9548 4 3.12890 0.8088 2 0.8440 0.8362 1 3.9895 0.9792 4 12.40520 0.9696 11 1950 964 719 837 1621 51.63479 0.9467 1 157 652 24.079755 0.9922 1 22 364 6.043956 0.01547 0 129 355 36.33803 0.3420 0 151 719 21.00139 0.2303 0 363 1387 26.17159 0.9048 1 351 1613 21.760694 0.9435 1 249 12.769231 0.32090 0 356 18.256410 0.27140 0 332 1259.7041 26.35540 0.9135 1 136 435.6156 31.22018 0.8775 1 0 1891 0.0000000 0.09479 0 1463 1949.9821 75.02633 0.8219 1 964 14 1.452282 0.3459 0 8 0.8298755 0.5269 0 19 719 2.6425591 0.61120 0 197 719.0542 27.397100 0.9316 1 329 1950 16.871795 0.9655 1 4.0175 0.9001 4 2.47809 0.4764 2 0.8219 0.8149 1 3.38110 0.8712 2 10.69859 0.8583 9 0 0 0 0 0 Yes
01015002101 01 015 002101 AL Alabama Calhoun County 3 South Region 6 East South Central Division 3872 1454 1207 1729 2356 73.38710 0.9916 1 489 2020 24.207921 0.97860 1 20 168 11.90476 0.02541 0 718 1039 69.10491 0.9332 1 738 1207 61.14333 0.96900 1 113 725 15.58621 0.6035 0 664 3943 16.839970 0.6495 0 167 4.313016 0.05978 0 238 6.146694 0.02255 0 264 2359 11.19118 0.3027 0 94 263 35.74144 0.9050 1 46 3769 1.220483 0.48250 0 1601 3872 41.34814 0.6572 0 1454 761 52.338377 0.9504 1 65 4.4704264 0.6738 0 5 1207 0.4142502 0.2791 0 113 1207 9.362055 0.7004 0 1516 3872 39.15289 0.9860 1 4.19220 0.9133 3 1.77253 0.1304 1 0.6572 0.6511 0 3.5897 0.9337 2 10.21163 0.7885 6 3238 1459 1014 1082 1836 58.93246 0.9735 1 251 1403 17.890235 0.9767 1 31 155 20.000000 0.44920 0 515 859 59.95343 0.8554 1 546 1014 53.84615 0.9535 1 134 916 14.62882 0.7033 0 251 3238 7.751699 0.5588 0 167 5.157505 0.03597 0 169 5.219271 0.02111 0 323 1667.0000 19.37612 0.7205 0 94 277.0000 33.93502 0.9040 1 0 3164 0.0000000 0.09479 0 1045 3238.0000 32.27301 0.5125 0 1459 607 41.603838 0.9185 1 65 4.4551062 0.6949 0 24 1014 2.3668639 0.57900 0 85 1014.0000 8.382643 0.6775 0 1402 3238 43.298332 0.9876 1 4.1658 0.9263 3 1.77637 0.1225 1 0.5125 0.5082 0 3.85750 0.9661 2 10.31217 0.8160 6 0 0 0 0 0 Yes
Code
# See total number of rows in data
svi_national_lihtc %>% nrow()
[1] 3723

See how many tracts don’t have an LIHTC project post-2010 out of eligible tracts in our division and nationally:

Code
svi_divisional_lihtc %>% filter(lihtc_flag == 0) %>% nrow()
[1] 571
Code
svi_national_lihtc %>% filter(lihtc_flag == 0) %>% nrow()
[1] 3205

See how many tracts do have an LIHTC project post-2010 out of eligible tracts in our division:

Code
svi_divisional_lihtc %>% filter(lihtc_flag == 1) %>% nrow()
[1] 87
Code
svi_national_lihtc %>% filter(lihtc_flag == 1) %>% nrow()
[1] 518

View SVI DATA distributions:

National

Code
# See distribution of flags for SVI themes in top quarter in 2010
table(svi_national_lihtc$F_TOTAL_10)

  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14 
  1  10  48  92 137 216 297 359 499 608 660 491 225  74   6 
Code
# Average number of flags in 2010
mean(svi_national_lihtc$F_TOTAL_10)
[1] 8.465216
Code
# See distribution of flags for SVI themes in top quarter in 2020
table(svi_national_lihtc$F_TOTAL_20)

  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14 
  8  21  49  92 175 265 364 443 557 626 552 346 181  40   4 
Code
# Average number of flags in 2020
mean(svi_national_lihtc$F_TOTAL_20)
[1] 8.022831

Divisional

Code
# See distribution of flags for SVI themes in top quarter in 2010
table(svi_divisional_lihtc$F_TOTAL_10)

  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 
  1   8   9  14  34  40  45  72  82  99 101  83  47  19   2   2 
Code
# Average number of flags in 2010
mean(svi_divisional_lihtc$F_TOTAL_10)
[1] 8.384498
Code
# See distribution of flags for SVI themes in top quarter in 2020
table(svi_divisional_lihtc$F_TOTAL_20)

 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 
 2  2 14 19 32 44 49 74 90 89 99 75 45 21  2  1 
Code
# Average number of flags in 2020
mean(svi_divisional_lihtc$F_TOTAL_20)
[1] 8.265957

County-Level SVI LIHTC Data

Recall that we have data on counties in our data set:

Code
colnames(svi_divisional_lihtc) %>% head(11)
 [1] "GEOID_2010_trt"  "FIPS_st"         "FIPS_county"     "FIPS_tract"     
 [5] "state"           "state_name"      "county"          "region_number"  
 [9] "region"          "division_number" "division"       

Therefore, just as with our NMTC data, we can summarize our project counts up to the county-level for easier visualizations with the following function NOTE: Remember to add all functions to project_data_steps.R :

Code
summarize_county_lihtc <- function(df) {
  # Find count of new NMTC projects after 2010 by county
  county_lihtc_project_cnt <- aggregate(df$post10_lihtc_project_cnt,
                                       by=list(State=df$state,
                                               County=df$county,
                                               Division=df$division), 
                                       FUN=sum) %>% 
                                      arrange(State, County) %>%
                                      rename("post10_lihtc_project_cnt" = "x")
  
  # Find count of census tracts in each county
  county_lihtc_tracts <- aggregate(df$GEOID_2010_trt,
                                  by=list(State=df$state,
                                          County=df$county,
                                          Division=df$division), 
                                  FUN=length) %>% 
                                  mutate(tract_cnt = x) %>% 
                                  select (-x)
  
  # Find sum of NMTC project dollars in each county
  county_lihtc_dollars <- aggregate(df$post10_lihtc_project_dollars,
                                   by=list(State=df$state,
                                           County=df$county,
                                           Division=df$division), 
                                   FUN=sum) %>% 
                                  arrange(State, County) %>%
                                  rename("post10_lihtc_project_dollars" = "x")
  
  # Create character column with NMTC dollars formatted as currency
  county_lihtc_dollars$post10_lihtc_dollars_formatted <-
    scales::dollar_format()(county_lihtc_dollars$post10_lihtc_project_dollars)

  # Join project counts and census tract counts datasets
  county_lihtc0 <- left_join(county_lihtc_project_cnt, county_lihtc_tracts,
                            join_by("State" == "State",
                                    "County" == "County",
                                    "Division" == "Division"))

  # Add dollar amounts
  county_lihtc <- left_join(county_lihtc0, county_lihtc_dollars,
                         join_by("State" == "State",
                                 "County" == "County",
                                 "Division" == "Division"))
  
  # Output data
  return(county_lihtc)
}
Code
svi_national_lihtc_county_sum <- summarize_county_lihtc(svi_national_lihtc)

svi_national_lihtc_county_sum %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted
AK Bethel Census Area Pacific Division 0 2 0 $0
AK Dillingham Census Area Pacific Division 0 1 0 $0
AK Kenai Peninsula Borough Pacific Division 0 1 0 $0
AK Nome Census Area Pacific Division 0 1 0 $0
AK Yukon-Koyukuk Census Area Pacific Division 0 2 0 $0
AL Barbour County East South Central Division 0 1 0 $0
Code
svi_divisional_lihtc_county_sum <- summarize_county_lihtc(svi_divisional_lihtc)
svi_divisional_lihtc_county_sum %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted
NJ Atlantic County Middle Atlantic Division 1 3 1497998 $1,497,998
NJ Bergen County Middle Atlantic Division 0 2 0 $0
NJ Burlington County Middle Atlantic Division 0 2 0 $0
NJ Camden County Middle Atlantic Division 1 6 0 $0
NJ Cape May County Middle Atlantic Division 0 2 0 $0
NJ Cumberland County Middle Atlantic Division 0 1 0 $0

We can then utilize our flag_summarize function from Lab 03 to find our county-level SVI flag calculations:

Code
# Create data frame of LIHTC eligible tracts 2010 nationally
svi_national_lihtc10 <- svi_national_lihtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_10, E_TOTPOP_10) %>% rename("F_TOTAL" = "F_TOTAL_10")

# Count national-level SVI flags for 2010, create unified fips column
svi_2010_national_county_flags_lihtc <- flag_summarize(svi_national_lihtc10, "E_TOTPOP_10") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Add suffix to flag columns 2010
colnames(svi_2010_national_county_flags_lihtc)[11:15] <- paste0(colnames(svi_2010_national_county_flags_lihtc)[11:15], 10)

# Create data frame of LIHTC eligible tracts 2020 nationally
svi_national_lihtc20 <- svi_national_lihtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_20, E_TOTPOP_20) %>% rename("F_TOTAL" = "F_TOTAL_20")

# Count national-level SVI flags for 2020, create unified fips column
svi_2020_national_county_flags_lihtc <- flag_summarize(svi_national_lihtc20, "E_TOTPOP_20") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Identify needed columns for 2020, add suffix
colnames(svi_2020_national_county_flags_lihtc)[11:15] <- paste0(colnames(svi_2020_national_county_flags_lihtc)[11:15], "20")

# Filter to needed columns for 2020 to avoid duplicate column column names
svi_2020_national_county_flags_join_lihtc <- svi_2020_national_county_flags_lihtc %>% ungroup() %>% select("fips_county_st", all_of(colnames(svi_2020_national_county_flags_lihtc)[11:15]))
 
# Join 2010 and 2020 data
svi_national_county_flags_lihtc <- left_join(svi_2010_national_county_flags_lihtc, svi_2020_national_county_flags_join_lihtc, join_by("fips_county_st" == "fips_county_st")) 

svi_national_county_flags_lihtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
fips_county_st FIPS_st FIPS_county state state_name county region_number region division_number division flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20
01005 01 005 AL Alabama Barbour County 3 South Region 6 East South Central Division 6 1753 0.0034227 0.2 0.8 7 1527 0.0045842 0.2 1.0
01011 01 011 AL Alabama Bullock County 3 South Region 6 East South Central Division 6 1652 0.0036320 0.2 0.8 8 1382 0.0057887 0.4 1.0
01015 01 015 AL Alabama Calhoun County 3 South Region 6 East South Central Division 40 15130 0.0026438 0.8 0.6 37 11783 0.0031401 0.8 0.8
01023 01 023 AL Alabama Choctaw County 3 South Region 6 East South Central Division 12 5578 0.0021513 0.6 0.4 15 5412 0.0027716 0.6 0.8
01031 01 031 AL Alabama Coffee County 3 South Region 6 East South Central Division 12 8139 0.0014744 0.6 0.2 13 8517 0.0015264 0.6 0.2
01033 01 033 AL Alabama Colbert County 3 South Region 6 East South Central Division 10 1983 0.0050429 0.4 1.0 8 1931 0.0041429 0.4 1.0

Join flags with LIHTC county project summary data:

Code
svi_national_county_lihtc <- left_join(svi_national_lihtc_county_sum,
                                      svi_national_county_flags_lihtc,
                                    join_by("State" == "state", "County" == "county",
                                            "Division" == "division"))

svi_national_county_lihtc$post10_lihtc_project_cnt[is.na(svi_national_county_lihtc$post10_lihtc_project_cnt)] <- 0

svi_national_county_lihtc$county_name <- paste0(svi_national_county_lihtc$County, ", ", svi_national_county_lihtc$State)

svi_national_county_lihtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name
AK Bethel Census Area Pacific Division 0 2 0 $0 02050 02 050 Alaska 4 West Region 9 18 10867 0.0016564 0.6 0.4 20 11715 0.0017072 0.8 0.4 Bethel Census Area, AK
AK Dillingham Census Area Pacific Division 0 1 0 $0 02070 02 070 Alaska 4 West Region 9 9 2569 0.0035033 0.4 0.8 10 2801 0.0035702 0.4 0.8 Dillingham Census Area, AK
AK Kenai Peninsula Borough Pacific Division 0 1 0 $0 02122 02 122 Alaska 4 West Region 9 7 251 0.0278884 0.2 1.0 8 531 0.0150659 0.4 1.0 Kenai Peninsula Borough, AK
AK Nome Census Area Pacific Division 0 1 0 $0 02180 02 180 Alaska 4 West Region 9 9 5766 0.0015609 0.4 0.2 10 5901 0.0016946 0.4 0.4 Nome Census Area, AK
AK Yukon-Koyukuk Census Area Pacific Division 0 2 0 $0 02290 02 290 Alaska 4 West Region 9 18 2300 0.0078261 0.6 1.0 21 2153 0.0097538 0.8 1.0 Yukon-Koyukuk Census Area, AK
AL Barbour County East South Central Division 0 1 0 $0 01005 01 005 Alabama 3 South Region 6 6 1753 0.0034227 0.2 0.8 7 1527 0.0045842 0.2 1.0 Barbour County, AL
Code
# Create data frame of LIHTC eligible tracts 2020 nationally
svi_divisional_lihtc10 <- svi_divisional_lihtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_10, E_TOTPOP_10) %>% rename("F_TOTAL" = "F_TOTAL_10")

# Count divisional-level SVI flags for 2010, create unified fips column
svi_2010_divisional_county_flags_lihtc <- flag_summarize(svi_divisional_lihtc10, "E_TOTPOP_10") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Add suffix to flag columns 2010
colnames(svi_2010_divisional_county_flags_lihtc)[11:15] <- paste0(colnames(svi_2010_divisional_county_flags_lihtc)[11:15], "10")

# Create data frame of LIHTC eligible tracts 2020 nationally
svi_divisional_lihtc20 <- svi_divisional_lihtc %>% select(GEOID_2010_trt, FIPS_st, FIPS_county, 
    state, state_name, county, region_number, region, division_number, 
    division, F_TOTAL_20, E_TOTPOP_20) %>% rename("F_TOTAL" = "F_TOTAL_20")

# Count divisional-level SVI flags for 2020, create unified fips column
svi_2020_divisional_county_flags_lihtc <- flag_summarize(svi_divisional_lihtc20, "E_TOTPOP_20") %>% unite("fips_county_st", FIPS_st:FIPS_county, remove = FALSE, sep="")

# Identify needed columns for 2020
colnames(svi_2020_divisional_county_flags_lihtc)[11:15] <- paste0(colnames(svi_2020_divisional_county_flags_lihtc)[11:15], "20")

# Filter to needed columns for 2020 to avoid duplicate column column names
svi_2020_divisional_county_flags_join_lihtc <- svi_2020_divisional_county_flags_lihtc %>% ungroup() %>% select("fips_county_st", all_of(colnames(svi_2020_divisional_county_flags_lihtc)[11:15]))
 
# Join 2010 and 2020 data
svi_divisional_county_flags_lihtc <- left_join(svi_2010_divisional_county_flags_lihtc, svi_2020_divisional_county_flags_join_lihtc, join_by("fips_county_st" == "fips_county_st")) 

svi_divisional_county_flags_lihtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
fips_county_st FIPS_st FIPS_county state state_name county region_number region division_number division flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20
34001 34 001 NJ New Jersey Atlantic County 1 Northeast Region 2 Middle Atlantic Division 35 7939 0.0044086 0.8 1.0 37 8027 0.0046094 0.8 1.0
34003 34 003 NJ New Jersey Bergen County 1 Northeast Region 2 Middle Atlantic Division 13 11993 0.0010840 0.6 0.2 16 15211 0.0010519 0.6 0.2
34005 34 005 NJ New Jersey Burlington County 1 Northeast Region 2 Middle Atlantic Division 11 4637 0.0023722 0.4 0.6 6 6493 0.0009241 0.2 0.2
34007 34 007 NJ New Jersey Camden County 1 Northeast Region 2 Middle Atlantic Division 72 22516 0.0031977 1.0 0.8 61 20790 0.0029341 0.8 0.8
34009 34 009 NJ New Jersey Cape May County 1 Northeast Region 2 Middle Atlantic Division 15 5839 0.0025689 0.6 0.8 10 5394 0.0018539 0.4 0.4
34011 34 011 NJ New Jersey Cumberland County 1 Northeast Region 2 Middle Atlantic Division 10 1053 0.0094967 0.4 1.0 10 801 0.0124844 0.4 1.0

Join flags with LIHTC county project summary data for division:

Code
svi_divisional_county_lihtc <- left_join(svi_divisional_lihtc_county_sum, 
                                        svi_divisional_county_flags_lihtc,
                                    join_by("State" == "state", "County" == "county",
                                            "Division" == "division"))

svi_divisional_county_lihtc$post10_lihtc_project_cnt[is.na(svi_divisional_county_lihtc $post10_lihtc_project_cnt)] <- 0

svi_divisional_county_lihtc$county_name <- paste0(svi_divisional_county_lihtc$County, ", ", svi_divisional_county_lihtc$State)

svi_divisional_county_lihtc %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name
NJ Atlantic County Middle Atlantic Division 1 3 1497998 $1,497,998 34001 34 001 New Jersey 1 Northeast Region 2 35 7939 0.0044086 0.8 1.0 37 8027 0.0046094 0.8 1.0 Atlantic County, NJ
NJ Bergen County Middle Atlantic Division 0 2 0 $0 34003 34 003 New Jersey 1 Northeast Region 2 13 11993 0.0010840 0.6 0.2 16 15211 0.0010519 0.6 0.2 Bergen County, NJ
NJ Burlington County Middle Atlantic Division 0 2 0 $0 34005 34 005 New Jersey 1 Northeast Region 2 11 4637 0.0023722 0.4 0.6 6 6493 0.0009241 0.2 0.2 Burlington County, NJ
NJ Camden County Middle Atlantic Division 1 6 0 $0 34007 34 007 New Jersey 1 Northeast Region 2 72 22516 0.0031977 1.0 0.8 61 20790 0.0029341 0.8 0.8 Camden County, NJ
NJ Cape May County Middle Atlantic Division 0 2 0 $0 34009 34 009 New Jersey 1 Northeast Region 2 15 5839 0.0025689 0.6 0.8 10 5394 0.0018539 0.4 0.4 Cape May County, NJ
NJ Cumberland County Middle Atlantic Division 0 1 0 $0 34011 34 011 New Jersey 1 Northeast Region 2 10 1053 0.0094967 0.4 1.0 10 801 0.0124844 0.4 1.0 Cumberland County, NJ

National Exploratory Data Analysis: Visualizing The Intervention

Now that we have our NMTC and LIHTC data sets created, let’s create some visualizations to better examine our data:

NMTC

Correlation between outcome & intervention

To begin, let’s explore the relationship between SVI flag counts in 2010 and the amount of NMTC dollars received from 2011-2020 by county nationally.

We can accomplish this by reviewing our summary statistics, a scatterplot, and a calculation of Pearson’s r to measure the correlation.

First let’s create a dataset of only counties with projects:

Code
svi_national_county_nmtc_projects <- svi_national_county_nmtc %>% filter(post10_nmtc_project_cnt > 0)

Now let’s review the summary statistics for our data set:

Code
summary(svi_national_county_nmtc_projects$flag_count10)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      0      19      40     177     132    9936 
Code
summary(svi_national_county_nmtc_projects$post10_nmtc_project_dollars)
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
     5154   5970000  12760000  30332743  28505000 987407086 

As we can see from the summary statistics, there’s quite a spread of values across counties from 0 SVI flags to over 9,000 and ~$5,000 in tax credits to nearly $1bn. Let’s view this visually in a scatterplot:

Code
# Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_national_county_nmtc_projects,
                aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_national_county_nmtc_projects$flag_count10, svi_national_county_nmtc_projects$post10_nmtc_project_dollars, method = "pearson")
[1] 0.8197007

Here, we can see that when we consider ALL counties, we have a very strong positive correlation between SVI Flag Counts in 2010, suggesting that counties that had more social vulnerability in 2010 received more NMTC tax credit dollars in 2011-2020.

However, upon further inspection, we can also see that our data is not in a continuous line. Rather, we have the majority of our data clustered in the bottom left corner, a few scattered towards the middle and a single data point all the way in the top right of our plot.

We can use a box plot to look closer at this:

Code
boxplot(svi_national_county_nmtc_projects$flag_count10)

Code
boxplot.stats(svi_national_county_nmtc_projects$flag_count10)$out %>% sort(decreasing = TRUE)
  [1] 9936 5111 3732 3561 2941 2537 2508 2453 2296 2279 1906 1731 1569 1489 1486
 [16] 1436 1110 1106 1096 1057 1013 1004  995  991  984  977  960  942  919  871
 [31]  854  850  836  822  795  774  759  746  731  728  718  714  705  701  691
 [46]  682  651  650  641  629  595  572  571  569  564  546  541  531  517  499
 [61]  491  487  484  468  467  463  461  458  458  455  451  442  429  423  422
 [76]  413  413  408  401  399  389  381  378  378  377  374  369  363  362  358
 [91]  356  355  352  350  349  349  342  341  338  328  326  318  316  313

Similar to our observations in our correlation plot, we can see that there are several values that fall outside the majority cluster of our dataset, known as outliers. However, one point in particular, stands out even amongst the outliers and that is our county with 9,936 SVI Flags in 2010. This data point is known as an influential point since it’s extreme value can alter the outcomes of our model.

In some instances it is prudent to remove outliers that can skew regression models. However, in cases where the outlier is a natural occurrence and not an error within the data set or sampling methodology, omitting the outlier can result in faulty conclusions.

Thus, it’s important that we examine this data point further.

We can filter our data set to identify it as Los Angeles County, CA:

Code
svi_national_county_nmtc_projects %>% filter(flag_count10 == 9936) %>% head() %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name
CA Los Angeles County Pacific Division 72 1070 987407086 $987,407,086 06037 06 037 California 4 West Region 9 9936 4431665 0.002242 1 1 9098 4529210 0.0020087 1 1 Los Angeles County, CA
Code
svi_national_nmtc %>% filter(county == "Los Angeles County") %>% select(GEOID_2010_trt, F_TOTAL_10, post10_nmtc_dollars) %>% summary()
 GEOID_2010_trt       F_TOTAL_10     post10_nmtc_dollars
 Length:1070        Min.   : 2.000   Min.   :       0   
 Class :character   1st Qu.: 8.000   1st Qu.:       0   
 Mode  :character   Median :10.000   Median :       0   
                    Mean   : 9.286   Mean   :  922810   
                    3rd Qu.:11.000   3rd Qu.:       0   
                    Max.   :15.000   Max.   :76845100   

Looking at the summary stats for LA County, we can quickly conclude that we have not made an error in our calculations, there are indeed 1,070 tracts in our Los Angeles data set and with a median total SVI Flag count (at top 25% vulnerability) of 10 per tract, it’s reasonable to have ~10,000 flags.

Code
1070*10
[1] 10700

Similarly, the max tract has $76,845,100 NMTC dollars while the mean tract has $922,810 dollars.

Therefore, we can conclude that there is no reason to exclude LA County from our national analysis of the relationship between SVI Flag Counts in 2010 and NMTC Dollars from 2011-2020.

But what if we want to know the relationship between SVI Flag Counts and NMTC dollars in the majority of our counties?

To discover this, we can utilize an algorithm known as k-means clustering to create clusters within our data set and examine each of the groupings separately.

K-Means Clustering

As previously stated, we will be using the machine learning technique K-Means Clustering to identify smaller groupings of data in our dataset and evaluate the strength of the relationship between 2010 Flag Count and NMTC Dollars in 2011-2020 in the absence of the influential point.

To accomplish this, we first need to create a dataset of just our variables of interest and set our county_name column to the rownames since only numeric values can be entered into the kmeans() function.

We also want to double-check that all null values are absent from the data set and use scale() to convert our data to a comparable range:

Code
svi_national_nmtc_cluster <- svi_national_county_nmtc_projects %>% 
                            select(county_name, post10_nmtc_project_dollars, 
                                   flag_count10) %>% 
                            remove_rownames %>% 
                            column_to_rownames(var="county_name")

# Remove nulls, if in dataset
svi_national_nmtc_cluster <- na.omit(svi_national_nmtc_cluster)


# Scale numeric variables
svi_national_nmtc_cluster <- scale(svi_national_nmtc_cluster)


svi_national_nmtc_cluster %>% head(5)
                              post10_nmtc_project_dollars flag_count10
Aleutians East Borough, AK                     -0.2125961   -0.3189664
Anchorage Municipality, AK                     -0.2995956   -0.1981871
Wade Hampton Census Area, AK                   -0.1300468   -0.3170792
Yukon-Koyukuk Census Area, AK                  -0.3310540   -0.2831100
Baldwin County, AL                             -0.1906291   -0.2698998

Next we can try a few different cluster numbers and allow the algorithm to search through 25 sets to identify the best groupings for each number:

Code
set.seed(123)
k2_nmtc_nat <- kmeans(svi_national_nmtc_cluster, centers = 2, nstart = 25)
set.seed(123)
k3_nmtc_nat <- kmeans(svi_national_nmtc_cluster, centers = 3, nstart = 25)
set.seed(123)
k4_nmtc_nat <- kmeans(svi_national_nmtc_cluster, centers = 4, nstart = 25)
set.seed(123)
k5_nmtc_nat <- kmeans(svi_national_nmtc_cluster, centers = 5, nstart = 25)

Next we can view the plots to visually check the groupings and see if there’s any overlap:

Code
# plots to compare
p_k2_nmtc_nat <- factoextra::fviz_cluster(k2_nmtc_nat, geom = "point", data = svi_national_nmtc_cluster) + ggtitle("k = 2")

p_k3_nmtc_nat <- factoextra::fviz_cluster(k3_nmtc_nat, geom = "point", data = svi_national_nmtc_cluster) + ggtitle("k = 3")

p_k4_nmtc_nat <- factoextra::fviz_cluster(k4_nmtc_nat, geom = "point",  data = svi_national_nmtc_cluster) + ggtitle("k = 4")

p_k5_nmtc_nat <- factoextra::fviz_cluster(k5_nmtc_nat, geom = "point",  data = svi_national_nmtc_cluster) + ggtitle("k = 5")

grid.arrange(p_k2_nmtc_nat, p_k3_nmtc_nat, p_k4_nmtc_nat, p_k5_nmtc_nat, nrow = 2)

While we can visually look through these to see that group counts 3 and 4 appear to provide the best options without too much overlap, we can remove the potentially fallacies of visual inspection by employing the usage of an Elbow Plot which will measure the variances between the groups to identify which group number is optimal before the changes in group size start to have a negligible effect on analysis.

Code
elbow_plot <- function(df) {
  
  # Code source: https://uc-r.github.io/kmeans_clustering
  
  # Repeats same outcome each time run
  set.seed(123)

  # function to compute total within-cluster sum of square 
  wss <- function(k) {
    print(k)
    kmeans(df, k, nstart = 10, iter.max=25  )$tot.withinss
  }
  
  # Compute and plot wss for k = 1 to k = 15 (or one less than nrow(15) if row count is <= 15)
  if (nrow(df) > 15) {
    k.values <- 1:15
    print(k.values)
  } else {
    end <- nrow(df)-1
    k.values <- 1:end
    print(k.values)
  }
  
  # extract wss for 2-15 clusters (or one less than nrow(15) if row count is <= 15)
  wss_values <- map_dbl(k.values, wss)
  
  plot(k.values, wss_values,
         type="b", pch = 19, frame = FALSE, 
         xlab="Number of clusters K",
         ylab="Total within-clusters sum of squares")  
}
Code
elbow_plot(svi_national_nmtc_cluster)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15

Here we can see that the spacing between clusters decreases substantially after 3. Thus, we will go with 3 clusters:

Code
p_k3_nmtc_nat <- factoextra::fviz_cluster(k3_nmtc_nat, geom = "point", data = svi_national_nmtc_cluster) + ggtitle("k = 3")

p_k3_nmtc_nat

We can then transform our cluster matrix back to a data frame and assign these clusters to our counties:

Code
svi_national_nmtc_cluster_label <- as.data.frame(svi_national_nmtc_cluster) %>%
                                  rownames_to_column(var = "county_name") %>%
                                  as_tibble() %>%
                                  mutate(cluster = k3_nmtc_nat$cluster) %>%
                                  select(county_name, cluster)

svi_national_county_nmtc_projects2 <- left_join(svi_national_county_nmtc_projects, svi_national_nmtc_cluster_label, join_by(county_name == county_name))

# View county counts in each cluster
table(svi_national_county_nmtc_projects2$cluster)

  1   2   3 
  2  27 758 

Now we can re-examine the correlation between 2010 SVI Flag Counts and NMTC Project Dollars for each subset of our data.

First recall our overall outcomes:

Code
# Overall Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_national_county_nmtc_projects2,
                aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_national_county_nmtc_projects2$flag_count10, svi_national_county_nmtc_projects2$post10_nmtc_project_dollars, method = "pearson")
[1] 0.8197007

Now let’s look at our our high end counties in cluster 1:

Code
# Cluster 1 Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 1) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 1) %>%
  select(flag_count10,post10_nmtc_project_dollars) %>%
  cor(method = "pearson")
                            flag_count10 post10_nmtc_project_dollars
flag_count10                           1                           1
post10_nmtc_project_dollars            1                           1

As expected, we see a very high correlation where there’s only 2 counties with SVI flag counts above 5,000 and there’s a perfect relationship where the county with the higher SVI flag count received more money than the lower value.

We can see these two counties here:

Code
svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 1) %>%
  select(county_name, flag_count10, post10_nmtc_dollars_formatted) %>% arrange(flag_count10) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_nmtc_dollars_formatted
Cook County, IL 5111 $790,158,215
Los Angeles County, CA 9936 $987,407,086

Now let’s examine our data for Cluster 2 (mid-range data):

Code
# Cluster 2 Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 2) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 2) %>%
  select(flag_count10,post10_nmtc_project_dollars) %>%
  cor(method = "pearson")
                            flag_count10 post10_nmtc_project_dollars
flag_count10                  1.00000000                 -0.05722041
post10_nmtc_project_dollars  -0.05722041                  1.00000000

As we can see here, our mid range points are scattered and have a very weak correlation that skews slightly negative, but doesn’t have enough strength for us to confidently draw conclusions.

Rather, it seems the amount of money given to counties with 500 - 5,000 SVI flags varied widely between just under $100 million to just over $500 million.

We can view these counties here:

Code
svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 2) %>%
  select(county_name, flag_count10, post10_nmtc_dollars_formatted) %>% arrange(flag_count10) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_nmtc_dollars_formatted
Hennepin County, MN 564 $173,393,000
District of Columbia, DC 595 $377,155,570
Hamilton County, OH 629 $397,543,856
Jackson County, MO 651 $201,937,281
Suffolk County, MA 701 $192,010,188
Orleans Parish, LA 718 $233,891,078
Allegheny County, PA 731 $244,342,400
Fulton County, GA 795 $437,737,000
New York County, NY 850 $255,545,686
Marion County, IN 919 $138,426,520
Baltimore city, MD 960 $333,109,232
Milwaukee County, WI 984 $315,495,493
Shelby County, TN 1004 $289,352,388
Fresno County, CA 1110 $115,258,480
Bexar County, TX 1436 $199,964,269
Clark County, NV 1486 $225,315,967
Cuyahoga County, OH 1489 $306,121,487
San Diego County, CA 1569 $221,738,411
Philadelphia County, PA 1906 $550,969,964
Queens County, NY 2279 $85,225,100
Miami-Dade County, FL 2296 $233,661,603
Maricopa County, AZ 2453 $84,923,464
Dallas County, TX 2508 $302,019,013
Bronx County, NY 2537 $306,355,715
Wayne County, MI 2941 $360,949,480
Harris County, TX 3561 $262,456,477
Kings County, NY 3732 $216,348,600

Finally, let’s look at the majority of our data (low SVI flag count, low NMTC dollars) in cluster 3:

Code
# Cluster 3 Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 3) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_national_county_nmtc_projects2 %>% 
  filter(cluster == 3) %>%
  select(flag_count10,post10_nmtc_project_dollars) %>%
  cor(method = "pearson")
                            flag_count10 post10_nmtc_project_dollars
flag_count10                   1.0000000                   0.4736348
post10_nmtc_project_dollars    0.4736348                   1.0000000

So here we can see out correlation has dropped from very strong to moderate. While the trend of the line still suggests there’s a positive relationship, we can confirm that LA County has a strong influence on our correlation.

Thus, we can conclude here that there is a pattern where counties with lower counts of flags have a moderately positive correlation between more vulnerable counties receiving more NMTC money than less vulnerable counties and counties with the highest counts of SVI flags also following a pattern of more vulnerable counties receiving more NMTC dollars.

Our mid-level counties do not have such a clear pattern on a national level, though they may rank differently divisionally.

Bivariate Map

Now let’s view this relationship spatially by creating a bivariate map.

First, we’ll pull county and state shapefile data for the entire US (Note: We already have this data for our divisions, so we will not need to re-run it. )

Code
# Recall that we are working with 2010 census tracts, thus we need to pull the 2010 shapefiles
county_sf = tigris::counties(year = 2010, cb = TRUE)

# Shift geometric locations of AK and HI
county_sf <- shift_geometry(
              county_sf,
              geoid_column = NULL,
              preserve_area = FALSE,
              position = c("below", "outside")
            )

st_sf <- tigris::states(year = 2010, cb = TRUE) %>% filter(STATE != "72")

# Shift geometric locations of AK and HI
st_sf <- shift_geometry(
              st_sf,
              geoid_column = NULL,
              preserve_area = FALSE,
              position = c("below", "outside")
            )
Code
# Join our NMTC projects data with our shapefile geocoordinates
svi_national_county_nmtc_sf <- left_join(svi_national_county_nmtc_projects, county_sf, join_by("FIPS_st" == "STATEFP", "FIPS_county" == "COUNTYFP"))

svi_national_county_nmtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name GEO_ID STATE COUNTY NAME LSAD CENSUSAREA geometry
AK Aleutians East Borough Pacific Division 1 1 15762500 $15,762,500 02013 02 013 Alaska 4 West Region 9 8 3703 0.0021604 0.4 1.0 5 3389 0.0014754 0.2 0.8 Aleutians East Borough, AK 0500000US02013 02 013 Aleutians East Borough 6981.943 MULTIPOLYGON (((-2385249 -1...
AK Anchorage Municipality Pacific Division 1 13 9800000 $9,800,000 02020 02 020 Alaska 4 West Region 9 72 64432 0.0011175 1.0 0.4 87 69679 0.0012486 1.0 0.6 Anchorage Municipality, AK 0500000US02020 02 020 Anchorage Muny 1704.683 MULTIPOLYGON (((-1927463 -1...
AK Wade Hampton Census Area Pacific Division 1 1 21420000 $21,420,000 02270 02 270 Alaska 4 West Region 9 9 7398 0.0012165 0.4 0.6 10 8298 0.0012051 0.4 0.6 Wade Hampton Census Area, AK 0500000US02270 02 270 Wade Hampton CA 17081.433 MULTIPOLYGON (((-2310112 -1...
AK Yukon-Koyukuk Census Area Pacific Division 1 3 7644000 $7,644,000 02290 02 290 Alaska 4 West Region 9 27 4027 0.0067047 0.8 1.0 31 3979 0.0077909 0.8 1.0 Yukon-Koyukuk Census Area, AK 0500000US02290 02 290 Yukon-Koyukuk CA 145504.789 MULTIPOLYGON (((-1736112 -9...
AL Baldwin County East South Central Division 4 8 17268000 $17,268,000 01003 01 003 Alabama 3 South Region 6 34 38458 0.0008841 0.8 0.4 34 46255 0.0007351 0.8 0.2 Baldwin County, AL 0500000US01003 01 003 Baldwin County 1589.784 MULTIPOLYGON (((820813.4 -7...
Code
# Create classes for bivariate mapping 
svi_national_county_nmtc_sf <- bi_class(svi_national_county_nmtc_sf, x = flag_count10, y = post10_nmtc_project_dollars, style = "quantile", dim = 3)

# View data
svi_national_county_nmtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name GEO_ID STATE COUNTY NAME LSAD CENSUSAREA geometry bi_class
AK Aleutians East Borough Pacific Division 1 1 15762500 $15,762,500 02013 02 013 Alaska 4 West Region 9 8 3703 0.0021604 0.4 1.0 5 3389 0.0014754 0.2 0.8 Aleutians East Borough, AK 0500000US02013 02 013 Aleutians East Borough 6981.943 MULTIPOLYGON (((-2385249 -1... 1-2
AK Anchorage Municipality Pacific Division 1 13 9800000 $9,800,000 02020 02 020 Alaska 4 West Region 9 72 64432 0.0011175 1.0 0.4 87 69679 0.0012486 1.0 0.6 Anchorage Municipality, AK 0500000US02020 02 020 Anchorage Muny 1704.683 MULTIPOLYGON (((-1927463 -1... 2-2
AK Wade Hampton Census Area Pacific Division 1 1 21420000 $21,420,000 02270 02 270 Alaska 4 West Region 9 9 7398 0.0012165 0.4 0.6 10 8298 0.0012051 0.4 0.6 Wade Hampton Census Area, AK 0500000US02270 02 270 Wade Hampton CA 17081.433 MULTIPOLYGON (((-2310112 -1... 1-3
AK Yukon-Koyukuk Census Area Pacific Division 1 3 7644000 $7,644,000 02290 02 290 Alaska 4 West Region 9 27 4027 0.0067047 0.8 1.0 31 3979 0.0077909 0.8 1.0 Yukon-Koyukuk Census Area, AK 0500000US02290 02 290 Yukon-Koyukuk CA 145504.789 MULTIPOLYGON (((-1736112 -9... 2-1
AL Baldwin County East South Central Division 4 8 17268000 $17,268,000 01003 01 003 Alabama 3 South Region 6 34 38458 0.0008841 0.8 0.4 34 46255 0.0007351 0.8 0.2 Baldwin County, AL 0500000US01003 01 003 Baldwin County 1589.784 MULTIPOLYGON (((820813.4 -7... 2-2

Finally we can create our map:

Code
# Create map with ggplot
svi_national_county_nmtc_map <- ggplot() +
  # Map county shapefile, fill with bi_class categories
  geom_sf(data = svi_national_county_nmtc_sf, mapping = aes(geometry=geometry, fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) +
  # Set to biscale palette
  bi_scale_fill(pal = "GrPink", dim = 3) +
  # Add state shapefiles for outline
  geom_sf(data=st_sf, color="black", fill=NA, linewidth=.5, aes(geometry=geometry)) +
  labs(
    title = "Correlation of 2010 National SVI Flag Count and 2011 - 2020 NMTC Tax Dollars",
  ) +
  # Set them to biscale
  bi_theme(base_size = 10)

# Create biscale legend
svi_national_county_nmtc_legend <- bi_legend(pal = "GrPink",
                    dim = 3,
                    xlab = "SVI Flag Count",
                    ylab = "NMTC Dollars",
                    size = 8)

# Combine map with legend using cowplot
svi_national_county_nmtc_bivarmap <- ggdraw() +
  draw_plot(svi_national_county_nmtc_map) +
  # Set legend location
  draw_plot(svi_national_county_nmtc_legend, x= -.02,  y = -.05,
 width=.20)


# View map
svi_national_county_nmtc_bivarmap

Here we can see the distribution of our counties with NMTC projects based on the correlation between 2010 SVI Flag Count and NMTC dollars.

For example, we can see several counties in WI have moderate-to-high amounts of NMTC dollars even though they have relatively low SVI amounts:

Code
svi_national_county_nmtc_sf %>% filter(State == "WI") %>% select(State, County, flag_count10, post10_nmtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State           County flag_count10 post10_nmtc_dollars_formatted
1    WI Milwaukee County          984                  $315,495,493
2    WI     Brown County           82                   $22,110,000
3    WI      Dane County           74                   $46,498,037
4    WI      Rock County           72                   $29,580,000
5    WI   Kenosha County           61                   $36,800,000
6    WI Sheboygan County           26                    $7,305,000

PA has a cluster of counties with moderate-to-high SVI flag counts and corresponding moderate-to-high NMTC dollar amounts:

Code
svi_national_county_nmtc_sf %>% filter(State == "PA") %>% select(State, County, flag_count10, post10_nmtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State              County flag_count10 post10_nmtc_dollars_formatted
1    PA Philadelphia County         1906                  $550,969,964
2    PA    Allegheny County          731                  $244,342,400
3    PA     Delaware County          235                   $14,190,000
4    PA        Berks County          225                    $7,840,000
5    PA         Erie County          178                    $7,358,392
6    PA      Dauphin County          137                   $32,123,500

Arizona has several high SVI Flag and high NMTC dollar counties and a moderate SVI Flag, low NMTC dollar county:

Code
svi_national_county_nmtc_sf %>% filter(State == "AZ") %>% select(State, County, flag_count10, post10_nmtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State          County flag_count10 post10_nmtc_dollars_formatted
1    AZ Maricopa County         2453                   $84,923,464
2    AZ     Pima County          728                   $36,122,128
3    AZ     Yuma County          276                    $1,454,000
4    AZ    Pinal County          203                   $37,224,559
5    AZ   Navajo County          189                   $46,134,750
6    AZ   Apache County          129                   $12,544,000

LIHTC

Correlation between outcome & intervention

We can now repeat our analysis for the LIHTC to identify if there is a relationship between dollars counties received from this program .

Recall that we will want to review our summary statistics, a scatterplot, and a calculation of Pearson’s r to measure the correlation.

First let’s create a dataset of only counties with LIHTC projects:

Code
svi_national_county_lihtc_projects <- svi_national_county_lihtc %>% filter(post10_lihtc_project_cnt > 0)

Now let’s review the summary statistics for our data set:

Code
summary(svi_national_county_lihtc_projects$flag_count10)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
    0.0    17.0    33.0   104.6   113.5  2457.0 
Code
summary(svi_national_county_lihtc_projects$post10_lihtc_project_dollars)
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
       0   368649   833390  2747385  2597486 50547731 

Note that unlike the NMTC program, there are instances where there are tracts with LIHTC projects, but they did not receive any funding. We want to filter these out of our data set for the purposes of our analysis of the relationship between LIHTC dollars and the SVI flags.

Code
svi_national_county_lihtc_projects <- svi_national_county_lihtc_projects %>% filter(post10_lihtc_project_dollars > 0)

Now we can view the updated summaries:

Code
summary(svi_national_county_lihtc_projects$flag_count10)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
    0.0    17.0    34.0   109.8   112.5  2457.0 
Code
summary(svi_national_county_lihtc_projects$post10_lihtc_project_dollars)
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
   56314   605483  1275416  3233901  3424308 50547731 

Much like the NMTC program, there’s quite a spread of values. Once again, the minimum flag count for the LIHTC program is 0, however the maximum is only 2,457 compared to over 9,000 for NMTC. The LIHTC dollar amount range is narrower, but starts much higher from ~$56,000 in tax credits to nearly ~$51 million. Once again, let’s view this visually in a scatterplot:

Code
# Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_national_county_lihtc_projects,
                aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_national_county_lihtc_projects$flag_count10, svi_national_county_lihtc_projects$post10_lihtc_project_dollars, method = "pearson")
[1] 0.7368838

Similar to the NMTC, we can see that when we consider ALL counties, we have a strong positive correlation between SVI Flag Counts in 2010 and and LIHTC dollars from 2011-2020, suggesting that counties that had more social vulnerability in 2010 received more LIHTC dollars in 2011-2020.

However, once again, we can also see that our data is not in a continuous line. In fact, we appear to have a few more clusters in the LIHTC program data than we had for the NMTC.

The bulk of our data points are once again clustered in the bottom left corner. We have a few more clusters above those and then a single data point all the way in the top right of our plot.

We can use a box plot to look closer at this:

Code
boxplot(svi_national_county_lihtc_projects$flag_count10)

Code
boxplot.stats(svi_national_county_lihtc_projects$flag_count10)$out %>% sort(decreasing = TRUE)
 [1] 2457 1254 1135 1002  835  560  475  440  418  403  402  340  327  323  303
[16]  296  293  276  271  263

This is our same influential point from Los Angeles County, CA:

Code
svi_national_county_lihtc_projects %>% filter(flag_count10 == 2457)
  State             County         Division post10_lihtc_project_cnt tract_cnt
1    CA Los Angeles County Pacific Division                       58       238
  post10_lihtc_project_dollars post10_lihtc_dollars_formatted fips_county_st
1                     50547731                    $50,547,731          06037
  FIPS_st FIPS_county state_name region_number      region division_number
1      06         037 California             4 West Region               9
  flag_count10  pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10
1         2457 988225   0.002486276                     1                 0.6
  flag_count20  pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20
1         2272 991036    0.00229255                     1                 0.6
             county_name
1 Los Angeles County, CA
Code
svi_national_lihtc %>% filter(county == "Los Angeles County") %>% select(GEOID_2010_trt, F_TOTAL_10, post10_lihtc_project_dollars) %>% summary()
 GEOID_2010_trt       F_TOTAL_10    post10_lihtc_project_dollars
 Length:238         Min.   : 6.00   Min.   :      0             
 Class :character   1st Qu.:10.00   1st Qu.:      0             
 Mode  :character   Median :10.00   Median :      0             
                    Mean   :10.32   Mean   : 212385             
                    3rd Qu.:11.00   3rd Qu.:      0             
                    Max.   :13.00   Max.   :4945372             

Looking at the summary stats for LA County, we can again quickly conclude that we have not made an error in our calculations, there are indeed 238 tracts in our Los Angeles County data set and with a median total SVI Flag count (at top 25% vulnerability) of 10 per tract and a max of 13 per tract, it’s reasonable to have ~2500 flags.

Code
238*10
[1] 2380
Code
238*13
[1] 3094

Similarly, the max tract has $4,945,372 LIHTC dollars while the mean tract has $212,385 dollars.

Therefore, we can conclude that there is no reason to exclude LA County from our national analysis of the relationship between SVI Flag Counts in 2010 and LIHTC Dollars from 2011-2020.

Now recall from our NMTC analysis that we can utilize an algorithm known as k-means clustering to create clusters within our data set and examine each of the groupings separately.

K-Means Clustering

Once again, we first need to create a dataset of just our variables of interest and set our county_name column to the rownames since only numeric values can be entered into the kmeans() function.

We also want to double-check that all null values are absent from the data set and use scale() to convert our data to a comparable range:

Code
svi_national_lihtc_cluster <- svi_national_county_lihtc_projects %>% 
                            select(county_name, post10_lihtc_project_dollars, 
                                   flag_count10) %>% 
                            remove_rownames %>% 
                            column_to_rownames(var="county_name")

# Remove nulls, if in dataset
svi_national_lihtc_cluster <- na.omit(svi_national_lihtc_cluster)


# Scale numeric variables
svi_national_lihtc_cluster <- scale(svi_national_lihtc_cluster)


svi_national_lihtc_cluster %>% head(5)
                     post10_lihtc_project_dollars flag_count10
Dale County, AL                        -0.4426510   -0.4100636
Mobile County, AL                      -0.4215575    0.1570056
Craighead County, AR                   -0.1126573   -0.4100636
Jefferson County, AR                   -0.4806216   -0.2744601
Pope County, AR                        -0.4860654   -0.4265004

Next we can try a few different cluster numbers and allow the algorithm to search through 25 sets to identify the best groupings for each number:

Code
set.seed(123)
k2_lihtc_nat <- kmeans(svi_national_lihtc_cluster, centers = 2, nstart = 25)
set.seed(123)
k3_lihtc_nat <- kmeans(svi_national_lihtc_cluster, centers = 3, nstart = 25)
set.seed(123)
k4_lihtc_nat <- kmeans(svi_national_lihtc_cluster, centers = 4, nstart = 25)
set.seed(123)
k5_lihtc_nat <- kmeans(svi_national_lihtc_cluster, centers = 5, nstart = 25)

Next we can view the plots to visually check the groupings and see if there’s any overlap:

Code
# plots to compare
p_k2_lihtc_nat <- factoextra::fviz_cluster(k2_lihtc_nat, geom = "point", data = svi_national_lihtc_cluster) + ggtitle("k = 2")

p_k3_lihtc_nat <- factoextra::fviz_cluster(k3_lihtc_nat, geom = "point", data = svi_national_lihtc_cluster) + ggtitle("k = 3")

p_k4_lihtc_nat <- factoextra::fviz_cluster(k4_lihtc_nat, geom = "point",  data = svi_national_lihtc_cluster) + ggtitle("k = 4")

p_k5_lihtc_nat <- factoextra::fviz_cluster(k5_lihtc_nat, geom = "point",  data = svi_national_lihtc_cluster) + ggtitle("k = 5")

grid.arrange(p_k2_lihtc_nat, p_k3_lihtc_nat, p_k4_lihtc_nat, p_k5_lihtc_nat, nrow = 2)

Once more visually group counts 3 and 4 appear to provide the best options without too much overlap.

However, we’ll run our Elbow Plot function again to confirm:

Code
elbow_plot(svi_national_lihtc_cluster)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15

Here we can see that the spacing between clusters decreases substantially after 3. Thus, we will go with 3 clusters again:

Code
p_k3_lihtc_nat <- factoextra::fviz_cluster(k3_lihtc_nat, geom = "point", data = svi_national_lihtc_cluster) + ggtitle("k = 3")

p_k3_lihtc_nat

We can then transform our cluster matrix back to a data frame and assign these clusters to our counties:

Code
svi_national_lihtc_cluster_label <- as.data.frame(svi_national_lihtc_cluster) %>%
                                  rownames_to_column(var = "county_name") %>%
                                  as_tibble() %>%
                                  mutate(cluster = k3_lihtc_nat$cluster) %>%
                                  select(county_name, cluster)

svi_national_county_lihtc_projects2 <- left_join(svi_national_county_lihtc_projects, svi_national_lihtc_cluster_label, join_by(county_name == county_name))

# View county counts in each cluster
table(svi_national_county_lihtc_projects2$cluster)

  1   2   3 
164  27   1 

Now we can re-examine the correlation between 2010 SVI Flag Counts and LIHTC Project Dollars for each subset of our data.

First recall our overall outcomes:

Code
# Overall Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_national_county_lihtc_projects2,
                aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_national_county_lihtc_projects2$flag_count10, svi_national_county_lihtc_projects2$post10_lihtc_project_dollars, method = "pearson")
[1] 0.7368838

Now let’s look at our lower end counties in cluster 1 (bottom left corner):

Code
# Cluster 1 Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 1) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 1) %>%
  select(flag_count10,post10_lihtc_project_dollars) %>%
  cor(method = "pearson")
                             flag_count10 post10_lihtc_project_dollars
flag_count10                    1.0000000                    0.2812405
post10_lihtc_project_dollars    0.2812405                    1.0000000

Here we can see our correlation has dropped from strong to weak. As we can see, there are still several sub-clusters in our data. Thus, we can confirm that LA County has a strong influence on our correlation.

We can also conclude that there may not be as strong of a relationship between SVI Flags and the LIHTC dollars. This could partly be because the LIHTC credit program is meant to target low income households, but is not as tied to low income communities as the NMTC.

We can see some of these cluster 1 counties here:

Code
svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 1) %>%
  select(county_name, flag_count10, post10_lihtc_dollars_formatted) %>%
  arrange(desc(flag_count10)) %>% head(10) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_lihtc_dollars_formatted
Queens County, NY 296 $4,094,899
Oklahoma County, OK 293 $590,000
Orleans Parish, LA 276 $3,558,074
Sacramento County, CA 207 $4,065,883
Passaic County, NJ 206 $4,564,679
Hartford County, CT 203 $256,961
Alameda County, CA 202 $1,590,984
Erie County, NY 167 $2,220,667
Shelby County, TN 167 $201,735
Monroe County, NY 165 $4,944,903

Now let’s examine our mid-range points in Cluster 2:

Code
# Cluster 2 Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 2) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 2) %>%
  select(flag_count10,post10_lihtc_project_dollars) %>%
  cor(method = "pearson")
                             flag_count10 post10_lihtc_project_dollars
flag_count10                   1.00000000                  -0.02464747
post10_lihtc_project_dollars  -0.02464747                   1.00000000

Again, our mid range points are scattered and have a very weak correlation that skews slightly negative, but doesn’t have enough strength for us to confidently draw conclusions.

Rather, it seems the amount of money given to counties with 0 - 1250 SVI flags varied widely between less than $10 million to over $20 million.

We can view these counties here:

Code
svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 2) %>%
  select(county_name, flag_count10, post10_lihtc_dollars_formatted) %>%
  arrange(desc(flag_count10)) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_lihtc_dollars_formatted
Cook County, IL 1254 $6,872,376
Kings County, NY 1135 $26,054,976
Wayne County, MI 1002 $11,226,253
Harris County, TX 835 $179,539
Essex County, NJ 560 $7,410,996
Maricopa County, AZ 475 $13,115,292
Bronx County, NY 440 $19,909,800
Cuyahoga County, OH 418 $4,515,742
District of Columbia, DC 403 $11,695,555
San Diego County, CA 402 $20,961,962
Milwaukee County, WI 340 $11,454,416
Baltimore city, MD 327 $6,501,415
Orange County, CA 323 $10,245,926
Miami-Dade County, FL 303 $12,039,478
Riverside County, CA 271 $6,335,483
San Bernardino County, CA 263 $5,757,810
Philadelphia County, PA 253 $6,805,843
New York County, NY 202 $9,337,368
Allegheny County, PA 191 $8,889,633
Hennepin County, MN 178 $8,327,899
Onondaga County, NY 152 $18,599,402
Tulsa County, OK 146 $8,175,983
Hillsborough County, FL 143 $10,116,734
San Francisco County, CA 79 $11,194,380
Delaware County, IN 31 $17,000,000
Vigo County, IN 22 $18,646,385
Mesa County, CO 13 $15,437,500

Finally, let’s look at our cluster 3 data (top right corner):

Code
# Cluster 3 Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 3) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 3) %>%
  select(flag_count10,post10_lihtc_project_dollars) %>%
  cor(method = "pearson")
                             flag_count10 post10_lihtc_project_dollars
flag_count10                           NA                           NA
post10_lihtc_project_dollars           NA                           NA

Since there is only 1 point, we can’t calculate a correlation, but we can confirm that this point is LA County:

Code
svi_national_county_lihtc_projects2 %>% 
  filter(cluster == 3) %>%
  select(county_name, flag_count10, post10_lihtc_dollars_formatted) %>% 
  arrange(desc(flag_count10)) %>% head(10) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_lihtc_dollars_formatted
Los Angeles County, CA 2457 $50,547,731

Bivariate Map

Now let’s view this relationship spatially by creating another bivariate map:

Code
# Join our LIHTC projects data with our shapefile geocoordinates
svi_national_county_lihtc_sf <- left_join(svi_national_county_lihtc_projects, county_sf, join_by("FIPS_st" == "STATEFP", "FIPS_county" == "COUNTYFP"))

svi_national_county_lihtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name GEO_ID STATE COUNTY NAME LSAD CENSUSAREA geometry
AL Dale County East South Central Division 1 2 801670 $801,670 01045 01 045 Alabama 3 South Region 6 10 4943 0.0020231 0.4 0.4 15 4853 0.0030909 0.6 0.8 Dale County, AL 0500000US01045 01 045 Dale County 561.150 MULTIPOLYGON (((966402.4 -6...
AL Mobile County East South Central Division 1 18 917572 $917,572 01097 01 097 Alabama 3 South Region 6 148 41977 0.0035257 1.0 0.8 126 34483 0.0036540 1.0 0.8 Mobile County, AL 0500000US01097 01 097 Mobile County 1229.435 MULTIPOLYGON (((763284.2 -7...
AR Craighead County West South Central Division 6 1 2614884 $2,614,884 05031 05 031 Arkansas 3 South Region 7 10 5701 0.0017541 0.4 0.4 9 6088 0.0014783 0.4 0.2 Craighead County, AR 0500000US05031 05 031 Craighead County 707.206 MULTIPOLYGON (((509938.5 -1...
AR Jefferson County West South Central Division 1 5 593033 $593,033 05069 05 069 Arkansas 3 South Region 7 43 14174 0.0030337 1.0 0.8 39 11370 0.0034301 0.8 0.8 Jefferson County, AR 0500000US05069 05 069 Jefferson County 870.746 MULTIPOLYGON (((391413.8 -3...
AR Pope County West South Central Division 1 1 563121 $563,121 05115 05 115 Arkansas 3 South Region 7 6 4220 0.0014218 0.2 0.2 9 4890 0.0018405 0.4 0.4 Pope County, AR 0500000US05115 05 115 Pope County 812.548 MULTIPOLYGON (((243262.7 -2...
Code
# Create classes for bivariate mapping 
svi_national_county_lihtc_sf <- bi_class(svi_national_county_lihtc_sf, x = flag_count10, y = post10_lihtc_project_dollars, style = "quantile", dim = 3)

# View data
svi_national_county_lihtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name GEO_ID STATE COUNTY NAME LSAD CENSUSAREA geometry bi_class
AL Dale County East South Central Division 1 2 801670 $801,670 01045 01 045 Alabama 3 South Region 6 10 4943 0.0020231 0.4 0.4 15 4853 0.0030909 0.6 0.8 Dale County, AL 0500000US01045 01 045 Dale County 561.150 MULTIPOLYGON (((966402.4 -6... 1-2
AL Mobile County East South Central Division 1 18 917572 $917,572 01097 01 097 Alabama 3 South Region 6 148 41977 0.0035257 1.0 0.8 126 34483 0.0036540 1.0 0.8 Mobile County, AL 0500000US01097 01 097 Mobile County 1229.435 MULTIPOLYGON (((763284.2 -7... 3-2
AR Craighead County West South Central Division 6 1 2614884 $2,614,884 05031 05 031 Arkansas 3 South Region 7 10 5701 0.0017541 0.4 0.4 9 6088 0.0014783 0.4 0.2 Craighead County, AR 0500000US05031 05 031 Craighead County 707.206 MULTIPOLYGON (((509938.5 -1... 1-3
AR Jefferson County West South Central Division 1 5 593033 $593,033 05069 05 069 Arkansas 3 South Region 7 43 14174 0.0030337 1.0 0.8 39 11370 0.0034301 0.8 0.8 Jefferson County, AR 0500000US05069 05 069 Jefferson County 870.746 MULTIPOLYGON (((391413.8 -3... 2-1
AR Pope County West South Central Division 1 1 563121 $563,121 05115 05 115 Arkansas 3 South Region 7 6 4220 0.0014218 0.2 0.2 9 4890 0.0018405 0.4 0.4 Pope County, AR 0500000US05115 05 115 Pope County 812.548 MULTIPOLYGON (((243262.7 -2... 1-1

Finally we can create our map:

Code
# Create map with ggplot
svi_national_county_lihtc_map <- ggplot() +
  # Map county shapefile, fill with bi_class categories
  geom_sf(data = svi_national_county_lihtc_sf, mapping = aes(geometry=geometry, fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) +
  # Set to biscale palette
  bi_scale_fill(pal = "GrPink", dim = 3) +
  # Add state shapefiles for outline
  geom_sf(data=st_sf, color="black", fill=NA, linewidth=.5, aes(geometry=geometry)) +
  labs(
    title = "Correlation of 2010 National SVI Flag Count and 2011 - 2020 LIHTC Tax Dollars",
  ) +
  # Set them to biscale
  bi_theme(base_size = 10)

# Create biscale legend
svi_national_county_lihtc_legend <- bi_legend(pal = "GrPink",
                    dim = 3,
                    xlab = "SVI Flag Count",
                    ylab = "LIHTC Dollars",
                    size = 8)

# Combine map with legend using cowplot
svi_national_county_lihtc_bivarmap <- ggdraw() +
  draw_plot(svi_national_county_lihtc_map) +
  # Set legend location
  draw_plot(svi_national_county_lihtc_legend, x= -.02,  y = -.05,
 width=.20)


# View map
svi_national_county_lihtc_bivarmap

Here we can see the distribution of our LIHTC counties is quite a bit less than our NMTC projects. However, we can once again review the correlation between 2010 SVI Flag Count and LIHTC dollars.

For example, we can see a few counties in CO that have moderate-to-high amounts of LIHTC dollars even though they have relatively low SVI flag counts:

Code
svi_national_county_lihtc_sf %>% filter(State == "CO") %>% select(State, County, flag_count10, post10_lihtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State         County flag_count10 post10_lihtc_dollars_formatted
1    CO  Denver County           69                     $5,226,128
2    CO El Paso County           18                     $1,011,891
3    CO Larimer County           17                     $2,609,648
4    CO    Mesa County           13                    $15,437,500

CA has a cluster of counties with moderate-to-high SVI flag counts and corresponding moderate-to-high LIHTC dollar amounts:

Code
svi_national_county_lihtc_sf %>% filter(State == "CA") %>% select(State, County, flag_count10, post10_lihtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State                County flag_count10 post10_lihtc_dollars_formatted
1    CA    Los Angeles County         2457                    $50,547,731
2    CA      San Diego County          402                    $20,961,962
3    CA         Orange County          323                    $10,245,926
4    CA      Riverside County          271                     $6,335,483
5    CA San Bernardino County          263                     $5,757,810
6    CA     Sacramento County          207                     $4,065,883

Divisional Exploratory Data Analysis: Visualizing The Intervention

Now that we have done a walk-through of the national trends of the NMTC and LIHTC data, let’s zone into our census division:

NMTC

Correlation between outcome & intervention

Create projects df:

Code
svi_divisional_county_nmtc_projects <- svi_divisional_county_nmtc %>% filter(post10_nmtc_project_cnt > 0)

Check that our expected division is loaded:

Code
svi_divisional_county_nmtc_projects %>% select(Division) %>% unique()
                  Division
1 Middle Atlantic Division

Now let’s review the summary statistics for our data set:

Code
summary(svi_divisional_county_nmtc_projects$flag_count10)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   5.00   54.75  134.50  399.71  346.00 3869.00 
Code
summary(svi_divisional_county_nmtc_projects$post10_nmtc_project_dollars)
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
  1460000   7800000  16225000  51968192  41860000 550969964 

As we can see from the summary statistics, there’s also quite a spread of values across counties in the Middle Atlantic Division from 5 SVI flags to over 3,800 and ~$1.5 million in tax credits to over $.5bn. Let’s view this visually in a scatterplot:

Code
# Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_divisional_county_nmtc_projects,
                aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_divisional_county_nmtc_projects$flag_count10, svi_divisional_county_nmtc_projects$post10_nmtc_project_dollars, method = "pearson")
[1] 0.7085789

Here we have a similar pattern to the national data, though the top right outlier is not quite as extreme.

We have a strong positive correlation between SVI Flag Counts in 2010, suggesting that counties that had more social vulnerability in 2010 received more NMTC tax credit dollars in 2011-2020.

However, our data is not in a perfect, continuous line. Rather, we have the majority of our data clustered in the bottom left corner and some scatter across the plot.

We can use a box plot to look closer at this:

Code
boxplot(svi_divisional_county_nmtc_projects$flag_count10)

Code
boxplot.stats(svi_divisional_county_nmtc_projects$flag_count10)$out %>% sort(decreasing = TRUE)
[1] 3869 2688 2347 1961 1019  879  841

While our 7 outliers are closer together, we can still see that our county with 3,869 has over 1,000 more SVI flags than the next county:

We can filter our data set to identify these:

Code
svi_divisional_county_nmtc_projects %>% 
  select(county_name, flag_count10, post10_nmtc_dollars_formatted) %>% 
  arrange(desc(flag_count10)) %>% 
  head(7) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_nmtc_dollars_formatted
Kings County, NY 3869 $216,348,600
Bronx County, NY 2688 $306,355,715
Queens County, NY 2347 $85,225,100
Philadelphia County, PA 1961 $550,969,964
Essex County, NJ 1019 $81,662,084
New York County, NY 879 $255,545,686
Hudson County, NJ 841 $110,136,049

K-Means Clustering

Now let’s examine our divisional data in segments:

Code
svi_divisional_nmtc_cluster <- svi_divisional_county_nmtc_projects %>% 
                            select(county_name, post10_nmtc_project_dollars, 
                                   flag_count10) %>% 
                            remove_rownames %>% 
                            column_to_rownames(var="county_name")

# Remove nulls, if in dataset
svi_divisional_nmtc_cluster <- na.omit(svi_divisional_nmtc_cluster)


# Scale numeric variables
svi_divisional_nmtc_cluster <- scale(svi_divisional_nmtc_cluster)


svi_divisional_nmtc_cluster %>% head(5)
                      post10_nmtc_project_dollars flag_count10
Bergen County, NJ                      -0.4296451   -0.3418568
Camden County, NJ                       0.2835350   -0.0912361
Cumberland County, NJ                  -0.1922645   -0.3526362
Essex County, NJ                        0.3039882    0.8344437
Hudson County, NJ                       0.5954875    0.5946023

Next we can try a few different cluster numbers and allow the algorithm to search through 25 sets to identify the best groupings for each number:

Code
set.seed(123)
k2_nmtc_div <- kmeans(svi_divisional_nmtc_cluster, centers = 2, nstart = 25)
set.seed(123)
k3_nmtc_div <- kmeans(svi_divisional_nmtc_cluster, centers = 3, nstart = 25)
set.seed(123)
k4_nmtc_div <- kmeans(svi_divisional_nmtc_cluster, centers = 4, nstart = 25)
set.seed(123)
k5_nmtc_div <- kmeans(svi_divisional_nmtc_cluster, centers = 5, nstart = 25)

Next we can view the plots to visually check the groupings and see if there’s any overlap:

Code
# plots to compare
p_k2_nmtc_div <- factoextra::fviz_cluster(k2_nmtc_div, geom = "point", data = svi_divisional_nmtc_cluster) + ggtitle("k = 2")

p_k3_nmtc_div <- factoextra::fviz_cluster(k3_nmtc_div, geom = "point", data = svi_divisional_nmtc_cluster) + ggtitle("k = 3")

p_k4_nmtc_div <- factoextra::fviz_cluster(k4_nmtc_div, geom = "point",  data = svi_divisional_nmtc_cluster) + ggtitle("k = 4")

p_k5_nmtc_div <- factoextra::fviz_cluster(k5_nmtc_div, geom = "point",  data = svi_divisional_nmtc_cluster) + ggtitle("k = 5")

grid.arrange(p_k2_nmtc_div, p_k3_nmtc_div, p_k4_nmtc_div, p_k5_nmtc_div, nrow = 2)

Here the 2 grouping appears to be the only one with multiple members across clusters, however we can confirm our visual inspection with our elbow plot:

Code
elbow_plot(svi_divisional_nmtc_cluster)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15

Here we can see that the spacing between clusters decreases substantially after 2. Thus, we will go with 2 clusters:

Code
p_k2_nmtc_div <- factoextra::fviz_cluster(k2_nmtc_div, geom = "point", data = svi_divisional_nmtc_cluster) + ggtitle("k = 2")

p_k2_nmtc_div

We can then transform our cluster matrix back to a data frame and assign these clusters to our counties:

Code
svi_divisional_nmtc_cluster_label <- as.data.frame(svi_divisional_nmtc_cluster) %>%
                                  rownames_to_column(var = "county_name") %>%
                                  as_tibble() %>%
                                  mutate(cluster = k2_nmtc_div$cluster) %>%
                                  select(county_name, cluster)

svi_divisional_county_nmtc_projects2 <- left_join(svi_divisional_county_nmtc_projects, svi_divisional_nmtc_cluster_label, join_by(county_name == county_name))

# View county counts in each cluster
table(svi_divisional_county_nmtc_projects2$cluster)

 1  2 
 6 46 

Now we can re-examine the correlation between 2010 SVI Flag Counts and NMTC Project Dollars for each subset of our data.

First recall our overall outcomes:

Code
# Overall Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_divisional_county_nmtc_projects2,
                aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_divisional_county_nmtc_projects2$flag_count10, svi_divisional_county_nmtc_projects2$post10_nmtc_project_dollars, method = "pearson")
[1] 0.7085789

Now let’s look at our smaller cluster of points in Cluster 1:

Code
# Cluster 1 Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_divisional_county_nmtc_projects2 %>% 
  filter(cluster == 1) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_divisional_county_nmtc_projects2 %>% 
  filter(cluster == 1) %>%
  select(flag_count10,post10_nmtc_project_dollars) %>%
  cor(method = "pearson")
                            flag_count10 post10_nmtc_project_dollars
flag_count10                    1.000000                   -0.114767
post10_nmtc_project_dollars    -0.114767                    1.000000

Here we can see that our highest data points have a very weak slightly negative to none-existent correlation on their own. Most of our counties with ~1,000 to 4,000 flags have similar amounts of NMTC dollars:

We can view these counties here:

Code
svi_divisional_county_nmtc_projects2 %>% 
  filter(cluster == 1) %>%
  select(county_name, flag_count10, post10_nmtc_dollars_formatted) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_nmtc_dollars_formatted
Bronx County, NY 2688 $306,355,715
Kings County, NY 3869 $216,348,600
New York County, NY 879 $255,545,686
Queens County, NY 2347 $85,225,100
Allegheny County, PA 712 $244,342,400
Philadelphia County, PA 1961 $550,969,964

Now let’s examine the majority of our data for Cluster 2:

Code
# Cluster 2 Scatterplot
# y is our independent variable (NMTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_divisional_county_nmtc_projects2 %>% 
  filter(cluster == 2) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_nmtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_divisional_county_nmtc_projects2 %>% 
  filter(cluster == 2) %>%
  select(flag_count10,post10_nmtc_project_dollars) %>%
  cor(method = "pearson")
                            flag_count10 post10_nmtc_project_dollars
flag_count10                     1.00000                     0.72778
post10_nmtc_project_dollars      0.72778                     1.00000

Here we can find that our correlation actually strengthened, indicating that the majority of our data points are in line with the trends of the overall data.

In addition, it seems the amount of money given to counties in the Middle Atlantic Division with 0 - 1,000 SVI flags is correlated with NMTC dollars from $0 to just over $90 million.

We can view these counties here:

Code
svi_divisional_county_nmtc_projects2 %>% 
  filter(cluster == 2) %>%
  select(county_name, flag_count10, post10_nmtc_dollars_formatted) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_nmtc_dollars_formatted
Bergen County, NJ 146 $10,000,000
Camden County, NJ 332 $79,664,200
Cumberland County, NJ 138 $33,187,593
Essex County, NJ 1019 $81,662,084
Hudson County, NJ 841 $110,136,049
Mercer County, NJ 225 $8,000,000
Middlesex County, NJ 226 $48,700,000
Ocean County, NJ 163 $1,900,000
Passaic County, NJ 447 $49,154,956
Union County, NJ 344 $20,700,000
Albany County, NY 85 $9,625,000
Allegany County, NY 29 $9,300,000
Broome County, NY 131 $5,280,000
Cattaraugus County, NY 44 $6,790,000
Cayuga County, NY 27 $6,240,000
Chautauqua County, NY 76 $39,360,000
Chenango County, NY 19 $58,819,000
Columbia County, NY 14 $9,700,000
Cortland County, NY 12 $2,000,000
Erie County, NY 528 $76,710,000
Monroe County, NY 574 $19,998,000
Nassau County, NY 151 $1,460,000
Onondaga County, NY 352 $20,428,080
Rensselaer County, NY 78 $7,020,000
Schenectady County, NY 68 $11,595,000
St. Lawrence County, NY 75 $1,920,000
Steuben County, NY 58 $7,680,000
Tompkins County, NY 32 $2,643,020
Westchester County, NY 424 $39,580,000
Adams County, PA 5 $14,161,000
Berks County, PA 219 $7,840,000
Clearfield County, PA 44 $26,360,000
Dauphin County, PA 140 $32,123,500
Delaware County, PA 236 $14,190,000
Erie County, PA 184 $7,358,392
Jefferson County, PA 25 $11,453,160
Lackawanna County, PA 107 $19,075,000
Lancaster County, PA 114 $12,514,500
Lebanon County, PA 38 $5,335,000
Lycoming County, PA 55 $25,440,000
Mercer County, PA 54 $18,440,000
Mifflin County, PA 37 $12,130,000
Northampton County, PA 86 $18,260,000
Washington County, PA 76 $12,760,000
Westmoreland County, PA 108 $6,737,500
York County, PA 143 $20,127,500

Thus, we can conclude here that for the majority of the counties in the Middle Atlantic Division, there’s a fairly strong positive correlation between more vulnerable counties receiving more NMTC money than less vulnerable counties.

Bivariate Map

Now let’s plot this relationship spatially:

To begin, we can load our divisional mapping data from Lab 03:

Code
divisional_county_sf <- svi_county_map2010 %>% select(COUNTYFP, STATEFP, geometry)

divisional_county_sf %>% head(5)
Simple feature collection with 5 features and 2 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: -75.14001 ymin: 38.92852 xmax: -73.89398 ymax: 41.13419
Geodetic CRS:  NAD83
  COUNTYFP STATEFP                       geometry
1      001      34 MULTIPOLYGON (((-74.42314 3...
2      003      34 MULTIPOLYGON (((-73.92676 4...
3      005      34 MULTIPOLYGON (((-74.99056 4...
4      007      34 MULTIPOLYGON (((-75.14001 3...
5      009      34 MULTIPOLYGON (((-74.94545 3...
Code
# Join our NMTC projects data with our shapefile geocoordinates
svi_divisional_county_nmtc_sf <- left_join(svi_divisional_county_nmtc_projects, divisional_county_sf, join_by("FIPS_st" == "STATEFP", "FIPS_county" == "COUNTYFP"))

svi_divisional_county_nmtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name geometry
NJ Bergen County Middle Atlantic Division 1 30 10000000 $10,000,000 34003 34 003 New Jersey 1 Northeast Region 2 146 143973 0.0010141 1.0 0.4 165 154365 0.0010689 1.0 0.4 Bergen County, NJ MULTIPOLYGON (((-73.92676 4...
NJ Camden County Middle Atlantic Division 5 47 79664200 $79,664,200 34007 34 007 New Jersey 1 Northeast Region 2 332 183630 0.0018080 1.0 1.0 315 180659 0.0017436 1.0 0.8 Camden County, NJ MULTIPOLYGON (((-75.14001 3...
NJ Cumberland County Middle Atlantic Division 2 21 33187593 $33,187,593 34011 34 011 New Jersey 1 Northeast Region 2 138 101151 0.0013643 0.8 0.6 135 97989 0.0013777 0.8 0.6 Cumberland County, NJ MULTIPOLYGON (((-75.1145 39...
NJ Essex County Middle Atlantic Division 6 115 81662084 $81,662,084 34013 34 013 New Jersey 1 Northeast Region 2 1019 385872 0.0026408 1.0 1.0 1039 385359 0.0026962 1.0 1.0 Essex County, NJ MULTIPOLYGON (((-74.13892 4...
NJ Hudson County Middle Atlantic Division 5 100 110136049 $110,136,049 34017 34 017 New Jersey 1 Northeast Region 2 841 385737 0.0021802 1.0 1.0 802 404100 0.0019847 1.0 1.0 Hudson County, NJ MULTIPOLYGON (((-74.02039 4...
Code
# Create classes for bivariate mapping 
svi_divisional_county_nmtc_sf <- bi_class(svi_divisional_county_nmtc_sf, x = flag_count10, y = post10_nmtc_project_dollars, style = "quantile", dim = 3)

# View data
svi_divisional_county_nmtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_nmtc_project_cnt tract_cnt post10_nmtc_project_dollars post10_nmtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name geometry bi_class
NJ Bergen County Middle Atlantic Division 1 30 10000000 $10,000,000 34003 34 003 New Jersey 1 Northeast Region 2 146 143973 0.0010141 1.0 0.4 165 154365 0.0010689 1.0 0.4 Bergen County, NJ MULTIPOLYGON (((-73.92676 4... 2-2
NJ Camden County Middle Atlantic Division 5 47 79664200 $79,664,200 34007 34 007 New Jersey 1 Northeast Region 2 332 183630 0.0018080 1.0 1.0 315 180659 0.0017436 1.0 0.8 Camden County, NJ MULTIPOLYGON (((-75.14001 3... 3-3
NJ Cumberland County Middle Atlantic Division 2 21 33187593 $33,187,593 34011 34 011 New Jersey 1 Northeast Region 2 138 101151 0.0013643 0.8 0.6 135 97989 0.0013777 0.8 0.6 Cumberland County, NJ MULTIPOLYGON (((-75.1145 39... 2-3
NJ Essex County Middle Atlantic Division 6 115 81662084 $81,662,084 34013 34 013 New Jersey 1 Northeast Region 2 1019 385872 0.0026408 1.0 1.0 1039 385359 0.0026962 1.0 1.0 Essex County, NJ MULTIPOLYGON (((-74.13892 4... 3-3
NJ Hudson County Middle Atlantic Division 5 100 110136049 $110,136,049 34017 34 017 New Jersey 1 Northeast Region 2 841 385737 0.0021802 1.0 1.0 802 404100 0.0019847 1.0 1.0 Hudson County, NJ MULTIPOLYGON (((-74.02039 4... 3-3

Finally we can create our map:

Code
# Create map with ggplot
svi_divisional_county_nmtc_map <- ggplot() +
  # Map county shapefile, fill with bi_class categories
  geom_sf(data = svi_divisional_county_nmtc_sf, mapping = aes(geometry=geometry, fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) +
  # Set to biscale palette
  bi_scale_fill(pal = "GrPink", dim = 3) +
  # Add state shapefiles for outline
  geom_sf(data=divisional_st_sf, color="black", fill=NA, linewidth=.5, aes(geometry=geometry)) +
  labs(
    title = paste0("Correlation of 2010 ", census_division, " SVI Flag Count \n and 2011 - 2020 NMTC Tax Dollars"),
  ) +
  # Set them to biscale
  bi_theme(base_size = 10)

# Create biscale legend
svi_divisional_county_nmtc_legend <- bi_legend(pal = "GrPink",
                    dim = 3,
                    xlab = "SVI Flag Count",
                    ylab = "NMTC Dollars",
                    size = 8)

# Combine map with legend using cowplot
svi_divisional_county_nmtc_bivarmap <- ggdraw() +
  draw_plot(svi_divisional_county_nmtc_map) +
  # Set legend location
  draw_plot(svi_divisional_county_nmtc_legend, x= -.02,  y = -.05,
 width=.20)


# View map
svi_divisional_county_nmtc_bivarmap

Here we can see the distribution of our counties with NMTC projects based on the correlation between 2010 SVI Flag Count and NMTC dollars for the Middle Atlantic Division.

Here we can see that our high NMTC dollars and high SVI flag counts are largely clustered in the NYC metro area across NY and NJ:

Code
svi_divisional_county_nmtc_sf %>% filter(State %in% c("NY", "NJ")) %>% select(State, County, flag_count10, post10_nmtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County flag_count10 post10_nmtc_dollars_formatted
NY Kings County 3869 $216,348,600
NY Bronx County 2688 $306,355,715
NY Queens County 2347 $85,225,100
NJ Essex County 1019 $81,662,084
NY New York County 879 $255,545,686
NJ Hudson County 841 $110,136,049

In contrast, on a divisional level PA has several counties with low SVI flag counts, but moderate-to-high NMTC dollars

Code
svi_divisional_county_nmtc_sf %>% filter(State == "PA") %>%
  arrange(desc(post10_nmtc_project_dollars), flag_count10) %>% select(State, County, flag_count10, post10_nmtc_dollars_formatted) %>% head(10) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County flag_count10 post10_nmtc_dollars_formatted
PA Philadelphia County 1961 $550,969,964
PA Allegheny County 712 $244,342,400
PA Dauphin County 140 $32,123,500
PA Clearfield County 44 $26,360,000
PA Lycoming County 55 $25,440,000
PA York County 143 $20,127,500
PA Lackawanna County 107 $19,075,000
PA Mercer County 54 $18,440,000
PA Northampton County 86 $18,260,000
PA Delaware County 236 $14,190,000

LIHTC

Correlation between outcome & intervention

We can now repeat our divisional analysis for the LIHTC to identify if there is a relationship between dollars counties received from this program and the SVI flags.

Recall that we will want to review our summary statistics, a scatterplot, and a calculation of Pearson’s r to measure the correlation.

First let’s create a dataset of only counties with LIHTC projects:

Code
svi_divisional_county_lihtc_projects <- svi_divisional_county_lihtc %>% filter(post10_lihtc_project_cnt > 0)

Check division:

Code
svi_divisional_county_lihtc_projects %>% select(Division) %>% unique()
                  Division
1 Middle Atlantic Division

Now let’s review the summary statistics for our data set:

Code
summary(svi_divisional_county_lihtc_projects$flag_count10)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   1.00   22.75   66.50  140.82  169.50 1154.00 
Code
summary(svi_divisional_county_lihtc_projects$post10_lihtc_project_dollars)
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
       0  1197587  2015493  4533949  4904236 26054976 

Note once again that unlike the NMTC program, there are instances where there are tracts with LIHTC projects, but they did not receive any funding. We want to filter these out of our data set for the purposes of our analysis of the relationship between LIHTC dollars and the SVI flags.

Code
svi_divisional_county_lihtc_projects <- svi_divisional_county_lihtc_projects %>% filter(post10_lihtc_project_dollars > 0)

Now we can view the updated summaries:

Code
summary(svi_divisional_county_lihtc_projects$flag_count10)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
    1.0    20.0    66.0   142.9   170.0  1154.0 
Code
summary(svi_divisional_county_lihtc_projects$post10_lihtc_project_dollars)
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
   78558  1317572  2220667  4671341  4944903 26054976 

The minimum flag count for the LIHTC program in the Middle Atlantic Division is 1 and the maximum is only 1,154 compared to 5 - 3,869 for NMTC. The LIHTC dollar amount range is $78,558 to over $26 million.

Once again, let’s view this visually in a scatterplot:

Code
# Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_divisional_county_lihtc_projects,
                aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_divisional_county_lihtc_projects$flag_count10, svi_divisional_county_lihtc_projects$post10_lihtc_project_dollars, method = "pearson")
[1] 0.8106627

When we consider ALL counties in the Middle Atlantic Division, we have a very strong positive correlation between SVI Flag Counts in 2010 and and LIHTC dollars from 2011-2020, suggesting that counties that had more social vulnerability in 2010 received more LIHTC dollars in 2011-2020.

However, from visual inspection it appears we have an influential point in our data as well as some scatter.

Let’s explore this in a box plot:

Code
boxplot(svi_divisional_county_lihtc_projects$flag_count10)

Code
boxplot.stats(svi_divisional_county_lihtc_projects$flag_count10)$out %>% sort(decreasing = TRUE)
[1] 1154  570  471

This is our same influential point from our NMTC analysis, Kings County, NY:

Code
svi_divisional_county_lihtc_projects %>% filter(flag_count10 == 1154) %>% select(county_name, flag_count10, post10_lihtc_dollars_formatted) %>% head() 
       county_name flag_count10 post10_lihtc_dollars_formatted
1 Kings County, NY         1154                    $26,054,976

K-Means Clustering

Now let’s conduct a cluster analysis:

Code
svi_divisional_lihtc_cluster <- svi_divisional_county_lihtc_projects %>% 
                            select(county_name, post10_lihtc_project_dollars, 
                                   flag_count10) %>% 
                            remove_rownames %>% 
                            column_to_rownames(var="county_name")

# Remove nulls, if in dataset
svi_divisional_lihtc_cluster <- na.omit(svi_divisional_lihtc_cluster)


# Scale numeric variables
svi_divisional_lihtc_cluster <- scale(svi_divisional_lihtc_cluster)


svi_divisional_lihtc_cluster %>% head(5)
                     post10_lihtc_project_dollars flag_count10
Atlantic County, NJ                   -0.52731441   -0.4795562
Essex County, NJ                       0.45524835    1.8980244
Mercer County, NJ                     -0.76318273   -0.3151254
Middlesex County, NJ                  -0.48543941   -0.1240301
Passaic County, NJ                    -0.01772409    0.2714926

Next we can try a few different cluster numbers and allow the algorithm to search through 25 sets to identify the best groupings for each number:

Code
set.seed(123)
k2_lihtc_div <- kmeans(svi_divisional_lihtc_cluster, centers = 2, nstart = 25)
set.seed(123)
k3_lihtc_div <- kmeans(svi_divisional_lihtc_cluster, centers = 3, nstart = 25)
set.seed(123)
k4_lihtc_div <- kmeans(svi_divisional_lihtc_cluster, centers = 4, nstart = 25)
set.seed(123)
k5_lihtc_div <- kmeans(svi_divisional_lihtc_cluster, centers = 5, nstart = 25)

Next we can view the plots to visually check the groupings and see if there’s any overlap:

Code
# plots to compare
p_k2_lihtc_div <- factoextra::fviz_cluster(k2_lihtc_div, geom = "point", data = svi_divisional_lihtc_cluster) + ggtitle("k = 2")

p_k3_lihtc_div <- factoextra::fviz_cluster(k3_lihtc_div, geom = "point", data = svi_divisional_lihtc_cluster) + ggtitle("k = 3")

p_k4_lihtc_div <- factoextra::fviz_cluster(k4_lihtc_div, geom = "point",  data = svi_divisional_lihtc_cluster) + ggtitle("k = 4")

p_k5_lihtc_div <- factoextra::fviz_cluster(k5_lihtc_div, geom = "point",  data = svi_divisional_lihtc_cluster) + ggtitle("k = 5")

grid.arrange(p_k2_lihtc_div, p_k3_lihtc_div, p_k4_lihtc_div, p_k5_lihtc_div, nrow = 2)

Similar to NMTC, it appears it may be best to divide our data into 2 clusters, but let’s check our Elbow Plot:

Code
elbow_plot(svi_divisional_lihtc_cluster)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15

Here we can see that the spacing between clusters actually decreases substantially after 3. Thus, we will go with 3 clusters for LIHTC for the Middle Atlantic Division:

Code
p_k3_lihtc_div <- factoextra::fviz_cluster(k3_lihtc_div, geom = "point", data = svi_divisional_lihtc_cluster) + ggtitle("k = 3")

p_k3_lihtc_div

We can then transform our cluster matrix back to a data frame and assign these clusters to our counties:

Code
svi_divisional_lihtc_cluster_label <- as.data.frame(svi_divisional_lihtc_cluster) %>%
                                  rownames_to_column(var = "county_name") %>%
                                  as_tibble() %>%
                                  mutate(cluster = k3_lihtc_div$cluster) %>%
                                  select(county_name, cluster)

svi_divisional_county_lihtc_projects2 <- left_join(svi_divisional_county_lihtc_projects, svi_divisional_lihtc_cluster_label, join_by(county_name == county_name))

# View county counts in each cluster
table(svi_divisional_county_lihtc_projects2$cluster)

 1  2  3 
26  6  1 

Now we can re-examine the correlation between 2010 SVI Flag Counts and LIHTC Project Dollars for each subset of our data.

First recall our overall outcomes:

Code
# Overall Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)
ggplot2::ggplot(svi_divisional_county_lihtc_projects2,
                aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
# Pearson's r calculation
cor(svi_divisional_county_lihtc_projects2$flag_count10, svi_divisional_county_lihtc_projects2$post10_lihtc_project_dollars, method = "pearson")
[1] 0.8106627

First let’s look at our cluster 1 data (bottom left cluster):

Code
# Cluster 1 Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_divisional_county_lihtc_projects2 %>% 
  filter(cluster == 1) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_divisional_county_lihtc_projects2 %>% 
  filter(cluster == 1) %>%
  select(flag_count10,post10_lihtc_project_dollars) %>%
  cor(method = "pearson")
                             flag_count10 post10_lihtc_project_dollars
flag_count10                    1.0000000                    0.5231078
post10_lihtc_project_dollars    0.5231078                    1.0000000

Here we can find that we still have a positive correlation, though it has weakened to a moderate correlation from very strong. Thus, we can conlude that Kings County, NY is indeed an influential point that pulls our regression line and correlation to be stronger than the trend of the majority of our data.

Now let’s examine our middle points in Cluster 2:

Code
# Cluster 2 Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_divisional_county_lihtc_projects2 %>% 
  filter(cluster == 2) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_divisional_county_lihtc_projects2 %>% 
  filter(cluster == 2) %>%
  select(flag_count10,post10_lihtc_project_dollars) %>%
  cor(method = "pearson")
                             flag_count10 post10_lihtc_project_dollars
flag_count10                  1.000000000                 -0.008926241
post10_lihtc_project_dollars -0.008926241                  1.000000000

Here we can see that our data is too scattered to identify a correlation.

Finally, let’s look at our upper end county data in cluster 3:

Code
# Cluster 3 Scatterplot
# y is our independent variable (LIHTC Project Dollars),  
# x is our dependent variable (SVI flag count)

svi_divisional_county_lihtc_projects2 %>% 
  filter(cluster == 3) %>%
  ggplot2::ggplot(aes(x=flag_count10,
                    y=post10_lihtc_project_dollars)) +
        geom_point() +
        geom_smooth(method="lm") +
        scale_y_continuous(labels = scales::dollar_format()) 

Code
svi_divisional_county_lihtc_projects2 %>% 
  filter(cluster == 3) %>%
  select(flag_count10,post10_lihtc_project_dollars) %>%
  cor(method = "pearson")
                             flag_count10 post10_lihtc_project_dollars
flag_count10                           NA                           NA
post10_lihtc_project_dollars           NA                           NA

With only one point, Kings County, NY, we cannot calculate a correlation.

Code
svi_divisional_county_lihtc_projects2 %>% 
  filter(cluster == 3) %>%
  select(county_name, flag_count10, post10_lihtc_dollars_formatted) %>% 
  arrange(desc(flag_count10)) %>% head(10) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
county_name flag_count10 post10_lihtc_dollars_formatted
Kings County, NY 1154 $26,054,976

Thus, we can conclude that the majority of our data follows the trend of a positive correlation between 2010 SVI Flag Counts and LIHTC dollars in our division. However, this relationship weakens for counties with mid-range vulnerability and dollars received.

Bivariate Map

Now let’s view this relationship spatially by creating a bivariate map.

Code
# Join our LIHTC projects data with our shapefile geocoordinates
svi_divisional_county_lihtc_sf <- left_join(svi_divisional_county_lihtc_projects, divisional_county_sf, join_by("FIPS_st" == "STATEFP", "FIPS_county" == "COUNTYFP"))

svi_divisional_county_lihtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name geometry
NJ Atlantic County Middle Atlantic Division 1 3 1497998 $1,497,998 34001 34 001 New Jersey 1 Northeast Region 2 35 7939 0.0044086 0.8 1.0 37 8027 0.0046094 0.8 1.0 Atlantic County, NJ MULTIPOLYGON (((-74.42314 3...
NJ Essex County Middle Atlantic Division 6 60 7410996 $7,410,996 34013 34 013 New Jersey 1 Northeast Region 2 570 190447 0.0029930 1.0 0.8 577 189347 0.0030473 1.0 0.8 Essex County, NJ MULTIPOLYGON (((-74.13892 4...
NJ Mercer County Middle Atlantic Division 3 8 78558 $78,558 34021 34 021 New Jersey 1 Northeast Region 2 72 23722 0.0030352 1.0 0.8 79 22886 0.0034519 1.0 1.0 Mercer County, NJ MULTIPOLYGON (((-74.77831 4...
NJ Middlesex County Middle Atlantic Division 1 13 1749999 $1,749,999 34023 34 023 New Jersey 1 Northeast Region 2 115 61228 0.0018782 1.0 0.4 114 64219 0.0017752 1.0 0.4 Middlesex County, NJ MULTIPOLYGON (((-74.20896 4...
NJ Passaic County Middle Atlantic Division 5 20 4564679 $4,564,679 34031 34 031 New Jersey 1 Northeast Region 2 204 86099 0.0023694 1.0 0.6 200 88872 0.0022504 1.0 0.6 Passaic County, NJ MULTIPOLYGON (((-74.38946 4...
Code
# Create classes for bivariate mapping 
svi_divisional_county_lihtc_sf <- bi_class(svi_divisional_county_lihtc_sf, x = flag_count10, y = post10_lihtc_project_dollars, style = "quantile", dim = 3)

# View data
svi_divisional_county_lihtc_sf %>% head(5) %>% kbl() %>% kable_styling() %>% scroll_box(width = "100%")
State County Division post10_lihtc_project_cnt tract_cnt post10_lihtc_project_dollars post10_lihtc_dollars_formatted fips_county_st FIPS_st FIPS_county state_name region_number region division_number flag_count10 pop10 flag_by_pop10 flag_count_quantile10 flag_pop_quantile10 flag_count20 pop20 flag_by_pop20 flag_count_quantile20 flag_pop_quantile20 county_name geometry bi_class
NJ Atlantic County Middle Atlantic Division 1 3 1497998 $1,497,998 34001 34 001 New Jersey 1 Northeast Region 2 35 7939 0.0044086 0.8 1.0 37 8027 0.0046094 0.8 1.0 Atlantic County, NJ MULTIPOLYGON (((-74.42314 3... 1-1
NJ Essex County Middle Atlantic Division 6 60 7410996 $7,410,996 34013 34 013 New Jersey 1 Northeast Region 2 570 190447 0.0029930 1.0 0.8 577 189347 0.0030473 1.0 0.8 Essex County, NJ MULTIPOLYGON (((-74.13892 4... 3-3
NJ Mercer County Middle Atlantic Division 3 8 78558 $78,558 34021 34 021 New Jersey 1 Northeast Region 2 72 23722 0.0030352 1.0 0.8 79 22886 0.0034519 1.0 1.0 Mercer County, NJ MULTIPOLYGON (((-74.77831 4... 2-1
NJ Middlesex County Middle Atlantic Division 1 13 1749999 $1,749,999 34023 34 023 New Jersey 1 Northeast Region 2 115 61228 0.0018782 1.0 0.4 114 64219 0.0017752 1.0 0.4 Middlesex County, NJ MULTIPOLYGON (((-74.20896 4... 2-2
NJ Passaic County Middle Atlantic Division 5 20 4564679 $4,564,679 34031 34 031 New Jersey 1 Northeast Region 2 204 86099 0.0023694 1.0 0.6 200 88872 0.0022504 1.0 0.6 Passaic County, NJ MULTIPOLYGON (((-74.38946 4... 3-3

Finally we can create our map:

Code
# Create map with ggplot
svi_divisional_county_lihtc_map <- ggplot() +
  # Map county shapefile, fill with bi_class categories
  geom_sf(data = svi_divisional_county_lihtc_sf, mapping = aes(geometry=geometry, fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) +
  # Set to biscale palette
  bi_scale_fill(pal = "GrPink", dim = 3) +
  # Add state shapefiles for outline
  geom_sf(data=divisional_st_sf, color="black", fill=NA, linewidth=.5, aes(geometry=geometry)) +
  labs(
    title = paste0("Correlation of 2010 ", census_division, " SVI Flag Count \n and 2011 - 2020 LIHTC Tax Dollars")
  ) +
  # Set them to biscale
  bi_theme(base_size = 10)

# Create biscale legend
svi_divisional_county_lihtc_legend <- bi_legend(pal = "GrPink",
                    dim = 3,
                    xlab = "SVI Flag Count",
                    ylab = "LIHTC Dollars",
                    size = 8)

# Combine map with legend using cowplot
svi_divisional_county_lihtc_bivarmap <- ggdraw() +
  draw_plot(svi_divisional_county_lihtc_map) +
  # Set legend location
  draw_plot(svi_divisional_county_lihtc_legend, x= -.02,  y = -.05,
 width=.20)


# View map
svi_divisional_county_lihtc_bivarmap

Here we can see the distribution of our LIHTC counties is quite a bit less than our NMTC projects as we would expect based on national trends.

Several of our counties in NY have either both moderate SVI flag count and moderate LIHTC dollars count or high SVI flag count and high LIHTC dollars.

The NYC, Pittsburgh, and Philadelphia metros have high SVI flag and high LIHTC dollars:

Code
svi_divisional_county_lihtc_sf %>% filter(State == "NY") %>% select(State, County, flag_count10, post10_lihtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State          County flag_count10 post10_lihtc_dollars_formatted
1    NY    Kings County         1154                    $26,054,976
2    NY    Bronx County          471                    $19,909,800
3    NY   Queens County          310                     $4,094,899
4    NY New York County          206                     $9,337,368
5    NY   Monroe County          170                     $4,944,903
6    NY     Erie County          168                     $2,220,667
Code
svi_divisional_county_lihtc_sf %>% filter(State == "NJ") %>% select(State, County, flag_count10, post10_lihtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State           County flag_count10 post10_lihtc_dollars_formatted
1    NJ     Essex County          570                     $7,410,996
2    NJ   Passaic County          204                     $4,564,679
3    NJ Middlesex County          115                     $1,749,999
4    NJ    Mercer County           72                        $78,558
5    NJ     Union County           66                     $6,296,201
6    NJ  Atlantic County           35                     $1,497,998
Code
svi_divisional_county_lihtc_sf %>% filter(State == "PA") %>% select(State, County, flag_count10, post10_lihtc_dollars_formatted) %>% arrange(desc(flag_count10)) %>% head(6)
  State              County flag_count10 post10_lihtc_dollars_formatted
1    PA Philadelphia County          261                     $6,805,843
2    PA    Allegheny County          185                     $8,889,633
3    PA         Erie County           70                       $944,622
4    PA        Berks County           50                       $705,044
5    PA     Delaware County           31                     $3,437,127
6    PA        Blair County           10                       $736,262

Save data sets

Code
saveRDS(svi_divisional_lihtc, file = here::here(paste0("data/wrangling/", str_replace_all(census_division, " ", "_"), "_svi_divisional_lihtc.rds")))

saveRDS(svi_national_lihtc, file = here::here(paste0("data/wrangling/", str_replace_all(census_division, " ", "_"), "_svi_national_lihtc.rds")))

saveRDS(svi_divisional_nmtc, file = here::here(paste0("data/wrangling/", str_replace_all(census_division, " ", "_"), "_svi_divisional_nmtc.rds")))

saveRDS(svi_national_nmtc, file = here::here(paste0("data/wrangling/", str_replace_all(census_division, " ", "_"), "_svi_national_nmtc.rds")))

Lab Submission Instructions

Congratulations! You’ve reached the end of the Lab-04 Tutorial!

You are now ready to complete your lab and submit it on Canvas.

Note

Your import step in your .RMD file should look similar to the code chunk below, but your project_data_steps.R file should have your initials on the end (i.e. project_data_steps_CS.R).

Code
import::here( "fips_census_regions",
              "load_svi_data",
              "merge_svi_data",
              "census_division",
              "flag_summarize",
              "summarize_county_nmtc",
              "summarize_county_lihtc",
              "elbow_plot",
             # notice the use of here::here() that points to the .R file
             # where all these R objects are created
             .from = here::here("analysis/project_data_steps.R"),
             .character_only = TRUE)

The following checklist will ensure that you’re on track:

Add newly created graphing and data wrangling functions to project_data_steps.R file
Create new .RMD file and load data and functions from project_data_steps.R file
Create 2 NMTC data sets on a national and census-division level
Calculate overall correlation between SVI Flag Count in 2010 and NMTC Dollars received from 2011-2020 by county for your Census Division, describe findings
Conduct k-means clustering and calculate the correlation between SVI Flag Count in 2010 and NMTC Dollars received from 2011-2020 by clustered county group for your Census Division, describe findings
Create bivariate map of SVI Flag Count in 2010 and NMTC Dollars received for your Census Division
Create 2 LIHTC data sets on a national and census-division level
Calculate overall correlation between SVI Flag Count in 2010 and LIHTC Dollars received from 2011-2020 by county for your Census Division, describe findings
Conduct k-means clustering and calculate the correlation between SVI Flag Count in 2010 and LIHTC Dollars received from 2011-2020 by clustered county group for your Census Division, describe findings <br Create bivariate map of SVI Flag Count in 2010 and LIHTC Dollars received for your Census Division
Apply code chunk options to hide any unwanted warnings/messages
Knit .RMD file to create .HTML and .md (Github Flavored) for output
Review example report to get a general idea of what your output should look like
Submit project_data_steps.R, .RMD, .HTML, and .MD files to Canvas
Treat yourself for a job well-done!