From 4d9c1dd11e838008f6ba01d9fe896413c6ef7a10 Mon Sep 17 00:00:00 2001 From: "sam powers (usds)" <121890478+sampowers-usds@users.noreply.github.com> Date: Thu, 2 Mar 2023 15:15:36 -0500 Subject: [PATCH] 2119 there are a few tracts places where the values over the 90th percentile are not showing as blue (#2160) * ipython notebook to debug greenspace indicator * changing greenspace and income to just greenspace * fixing greenspace indicator to not include low income * Update greenspace_indicator.ipynb * running tox checks * update score narwhal to pass smoke test (fix donut threshold) --------- Co-authored-by: Travis Newby --- .../data_pipeline/etl/score/constants.py | 2 +- .../ipython/greenspace_indicator.ipynb | 2686 +++++++++++++++++ .../data_pipeline/score/score_narwhal.py | 16 +- 3 files changed, 2698 insertions(+), 6 deletions(-) create mode 100644 data/data-pipeline/data_pipeline/ipython/greenspace_indicator.ipynb diff --git a/data/data-pipeline/data_pipeline/etl/score/constants.py b/data/data-pipeline/data_pipeline/etl/score/constants.py index 199285c9..ea63f854 100644 --- a/data/data-pipeline/data_pipeline/etl/score/constants.py +++ b/data/data-pipeline/data_pipeline/etl/score/constants.py @@ -353,7 +353,7 @@ TILES_SCORE_COLUMNS = { field_names.ADJACENT_TRACT_SCORE_ABOVE_DONUT_THRESHOLD: "ADJ_ET", field_names.TRACT_PERCENT_NON_NATURAL_FIELD_NAME + field_names.PERCENTILE_FIELD_SUFFIX: "IS_PFS", - field_names.NON_NATURAL_LOW_INCOME_FIELD_NAME: "IS_ET", + field_names.NON_NATURAL_PCTILE_THRESHOLD: "IS_ET", # NON_NATURAL_LOW_INCOME_FIELD_NAME field_names.AML_BOOLEAN_FILLED_IN: "AML_ET", field_names.ELIGIBLE_FUDS_BINARY_FIELD_NAME: "FUDS_RAW", field_names.ELIGIBLE_FUDS_FILLED_IN_FIELD_NAME: "FUDS_ET", diff --git a/data/data-pipeline/data_pipeline/ipython/greenspace_indicator.ipynb b/data/data-pipeline/data_pipeline/ipython/greenspace_indicator.ipynb new file mode 100644 index 00000000..25bc3fe7 --- /dev/null +++ b/data/data-pipeline/data_pipeline/ipython/greenspace_indicator.ipynb @@ -0,0 +1,2686 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "72828ab5", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "── \u001b[1mAttaching packages\u001b[22m ─────────────────────────────────────── tidyverse 1.3.0 ──\n", + "\n", + "\u001b[32m✔\u001b[39m \u001b[34mggplot2\u001b[39m 3.3.6 \u001b[32m✔\u001b[39m \u001b[34mpurrr \u001b[39m 0.3.4\n", + "\u001b[32m✔\u001b[39m \u001b[34mtibble \u001b[39m 3.1.0 \u001b[32m✔\u001b[39m \u001b[34mdplyr \u001b[39m 1.0.5\n", + "\u001b[32m✔\u001b[39m \u001b[34mtidyr \u001b[39m 1.1.3 \u001b[32m✔\u001b[39m \u001b[34mstringr\u001b[39m 1.4.0\n", + "\u001b[32m✔\u001b[39m \u001b[34mreadr \u001b[39m 1.4.0 \u001b[32m✔\u001b[39m \u001b[34mforcats\u001b[39m 0.5.1\n", + "\n", + "── \u001b[1mConflicts\u001b[22m ────────────────────────────────────────── tidyverse_conflicts() ──\n", + "\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mfilter()\u001b[39m masks \u001b[34mstats\u001b[39m::filter()\n", + "\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mlag()\u001b[39m masks \u001b[34mstats\u001b[39m::lag()\n", + "\n" + ] + } + ], + "source": [ + "library(tidyverse)\n", + "library(rjson)" + ] + }, + { + "cell_type": "markdown", + "id": "8ade6145", + "metadata": {}, + "source": [ + "Read in the downloaded data set" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "896cb958", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "\u001b[36m──\u001b[39m \u001b[1m\u001b[1mColumn specification\u001b[1m\u001b[22m \u001b[36m────────────────────────────────────────────────────────\u001b[39m\n", + "cols(\n", + " GEOID10_TRACT = \u001b[32mcol_double()\u001b[39m,\n", + " `Does the tract have at least 35 acres in it?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Share of the tract's land area that is covered by impervious surface as a percent` = \u001b[32mcol_double()\u001b[39m,\n", + " `Share of the tract's land area that is covered by impervious surface or cropland as a percent` = \u001b[32mcol_double()\u001b[39m,\n", + " `Share of the tract's land area that is covered by cropland as a percent` = \u001b[32mcol_double()\u001b[39m\n", + ")\n", + "\n", + "\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "
A tibble: 6 × 5
GEOID10_TRACTDoes the tract have at least 35 acres in it?Share of the tract's land area that is covered by impervious surface as a percentShare of the tract's land area that is covered by impervious surface or cropland as a percentShare of the tract's land area that is covered by cropland as a percent
<dbl><lgl><dbl><dbl><dbl>
27139080202TRUE37.361037.5887 0.227730
27139080204TRUE26.897927.6588 0.760943
27139080100TRUE39.451639.9349 0.483341
27139080302TRUE18.260537.639119.378600
27139080400TRUE47.438148.4268 0.988653
27139080500TRUE42.809943.9226 1.112750
\n" + ], + "text/latex": [ + "A tibble: 6 × 5\n", + "\\begin{tabular}{lllll}\n", + " GEOID10\\_TRACT & Does the tract have at least 35 acres in it? & Share of the tract's land area that is covered by impervious surface as a percent & Share of the tract's land area that is covered by impervious surface or cropland as a percent & Share of the tract's land area that is covered by cropland as a percent\\\\\n", + " & & & & \\\\\n", + "\\hline\n", + "\t 27139080202 & TRUE & 37.3610 & 37.5887 & 0.227730\\\\\n", + "\t 27139080204 & TRUE & 26.8979 & 27.6588 & 0.760943\\\\\n", + "\t 27139080100 & TRUE & 39.4516 & 39.9349 & 0.483341\\\\\n", + "\t 27139080302 & TRUE & 18.2605 & 37.6391 & 19.378600\\\\\n", + "\t 27139080400 & TRUE & 47.4381 & 48.4268 & 0.988653\\\\\n", + "\t 27139080500 & TRUE & 42.8099 & 43.9226 & 1.112750\\\\\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 6 × 5\n", + "\n", + "| GEOID10_TRACT <dbl> | Does the tract have at least 35 acres in it? <lgl> | Share of the tract's land area that is covered by impervious surface as a percent <dbl> | Share of the tract's land area that is covered by impervious surface or cropland as a percent <dbl> | Share of the tract's land area that is covered by cropland as a percent <dbl> |\n", + "|---|---|---|---|---|\n", + "| 27139080202 | TRUE | 37.3610 | 37.5887 | 0.227730 |\n", + "| 27139080204 | TRUE | 26.8979 | 27.6588 | 0.760943 |\n", + "| 27139080100 | TRUE | 39.4516 | 39.9349 | 0.483341 |\n", + "| 27139080302 | TRUE | 18.2605 | 37.6391 | 19.378600 |\n", + "| 27139080400 | TRUE | 47.4381 | 48.4268 | 0.988653 |\n", + "| 27139080500 | TRUE | 42.8099 | 43.9226 | 1.112750 |\n", + "\n" + ], + "text/plain": [ + " GEOID10_TRACT Does the tract have at least 35 acres in it?\n", + "1 27139080202 TRUE \n", + "2 27139080204 TRUE \n", + "3 27139080100 TRUE \n", + "4 27139080302 TRUE \n", + "5 27139080400 TRUE \n", + "6 27139080500 TRUE \n", + " Share of the tract's land area that is covered by impervious surface as a percent\n", + "1 37.3610 \n", + "2 26.8979 \n", + "3 39.4516 \n", + "4 18.2605 \n", + "5 47.4381 \n", + "6 42.8099 \n", + " Share of the tract's land area that is covered by impervious surface or cropland as a percent\n", + "1 37.5887 \n", + "2 27.6588 \n", + "3 39.9349 \n", + "4 37.6391 \n", + "5 48.4268 \n", + "6 43.9226 \n", + " Share of the tract's land area that is covered by cropland as a percent\n", + "1 0.227730 \n", + "2 0.760943 \n", + "3 0.483341 \n", + "4 19.378600 \n", + "5 0.988653 \n", + "6 1.112750 " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "nlcd_dat_path = list.files(\"../data/dataset/nlcd_nature_deprived\", full.names = TRUE)\n", + "nlcd_raw_dat = read_csv(nlcd_dat_path)\n", + "head(nlcd_raw_dat)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "99ea6633", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "0" + ], + "text/latex": [ + "0" + ], + "text/markdown": [ + "0" + ], + "text/plain": [ + "[1] 0" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "72539" + ], + "text/latex": [ + "72539" + ], + "text/markdown": [ + "72539" + ], + "text/plain": [ + "[1] 72539" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "impervious_in = pull(nlcd_raw_dat,4) ## impervious surfaces or cropland\n", + "sum(impervious_in[is.na(impervious_in)]) ## check for missing data\n", + "length(impervious_in)\n", + "sum(impervious_in >= quantile(impervious_in, .9)) ## calculate the number at or above 90th percentile" + ] + }, + { + "cell_type": "markdown", + "id": "f9489512", + "metadata": {}, + "source": [ + "There are 7254 tracts in the read in that have an impervious surface percent above the 90%" + ] + }, + { + "cell_type": "markdown", + "id": "61a16a12", + "metadata": {}, + "source": [ + " Then the data gets pulled into an ETL process and combined into one data set where scores are calculated. Lets check that output.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "a8a4fb7b", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "\u001b[36m──\u001b[39m \u001b[1m\u001b[1mColumn specification\u001b[1m\u001b[22m \u001b[36m────────────────────────────────────────────────────────\u001b[39m\n", + "cols(\n", + " .default = col_double(),\n", + " GEOID10_TRACT = \u001b[31mcol_character()\u001b[39m,\n", + " `Does the tract have at least 35 acres in it?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Contains agricultural value` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Names of Tribal areas within Census tract` = \u001b[31mcol_character()\u001b[39m,\n", + " `Percent individuals age 25 or over with less than high school degree in 2009` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Percentage households below 100% of federal poverty line in 2009` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Unemployment (percent) in 2009` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Total population in 2009` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Number of Tribal areas within Census tract for Alaska` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Number of Tribal areas within Census tract` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Median household income as a percent of territory median income in 2009` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Is there at least one abandoned mine in this census tract?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Income data has been estimated based on neighbor income` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Is there at least one Formerly Used Defense Site (FUDS) in the tract?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Tract-level redlining score meets or exceeds 3.25` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Identified as disadvantaged due to tribal overlap` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Percent individuals age 25 or over with less than high school degree in 2009 (percentile)` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Percentage households below 100% of federal poverty line in 2009 (percentile)` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Unemployment (percent) in 2009 (percentile)` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Total population in 2009 (percentile)` = \u001b[33mcol_logical()\u001b[39m\n", + " # ... with 103 more columns\n", + ")\n", + "\u001b[36mℹ\u001b[39m Use \u001b[30m\u001b[47m\u001b[30m\u001b[47m`spec()`\u001b[47m\u001b[30m\u001b[49m\u001b[39m for the full column specifications.\n", + "\n", + "\n", + "Warning message:\n", + "“2219 parsing failures.\n", + " row col expected actual file\n", + "1182 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 1.0 '../data/score/csv/full/usa.csv'\n", + "1182 Number of Tribal areas within Census tract for Alaska (percentile) 1/0/T/F/TRUE/FALSE 0.19230769230769232 '../data/score/csv/full/usa.csv'\n", + "1183 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 4.0 '../data/score/csv/full/usa.csv'\n", + "1183 Number of Tribal areas within Census tract for Alaska (percentile) 1/0/T/F/TRUE/FALSE 0.6634615384615384 '../data/score/csv/full/usa.csv'\n", + "1184 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 3.0 '../data/score/csv/full/usa.csv'\n", + ".... .................................................................. .................. ................... ................................\n", + "See problems(...) for more details.\n", + "”\n" + ] + } + ], + "source": [ + "score_data_full_path = list.files(\"../data/score/csv/full\", full.names = TRUE)[2]\n", + "score_dat_full = read_csv(score_data_full_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "d6953e4d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "
  1. 'GEOID10_TRACT'
  2. 'Does the tract have at least 35 acres in it?'
  3. 'Contains agricultural value'
  4. 'Names of Tribal areas within Census tract'
  5. 'Housing burden (percent)'
  6. 'Share of homes with no kitchen or indoor plumbing (percent)'
  7. 'Total population'
  8. 'Median household income (% of state median household income)'
  9. 'Current asthma among adults aged greater than or equal to 18 years'
  10. 'Coronary heart disease among adults aged greater than or equal to 18 years'
  11. 'Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years'
  12. 'Current lack of health insurance among adults aged 18-64 years'
  13. 'Diagnosed diabetes among adults aged greater than or equal to 18 years'
  14. 'Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years'
  15. 'Percent of individuals < 100% Federal Poverty Line'
  16. 'Percent of individuals < 150% Federal Poverty Line'
  17. 'Percent of individuals below 200% Federal Poverty Line'
  18. 'Area Median Income (State or metropolitan)'
  19. 'Median household income in the past 12 months'
  20. 'Energy burden'
  21. 'FEMA Risk Index Expected Annual Loss Score'
  22. 'Urban Heuristic Flag'
  23. 'Air toxics cancer risk'
  24. 'Respiratory hazard index'
  25. 'Diesel particulate matter exposure'
  26. 'PM2.5 in the air'
  27. 'Ozone'
  28. 'Traffic proximity and volume'
  29. 'Proximity to Risk Management Plan (RMP) facilities'
  30. 'Proximity to hazardous waste sites'
  31. 'Proximity to NPL sites'
  32. 'Wastewater discharge'
  33. 'Percent pre-1960s housing (lead paint indicator)'
  34. 'Individuals under 5 years old'
  35. 'Individuals over 64 years old'
  36. 'Linguistic isolation (percent)'
  37. 'Percent of households in linguistic isolation'
  38. 'Poverty (Less than 200% of federal poverty line)'
  39. 'Percent individuals age 25 or over with less than high school degree'
  40. 'Unemployment (percent)'
  41. 'Median value ($) of owner-occupied housing units'
  42. 'Percent enrollment in college or graduate school'
  43. 'Percent of population not currently enrolled in college or graduate school'
  44. 'Expected building loss rate (Natural Hazards Risk Index)'
  45. 'Expected agricultural loss rate (Natural Hazards Risk Index)'
  46. 'Expected population loss rate (Natural Hazards Risk Index)'
  47. 'Percent individuals age 25 or over with less than high school degree in 2009'
  48. 'Percentage households below 100% of federal poverty line in 2009'
  49. 'Unemployment (percent) in 2009'
  50. 'Unemployment (percent) in 2010'
  51. 'Percent of individuals less than 100% Federal Poverty Line in 2010'
  52. 'Total population in 2009'
  53. 'Leaky underground storage tanks'
  54. 'DOT Travel Barriers Score'
  55. 'Share of properties at risk of flood in 30 years'
  56. 'Share of properties at risk of fire in 30 years'
  57. 'Share of the tract\\'s land area that is covered by impervious surface or cropland as a percent'
  58. 'Percent of individuals below 200% Federal Poverty Line, imputed and adjusted'
  59. 'Percent Black or African American'
  60. 'Percent American Indian / Alaska Native'
  61. 'Percent Asian'
  62. 'Percent Native Hawaiian or Pacific'
  63. 'Percent two or more races'
  64. 'Percent White'
  65. 'Percent Hispanic or Latino'
  66. 'Percent other races'
  67. 'Percent age under 10'
  68. 'Percent age 10 to 64'
  69. 'Percent age over 64'
  70. 'Percent of the Census tract that is within Tribal areas'
  71. 'Number of Tribal areas within Census tract for Alaska'
  72. 'Number of Tribal areas within Census tract'
  73. 'Percent of the Census tract that is within Tribal areas, for display'
  74. 'Median household income as a percent of area median income'
  75. 'Life expectancy (years)'
  76. 'Median household income as a percent of territory median income in 2009'
  77. 'Is there at least one abandoned mine in this census tract?'
  78. 'Income data has been estimated based on neighbor income'
  79. 'Is there at least one Formerly Used Defense Site (FUDS) in the tract?'
  80. 'Tract-level redlining score meets or exceeds 3.25'
  81. 'Identified as disadvantaged due to tribal overlap'
  82. 'Housing burden (percent) (percentile)'
  83. 'Share of homes with no kitchen or indoor plumbing (percent) (percentile)'
  84. 'Total population (percentile)'
  85. 'Median household income (% of state median household income) (percentile)'
  86. 'Current asthma among adults aged greater than or equal to 18 years (percentile)'
  87. 'Coronary heart disease among adults aged greater than or equal to 18 years (percentile)'
  88. 'Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years (percentile)'
  89. 'Current lack of health insurance among adults aged 18-64 years (percentile)'
  90. 'Diagnosed diabetes among adults aged greater than or equal to 18 years (percentile)'
  91. 'Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years (percentile)'
  92. 'Percent of individuals < 100% Federal Poverty Line (percentile)'
  93. 'Percent of individuals < 150% Federal Poverty Line (percentile)'
  94. 'Percent of individuals below 200% Federal Poverty Line (percentile)'
  95. 'Area Median Income (State or metropolitan) (percentile)'
  96. 'Median household income in the past 12 months (percentile)'
  97. 'Energy burden (percentile)'
  98. 'FEMA Risk Index Expected Annual Loss Score (percentile)'
  99. 'Urban Heuristic Flag (percentile)'
  100. 'Air toxics cancer risk (percentile)'
  101. 'Respiratory hazard index (percentile)'
  102. 'Diesel particulate matter exposure (percentile)'
  103. 'PM2.5 in the air (percentile)'
  104. 'Ozone (percentile)'
  105. 'Traffic proximity and volume (percentile)'
  106. 'Proximity to Risk Management Plan (RMP) facilities (percentile)'
  107. 'Proximity to hazardous waste sites (percentile)'
  108. 'Proximity to NPL sites (percentile)'
  109. 'Wastewater discharge (percentile)'
  110. 'Percent pre-1960s housing (lead paint indicator) (percentile)'
  111. 'Individuals under 5 years old (percentile)'
  112. 'Individuals over 64 years old (percentile)'
  113. 'Linguistic isolation (percent) (percentile)'
  114. 'Percent of households in linguistic isolation (percentile)'
  115. 'Poverty (Less than 200% of federal poverty line) (percentile)'
  116. 'Percent individuals age 25 or over with less than high school degree (percentile)'
  117. 'Unemployment (percent) (percentile)'
  118. 'Median value ($) of owner-occupied housing units (percentile)'
  119. 'Percent enrollment in college or graduate school (percentile)'
  120. 'Percent of population not currently enrolled in college or graduate school (percentile)'
  121. 'Expected building loss rate (Natural Hazards Risk Index) (percentile)'
  122. 'Expected agricultural loss rate (Natural Hazards Risk Index) (percentile)'
  123. 'Expected population loss rate (Natural Hazards Risk Index) (percentile)'
  124. 'Percent individuals age 25 or over with less than high school degree in 2009 (percentile)'
  125. 'Percentage households below 100% of federal poverty line in 2009 (percentile)'
  126. 'Unemployment (percent) in 2009 (percentile)'
  127. 'Unemployment (percent) in 2010 (percentile)'
  128. 'Percent of individuals less than 100% Federal Poverty Line in 2010 (percentile)'
  129. 'Total population in 2009 (percentile)'
  130. 'Leaky underground storage tanks (percentile)'
  131. 'DOT Travel Barriers Score (percentile)'
  132. 'Share of properties at risk of flood in 30 years (percentile)'
  133. 'Share of properties at risk of fire in 30 years (percentile)'
  134. 'Share of the tract\\'s land area that is covered by impervious surface or cropland as a percent (percentile)'
  135. 'Percent of individuals below 200% Federal Poverty Line, imputed and adjusted (percentile)'
  136. 'Percent Black or African American (percentile)'
  137. 'Percent American Indian / Alaska Native (percentile)'
  138. 'Percent Asian (percentile)'
  139. 'Percent Native Hawaiian or Pacific (percentile)'
  140. 'Percent two or more races (percentile)'
  141. 'Percent White (percentile)'
  142. 'Percent Hispanic or Latino (percentile)'
  143. 'Percent other races (percentile)'
  144. 'Percent age under 10 (percentile)'
  145. 'Percent age 10 to 64 (percentile)'
  146. 'Percent age over 64 (percentile)'
  147. 'Percent of the Census tract that is within Tribal areas (percentile)'
  148. 'Number of Tribal areas within Census tract for Alaska (percentile)'
  149. 'Number of Tribal areas within Census tract (percentile)'
  150. 'Percent of the Census tract that is within Tribal areas, for display (percentile)'
  151. 'Percent Black or African American in 2009 (percentile)'
  152. 'Percent American Indian / Alaska Native in 2009 (percentile)'
  153. 'Percent Asian in 2009 (percentile)'
  154. 'Percent Native Hawaiian or Pacific in 2009 (percentile)'
  155. 'Percent two or more races in 2009 (percentile)'
  156. 'Percent White in 2009 (percentile)'
  157. 'Percent Hispanic or Latino in 2009 (percentile)'
  158. 'Percent other races in 2009 (percentile)'
  159. 'Low median household income as a percent of area median income (percentile)'
  160. 'Low life expectancy (percentile)'
  161. 'Low median household income as a percent of territory median income in 2009 (percentile)'
  162. 'Total population in 2009 (island areas) and 2019 (states and PR)'
  163. 'Total threshold criteria exceeded'
  164. 'Is low income (imputed and adjusted)?'
  165. 'Greater than or equal to the 90th percentile for expected population loss'
  166. 'Greater than or equal to the 90th percentile for expected agricultural loss'
  167. 'Greater than or equal to the 90th percentile for expected building loss'
  168. 'Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years'
  169. 'Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years'
  170. 'At least one climate threshold exceeded'
  171. 'Greater than or equal to the 90th percentile for expected population loss rate and is low income?'
  172. 'Greater than or equal to the 90th percentile for expected agriculture loss rate and is low income?'
  173. 'Greater than or equal to the 90th percentile for expected building loss rate and is low income?'
  174. 'Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income?'
  175. 'Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income?'
  176. 'Climate Factor (Definition N)'
  177. 'Greater than or equal to the 90th percentile for energy burden'
  178. 'Greater than or equal to the 90th percentile for pm2.5 exposure'
  179. 'At least one energy threshold exceeded'
  180. 'Greater than or equal to the 90th percentile for PM2.5 exposure and is low income?'
  181. 'Greater than or equal to the 90th percentile for energy burden and is low income?'
  182. 'Energy Factor (Definition N)'
  183. 'Greater than or equal to the 90th percentile for diesel particulate matter'
  184. 'Greater than or equal to the 90th percentile for DOT travel barriers'
  185. 'Greater than or equal to the 90th percentile for traffic proximity'
  186. 'At least one traffic threshold exceeded'
  187. 'Greater than or equal to the 90th percentile for diesel particulate matter and is low income?'
  188. 'Greater than or equal to the 90th percentile for traffic proximity and is low income?'
  189. 'Greater than or equal to the 90th percentile for DOT transit barriers and is low income?'
  190. 'Transportation Factor (Definition N)'
  191. 'Tract-level redlining score meets or exceeds 3.25 and is low income'
  192. 'Greater than or equal to the 90th percentile for share of homes without indoor plumbing or a kitchen'
  193. 'Greater than or equal to the 90th percentile for share of homes with no kitchen or indoor plumbing and is low income?'
  194. 'Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile'
  195. 'Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile and is low income?'
  196. 'Greater than or equal to the 90th percentile for housing burden'
  197. 'Greater than or equal to the 90th percentile for housing burden and is low income?'
  198. 'Greater than or equal to the 90th percentile for share of the tract\\'s land area that is covered by impervious surface or cropland as a percent'
  199. 'Greater than or equal to the 90th percentile for share of the tract\\'s land area that is covered by impervious surface or cropland as a percent and is low income?'
  200. 'At least one housing threshold exceeded'
  201. 'Housing Factor (Definition N)'
  202. 'Greater than or equal to the 90th percentile for RMP proximity'
  203. 'Greater than or equal to the 90th percentile for NPL (superfund sites) proximity'
  204. 'Greater than or equal to the 90th percentile for proximity to hazardous waste sites'
  205. 'Is there at least one Formerly Used Defense Site (FUDS) in the tract, where missing data is treated as False?'
  206. 'Is there at least one abandoned mine in this census tract, where missing data is treated as False?'
  207. 'At least one pollution threshold exceeded'
  208. 'Greater than or equal to the 90th percentile for proximity to RMP sites and is low income?'
  209. 'Greater than or equal to the 90th percentile for proximity to superfund sites and is low income?'
  210. 'Greater than or equal to the 90th percentile for proximity to hazardous waste facilities and is low income?'
  211. 'There is at least one abandoned mine in this census tract and the tract is low income.'
  212. 'There is at least one Formerly Used Defense Site (FUDS) in the tract and the tract is low income.'
  213. 'Pollution Factor (Definition N)'
  214. 'Greater than or equal to the 90th percentile for wastewater discharge'
  215. 'Greater than or equal to the 90th percentile for leaky underwater storage tanks'
  216. 'Greater than or equal to the 90th percentile for wastewater discharge and is low income?'
  217. 'Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?'
  218. 'At least one water threshold exceeded'
  219. 'Water Factor (Definition N)'
  220. 'Greater than or equal to the 90th percentile for diabetes'
  221. 'Greater than or equal to the 90th percentile for asthma'
  222. 'Greater than or equal to the 90th percentile for heart disease'
  223. 'Greater than or equal to the 90th percentile for low life expectancy'
  224. 'At least one health threshold exceeded'
  225. 'Greater than or equal to the 90th percentile for diabetes and is low income?'
  226. 'Greater than or equal to the 90th percentile for asthma and is low income?'
  227. 'Greater than or equal to the 90th percentile for heart disease and is low income?'
  228. 'Greater than or equal to the 90th percentile for low life expectancy and is low income?'
  229. 'Health Factor (Definition N)'
  230. 'Low high school education'
  231. 'Greater than or equal to the 90th percentile for unemployment'
  232. 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income'
  233. 'Greater than or equal to the 90th percentile for households in linguistic isolation'
  234. 'Greater than or equal to the 90th percentile for households at or below 100% federal poverty level'
  235. 'Greater than or equal to the 90th percentile for households in linguistic isolation and has low HS attainment?'
  236. 'Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS attainment?'
  237. 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS attainment?'
  238. 'Greater than or equal to the 90th percentile for unemployment and has low HS attainment?'
  239. 'At least one workforce threshold exceeded'
  240. 'Unemployment (percent) in 2009 (island areas) and 2010 (states and PR)'
  241. 'Unemployment (percent) in 2009 for island areas (percentile)'
  242. 'Unemployment (percent) in 2009 exceeds 90th percentile'
  243. 'Percentage households below 100% of federal poverty line in 2009 (island areas) and 2010 (states and PR)'
  244. 'Percentage households below 100% of federal poverty line in 2009 for island areas (percentile)'
  245. 'Percentage households below 100% of federal poverty line in 2009 exceeds 90th percentile'
  246. 'Low median household income as a percent of territory median income in 2009 exceeds 90th percentile'
  247. 'Low high school education in 2009 (island areas)'
  248. 'Greater than or equal to the 90th percentile for unemployment and has low HS education in 2009 (island areas)?'
  249. 'Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS education in 2009 (island areas)?'
  250. 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)?'
  251. 'Both workforce socioeconomic indicators exceeded'
  252. 'Workforce Factor (Definition N)'
  253. 'Total categories exceeded'
  254. 'Definition N (communities)'
  255. 'Definition N (communities) (percentile)'
  256. 'Meets the less stringent low income criterion for the adjacency index?'
  257. 'Definition N (communities) (average of neighbors)'
  258. 'Is the tract surrounded by disadvantaged communities?'
  259. 'Definition N (communities) (based on adjacency index and low income alone)'
  260. 'Definition N community, including adjacency index tracts'
  261. 'Percentage of tract that is disadvantaged'
\n" + ], + "text/latex": [ + "\\begin{enumerate*}\n", + "\\item 'GEOID10\\_TRACT'\n", + "\\item 'Does the tract have at least 35 acres in it?'\n", + "\\item 'Contains agricultural value'\n", + "\\item 'Names of Tribal areas within Census tract'\n", + "\\item 'Housing burden (percent)'\n", + "\\item 'Share of homes with no kitchen or indoor plumbing (percent)'\n", + "\\item 'Total population'\n", + "\\item 'Median household income (\\% of state median household income)'\n", + "\\item 'Current asthma among adults aged greater than or equal to 18 years'\n", + "\\item 'Coronary heart disease among adults aged greater than or equal to 18 years'\n", + "\\item 'Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years'\n", + "\\item 'Current lack of health insurance among adults aged 18-64 years'\n", + "\\item 'Diagnosed diabetes among adults aged greater than or equal to 18 years'\n", + "\\item 'Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years'\n", + "\\item 'Percent of individuals < 100\\% Federal Poverty Line'\n", + "\\item 'Percent of individuals < 150\\% Federal Poverty Line'\n", + "\\item 'Percent of individuals below 200\\% Federal Poverty Line'\n", + "\\item 'Area Median Income (State or metropolitan)'\n", + "\\item 'Median household income in the past 12 months'\n", + "\\item 'Energy burden'\n", + "\\item 'FEMA Risk Index Expected Annual Loss Score'\n", + "\\item 'Urban Heuristic Flag'\n", + "\\item 'Air toxics cancer risk'\n", + "\\item 'Respiratory hazard index'\n", + "\\item 'Diesel particulate matter exposure'\n", + "\\item 'PM2.5 in the air'\n", + "\\item 'Ozone'\n", + "\\item 'Traffic proximity and volume'\n", + "\\item 'Proximity to Risk Management Plan (RMP) facilities'\n", + "\\item 'Proximity to hazardous waste sites'\n", + "\\item 'Proximity to NPL sites'\n", + "\\item 'Wastewater discharge'\n", + "\\item 'Percent pre-1960s housing (lead paint indicator)'\n", + "\\item 'Individuals under 5 years old'\n", + "\\item 'Individuals over 64 years old'\n", + "\\item 'Linguistic isolation (percent)'\n", + "\\item 'Percent of households in linguistic isolation'\n", + "\\item 'Poverty (Less than 200\\% of federal poverty line)'\n", + "\\item 'Percent individuals age 25 or over with less than high school degree'\n", + "\\item 'Unemployment (percent)'\n", + "\\item 'Median value (\\$) of owner-occupied housing units'\n", + "\\item 'Percent enrollment in college or graduate school'\n", + "\\item 'Percent of population not currently enrolled in college or graduate school'\n", + "\\item 'Expected building loss rate (Natural Hazards Risk Index)'\n", + "\\item 'Expected agricultural loss rate (Natural Hazards Risk Index)'\n", + "\\item 'Expected population loss rate (Natural Hazards Risk Index)'\n", + "\\item 'Percent individuals age 25 or over with less than high school degree in 2009'\n", + "\\item 'Percentage households below 100\\% of federal poverty line in 2009'\n", + "\\item 'Unemployment (percent) in 2009'\n", + "\\item 'Unemployment (percent) in 2010'\n", + "\\item 'Percent of individuals less than 100\\% Federal Poverty Line in 2010'\n", + "\\item 'Total population in 2009'\n", + "\\item 'Leaky underground storage tanks'\n", + "\\item 'DOT Travel Barriers Score'\n", + "\\item 'Share of properties at risk of flood in 30 years'\n", + "\\item 'Share of properties at risk of fire in 30 years'\n", + "\\item 'Share of the tract\\textbackslash{}'s land area that is covered by impervious surface or cropland as a percent'\n", + "\\item 'Percent of individuals below 200\\% Federal Poverty Line, imputed and adjusted'\n", + "\\item 'Percent Black or African American'\n", + "\\item 'Percent American Indian / Alaska Native'\n", + "\\item 'Percent Asian'\n", + "\\item 'Percent Native Hawaiian or Pacific'\n", + "\\item 'Percent two or more races'\n", + "\\item 'Percent White'\n", + "\\item 'Percent Hispanic or Latino'\n", + "\\item 'Percent other races'\n", + "\\item 'Percent age under 10'\n", + "\\item 'Percent age 10 to 64'\n", + "\\item 'Percent age over 64'\n", + "\\item 'Percent of the Census tract that is within Tribal areas'\n", + "\\item 'Number of Tribal areas within Census tract for Alaska'\n", + "\\item 'Number of Tribal areas within Census tract'\n", + "\\item 'Percent of the Census tract that is within Tribal areas, for display'\n", + "\\item 'Median household income as a percent of area median income'\n", + "\\item 'Life expectancy (years)'\n", + "\\item 'Median household income as a percent of territory median income in 2009'\n", + "\\item 'Is there at least one abandoned mine in this census tract?'\n", + "\\item 'Income data has been estimated based on neighbor income'\n", + "\\item 'Is there at least one Formerly Used Defense Site (FUDS) in the tract?'\n", + "\\item 'Tract-level redlining score meets or exceeds 3.25'\n", + "\\item 'Identified as disadvantaged due to tribal overlap'\n", + "\\item 'Housing burden (percent) (percentile)'\n", + "\\item 'Share of homes with no kitchen or indoor plumbing (percent) (percentile)'\n", + "\\item 'Total population (percentile)'\n", + "\\item 'Median household income (\\% of state median household income) (percentile)'\n", + "\\item 'Current asthma among adults aged greater than or equal to 18 years (percentile)'\n", + "\\item 'Coronary heart disease among adults aged greater than or equal to 18 years (percentile)'\n", + "\\item 'Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years (percentile)'\n", + "\\item 'Current lack of health insurance among adults aged 18-64 years (percentile)'\n", + "\\item 'Diagnosed diabetes among adults aged greater than or equal to 18 years (percentile)'\n", + "\\item 'Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years (percentile)'\n", + "\\item 'Percent of individuals < 100\\% Federal Poverty Line (percentile)'\n", + "\\item 'Percent of individuals < 150\\% Federal Poverty Line (percentile)'\n", + "\\item 'Percent of individuals below 200\\% Federal Poverty Line (percentile)'\n", + "\\item 'Area Median Income (State or metropolitan) (percentile)'\n", + "\\item 'Median household income in the past 12 months (percentile)'\n", + "\\item 'Energy burden (percentile)'\n", + "\\item 'FEMA Risk Index Expected Annual Loss Score (percentile)'\n", + "\\item 'Urban Heuristic Flag (percentile)'\n", + "\\item 'Air toxics cancer risk (percentile)'\n", + "\\item 'Respiratory hazard index (percentile)'\n", + "\\item 'Diesel particulate matter exposure (percentile)'\n", + "\\item 'PM2.5 in the air (percentile)'\n", + "\\item 'Ozone (percentile)'\n", + "\\item 'Traffic proximity and volume (percentile)'\n", + "\\item 'Proximity to Risk Management Plan (RMP) facilities (percentile)'\n", + "\\item 'Proximity to hazardous waste sites (percentile)'\n", + "\\item 'Proximity to NPL sites (percentile)'\n", + "\\item 'Wastewater discharge (percentile)'\n", + "\\item 'Percent pre-1960s housing (lead paint indicator) (percentile)'\n", + "\\item 'Individuals under 5 years old (percentile)'\n", + "\\item 'Individuals over 64 years old (percentile)'\n", + "\\item 'Linguistic isolation (percent) (percentile)'\n", + "\\item 'Percent of households in linguistic isolation (percentile)'\n", + "\\item 'Poverty (Less than 200\\% of federal poverty line) (percentile)'\n", + "\\item 'Percent individuals age 25 or over with less than high school degree (percentile)'\n", + "\\item 'Unemployment (percent) (percentile)'\n", + "\\item 'Median value (\\$) of owner-occupied housing units (percentile)'\n", + "\\item 'Percent enrollment in college or graduate school (percentile)'\n", + "\\item 'Percent of population not currently enrolled in college or graduate school (percentile)'\n", + "\\item 'Expected building loss rate (Natural Hazards Risk Index) (percentile)'\n", + "\\item 'Expected agricultural loss rate (Natural Hazards Risk Index) (percentile)'\n", + "\\item 'Expected population loss rate (Natural Hazards Risk Index) (percentile)'\n", + "\\item 'Percent individuals age 25 or over with less than high school degree in 2009 (percentile)'\n", + "\\item 'Percentage households below 100\\% of federal poverty line in 2009 (percentile)'\n", + "\\item 'Unemployment (percent) in 2009 (percentile)'\n", + "\\item 'Unemployment (percent) in 2010 (percentile)'\n", + "\\item 'Percent of individuals less than 100\\% Federal Poverty Line in 2010 (percentile)'\n", + "\\item 'Total population in 2009 (percentile)'\n", + "\\item 'Leaky underground storage tanks (percentile)'\n", + "\\item 'DOT Travel Barriers Score (percentile)'\n", + "\\item 'Share of properties at risk of flood in 30 years (percentile)'\n", + "\\item 'Share of properties at risk of fire in 30 years (percentile)'\n", + "\\item 'Share of the tract\\textbackslash{}'s land area that is covered by impervious surface or cropland as a percent (percentile)'\n", + "\\item 'Percent of individuals below 200\\% Federal Poverty Line, imputed and adjusted (percentile)'\n", + "\\item 'Percent Black or African American (percentile)'\n", + "\\item 'Percent American Indian / Alaska Native (percentile)'\n", + "\\item 'Percent Asian (percentile)'\n", + "\\item 'Percent Native Hawaiian or Pacific (percentile)'\n", + "\\item 'Percent two or more races (percentile)'\n", + "\\item 'Percent White (percentile)'\n", + "\\item 'Percent Hispanic or Latino (percentile)'\n", + "\\item 'Percent other races (percentile)'\n", + "\\item 'Percent age under 10 (percentile)'\n", + "\\item 'Percent age 10 to 64 (percentile)'\n", + "\\item 'Percent age over 64 (percentile)'\n", + "\\item 'Percent of the Census tract that is within Tribal areas (percentile)'\n", + "\\item 'Number of Tribal areas within Census tract for Alaska (percentile)'\n", + "\\item 'Number of Tribal areas within Census tract (percentile)'\n", + "\\item 'Percent of the Census tract that is within Tribal areas, for display (percentile)'\n", + "\\item 'Percent Black or African American in 2009 (percentile)'\n", + "\\item 'Percent American Indian / Alaska Native in 2009 (percentile)'\n", + "\\item 'Percent Asian in 2009 (percentile)'\n", + "\\item 'Percent Native Hawaiian or Pacific in 2009 (percentile)'\n", + "\\item 'Percent two or more races in 2009 (percentile)'\n", + "\\item 'Percent White in 2009 (percentile)'\n", + "\\item 'Percent Hispanic or Latino in 2009 (percentile)'\n", + "\\item 'Percent other races in 2009 (percentile)'\n", + "\\item 'Low median household income as a percent of area median income (percentile)'\n", + "\\item 'Low life expectancy (percentile)'\n", + "\\item 'Low median household income as a percent of territory median income in 2009 (percentile)'\n", + "\\item 'Total population in 2009 (island areas) and 2019 (states and PR)'\n", + "\\item 'Total threshold criteria exceeded'\n", + "\\item 'Is low income (imputed and adjusted)?'\n", + "\\item 'Greater than or equal to the 90th percentile for expected population loss'\n", + "\\item 'Greater than or equal to the 90th percentile for expected agricultural loss'\n", + "\\item 'Greater than or equal to the 90th percentile for expected building loss'\n", + "\\item 'Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years'\n", + "\\item 'Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years'\n", + "\\item 'At least one climate threshold exceeded'\n", + "\\item 'Greater than or equal to the 90th percentile for expected population loss rate and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for expected agriculture loss rate and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for expected building loss rate and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income?'\n", + "\\item 'Climate Factor (Definition N)'\n", + "\\item 'Greater than or equal to the 90th percentile for energy burden'\n", + "\\item 'Greater than or equal to the 90th percentile for pm2.5 exposure'\n", + "\\item 'At least one energy threshold exceeded'\n", + "\\item 'Greater than or equal to the 90th percentile for PM2.5 exposure and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for energy burden and is low income?'\n", + "\\item 'Energy Factor (Definition N)'\n", + "\\item 'Greater than or equal to the 90th percentile for diesel particulate matter'\n", + "\\item 'Greater than or equal to the 90th percentile for DOT travel barriers'\n", + "\\item 'Greater than or equal to the 90th percentile for traffic proximity'\n", + "\\item 'At least one traffic threshold exceeded'\n", + "\\item 'Greater than or equal to the 90th percentile for diesel particulate matter and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for traffic proximity and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for DOT transit barriers and is low income?'\n", + "\\item 'Transportation Factor (Definition N)'\n", + "\\item 'Tract-level redlining score meets or exceeds 3.25 and is low income'\n", + "\\item 'Greater than or equal to the 90th percentile for share of homes without indoor plumbing or a kitchen'\n", + "\\item 'Greater than or equal to the 90th percentile for share of homes with no kitchen or indoor plumbing and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile'\n", + "\\item 'Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for housing burden'\n", + "\\item 'Greater than or equal to the 90th percentile for housing burden and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for share of the tract\\textbackslash{}'s land area that is covered by impervious surface or cropland as a percent'\n", + "\\item 'Greater than or equal to the 90th percentile for share of the tract\\textbackslash{}'s land area that is covered by impervious surface or cropland as a percent and is low income?'\n", + "\\item 'At least one housing threshold exceeded'\n", + "\\item 'Housing Factor (Definition N)'\n", + "\\item 'Greater than or equal to the 90th percentile for RMP proximity'\n", + "\\item 'Greater than or equal to the 90th percentile for NPL (superfund sites) proximity'\n", + "\\item 'Greater than or equal to the 90th percentile for proximity to hazardous waste sites'\n", + "\\item 'Is there at least one Formerly Used Defense Site (FUDS) in the tract, where missing data is treated as False?'\n", + "\\item 'Is there at least one abandoned mine in this census tract, where missing data is treated as False?'\n", + "\\item 'At least one pollution threshold exceeded'\n", + "\\item 'Greater than or equal to the 90th percentile for proximity to RMP sites and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for proximity to superfund sites and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for proximity to hazardous waste facilities and is low income?'\n", + "\\item 'There is at least one abandoned mine in this census tract and the tract is low income.'\n", + "\\item 'There is at least one Formerly Used Defense Site (FUDS) in the tract and the tract is low income.'\n", + "\\item 'Pollution Factor (Definition N)'\n", + "\\item 'Greater than or equal to the 90th percentile for wastewater discharge'\n", + "\\item 'Greater than or equal to the 90th percentile for leaky underwater storage tanks'\n", + "\\item 'Greater than or equal to the 90th percentile for wastewater discharge and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?'\n", + "\\item 'At least one water threshold exceeded'\n", + "\\item 'Water Factor (Definition N)'\n", + "\\item 'Greater than or equal to the 90th percentile for diabetes'\n", + "\\item 'Greater than or equal to the 90th percentile for asthma'\n", + "\\item 'Greater than or equal to the 90th percentile for heart disease'\n", + "\\item 'Greater than or equal to the 90th percentile for low life expectancy'\n", + "\\item 'At least one health threshold exceeded'\n", + "\\item 'Greater than or equal to the 90th percentile for diabetes and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for asthma and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for heart disease and is low income?'\n", + "\\item 'Greater than or equal to the 90th percentile for low life expectancy and is low income?'\n", + "\\item 'Health Factor (Definition N)'\n", + "\\item 'Low high school education'\n", + "\\item 'Greater than or equal to the 90th percentile for unemployment'\n", + "\\item 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income'\n", + "\\item 'Greater than or equal to the 90th percentile for households in linguistic isolation'\n", + "\\item 'Greater than or equal to the 90th percentile for households at or below 100\\% federal poverty level'\n", + "\\item 'Greater than or equal to the 90th percentile for households in linguistic isolation and has low HS attainment?'\n", + "\\item 'Greater than or equal to the 90th percentile for households at or below 100\\% federal poverty level and has low HS attainment?'\n", + "\\item 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS attainment?'\n", + "\\item 'Greater than or equal to the 90th percentile for unemployment and has low HS attainment?'\n", + "\\item 'At least one workforce threshold exceeded'\n", + "\\item 'Unemployment (percent) in 2009 (island areas) and 2010 (states and PR)'\n", + "\\item 'Unemployment (percent) in 2009 for island areas (percentile)'\n", + "\\item 'Unemployment (percent) in 2009 exceeds 90th percentile'\n", + "\\item 'Percentage households below 100\\% of federal poverty line in 2009 (island areas) and 2010 (states and PR)'\n", + "\\item 'Percentage households below 100\\% of federal poverty line in 2009 for island areas (percentile)'\n", + "\\item 'Percentage households below 100\\% of federal poverty line in 2009 exceeds 90th percentile'\n", + "\\item 'Low median household income as a percent of territory median income in 2009 exceeds 90th percentile'\n", + "\\item 'Low high school education in 2009 (island areas)'\n", + "\\item 'Greater than or equal to the 90th percentile for unemployment and has low HS education in 2009 (island areas)?'\n", + "\\item 'Greater than or equal to the 90th percentile for households at or below 100\\% federal poverty level and has low HS education in 2009 (island areas)?'\n", + "\\item 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)?'\n", + "\\item 'Both workforce socioeconomic indicators exceeded'\n", + "\\item 'Workforce Factor (Definition N)'\n", + "\\item 'Total categories exceeded'\n", + "\\item 'Definition N (communities)'\n", + "\\item 'Definition N (communities) (percentile)'\n", + "\\item 'Meets the less stringent low income criterion for the adjacency index?'\n", + "\\item 'Definition N (communities) (average of neighbors)'\n", + "\\item 'Is the tract surrounded by disadvantaged communities?'\n", + "\\item 'Definition N (communities) (based on adjacency index and low income alone)'\n", + "\\item 'Definition N community, including adjacency index tracts'\n", + "\\item 'Percentage of tract that is disadvantaged'\n", + "\\end{enumerate*}\n" + ], + "text/markdown": [ + "1. 'GEOID10_TRACT'\n", + "2. 'Does the tract have at least 35 acres in it?'\n", + "3. 'Contains agricultural value'\n", + "4. 'Names of Tribal areas within Census tract'\n", + "5. 'Housing burden (percent)'\n", + "6. 'Share of homes with no kitchen or indoor plumbing (percent)'\n", + "7. 'Total population'\n", + "8. 'Median household income (% of state median household income)'\n", + "9. 'Current asthma among adults aged greater than or equal to 18 years'\n", + "10. 'Coronary heart disease among adults aged greater than or equal to 18 years'\n", + "11. 'Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years'\n", + "12. 'Current lack of health insurance among adults aged 18-64 years'\n", + "13. 'Diagnosed diabetes among adults aged greater than or equal to 18 years'\n", + "14. 'Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years'\n", + "15. 'Percent of individuals < 100% Federal Poverty Line'\n", + "16. 'Percent of individuals < 150% Federal Poverty Line'\n", + "17. 'Percent of individuals below 200% Federal Poverty Line'\n", + "18. 'Area Median Income (State or metropolitan)'\n", + "19. 'Median household income in the past 12 months'\n", + "20. 'Energy burden'\n", + "21. 'FEMA Risk Index Expected Annual Loss Score'\n", + "22. 'Urban Heuristic Flag'\n", + "23. 'Air toxics cancer risk'\n", + "24. 'Respiratory hazard index'\n", + "25. 'Diesel particulate matter exposure'\n", + "26. 'PM2.5 in the air'\n", + "27. 'Ozone'\n", + "28. 'Traffic proximity and volume'\n", + "29. 'Proximity to Risk Management Plan (RMP) facilities'\n", + "30. 'Proximity to hazardous waste sites'\n", + "31. 'Proximity to NPL sites'\n", + "32. 'Wastewater discharge'\n", + "33. 'Percent pre-1960s housing (lead paint indicator)'\n", + "34. 'Individuals under 5 years old'\n", + "35. 'Individuals over 64 years old'\n", + "36. 'Linguistic isolation (percent)'\n", + "37. 'Percent of households in linguistic isolation'\n", + "38. 'Poverty (Less than 200% of federal poverty line)'\n", + "39. 'Percent individuals age 25 or over with less than high school degree'\n", + "40. 'Unemployment (percent)'\n", + "41. 'Median value ($) of owner-occupied housing units'\n", + "42. 'Percent enrollment in college or graduate school'\n", + "43. 'Percent of population not currently enrolled in college or graduate school'\n", + "44. 'Expected building loss rate (Natural Hazards Risk Index)'\n", + "45. 'Expected agricultural loss rate (Natural Hazards Risk Index)'\n", + "46. 'Expected population loss rate (Natural Hazards Risk Index)'\n", + "47. 'Percent individuals age 25 or over with less than high school degree in 2009'\n", + "48. 'Percentage households below 100% of federal poverty line in 2009'\n", + "49. 'Unemployment (percent) in 2009'\n", + "50. 'Unemployment (percent) in 2010'\n", + "51. 'Percent of individuals less than 100% Federal Poverty Line in 2010'\n", + "52. 'Total population in 2009'\n", + "53. 'Leaky underground storage tanks'\n", + "54. 'DOT Travel Barriers Score'\n", + "55. 'Share of properties at risk of flood in 30 years'\n", + "56. 'Share of properties at risk of fire in 30 years'\n", + "57. 'Share of the tract\\'s land area that is covered by impervious surface or cropland as a percent'\n", + "58. 'Percent of individuals below 200% Federal Poverty Line, imputed and adjusted'\n", + "59. 'Percent Black or African American'\n", + "60. 'Percent American Indian / Alaska Native'\n", + "61. 'Percent Asian'\n", + "62. 'Percent Native Hawaiian or Pacific'\n", + "63. 'Percent two or more races'\n", + "64. 'Percent White'\n", + "65. 'Percent Hispanic or Latino'\n", + "66. 'Percent other races'\n", + "67. 'Percent age under 10'\n", + "68. 'Percent age 10 to 64'\n", + "69. 'Percent age over 64'\n", + "70. 'Percent of the Census tract that is within Tribal areas'\n", + "71. 'Number of Tribal areas within Census tract for Alaska'\n", + "72. 'Number of Tribal areas within Census tract'\n", + "73. 'Percent of the Census tract that is within Tribal areas, for display'\n", + "74. 'Median household income as a percent of area median income'\n", + "75. 'Life expectancy (years)'\n", + "76. 'Median household income as a percent of territory median income in 2009'\n", + "77. 'Is there at least one abandoned mine in this census tract?'\n", + "78. 'Income data has been estimated based on neighbor income'\n", + "79. 'Is there at least one Formerly Used Defense Site (FUDS) in the tract?'\n", + "80. 'Tract-level redlining score meets or exceeds 3.25'\n", + "81. 'Identified as disadvantaged due to tribal overlap'\n", + "82. 'Housing burden (percent) (percentile)'\n", + "83. 'Share of homes with no kitchen or indoor plumbing (percent) (percentile)'\n", + "84. 'Total population (percentile)'\n", + "85. 'Median household income (% of state median household income) (percentile)'\n", + "86. 'Current asthma among adults aged greater than or equal to 18 years (percentile)'\n", + "87. 'Coronary heart disease among adults aged greater than or equal to 18 years (percentile)'\n", + "88. 'Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years (percentile)'\n", + "89. 'Current lack of health insurance among adults aged 18-64 years (percentile)'\n", + "90. 'Diagnosed diabetes among adults aged greater than or equal to 18 years (percentile)'\n", + "91. 'Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years (percentile)'\n", + "92. 'Percent of individuals < 100% Federal Poverty Line (percentile)'\n", + "93. 'Percent of individuals < 150% Federal Poverty Line (percentile)'\n", + "94. 'Percent of individuals below 200% Federal Poverty Line (percentile)'\n", + "95. 'Area Median Income (State or metropolitan) (percentile)'\n", + "96. 'Median household income in the past 12 months (percentile)'\n", + "97. 'Energy burden (percentile)'\n", + "98. 'FEMA Risk Index Expected Annual Loss Score (percentile)'\n", + "99. 'Urban Heuristic Flag (percentile)'\n", + "100. 'Air toxics cancer risk (percentile)'\n", + "101. 'Respiratory hazard index (percentile)'\n", + "102. 'Diesel particulate matter exposure (percentile)'\n", + "103. 'PM2.5 in the air (percentile)'\n", + "104. 'Ozone (percentile)'\n", + "105. 'Traffic proximity and volume (percentile)'\n", + "106. 'Proximity to Risk Management Plan (RMP) facilities (percentile)'\n", + "107. 'Proximity to hazardous waste sites (percentile)'\n", + "108. 'Proximity to NPL sites (percentile)'\n", + "109. 'Wastewater discharge (percentile)'\n", + "110. 'Percent pre-1960s housing (lead paint indicator) (percentile)'\n", + "111. 'Individuals under 5 years old (percentile)'\n", + "112. 'Individuals over 64 years old (percentile)'\n", + "113. 'Linguistic isolation (percent) (percentile)'\n", + "114. 'Percent of households in linguistic isolation (percentile)'\n", + "115. 'Poverty (Less than 200% of federal poverty line) (percentile)'\n", + "116. 'Percent individuals age 25 or over with less than high school degree (percentile)'\n", + "117. 'Unemployment (percent) (percentile)'\n", + "118. 'Median value ($) of owner-occupied housing units (percentile)'\n", + "119. 'Percent enrollment in college or graduate school (percentile)'\n", + "120. 'Percent of population not currently enrolled in college or graduate school (percentile)'\n", + "121. 'Expected building loss rate (Natural Hazards Risk Index) (percentile)'\n", + "122. 'Expected agricultural loss rate (Natural Hazards Risk Index) (percentile)'\n", + "123. 'Expected population loss rate (Natural Hazards Risk Index) (percentile)'\n", + "124. 'Percent individuals age 25 or over with less than high school degree in 2009 (percentile)'\n", + "125. 'Percentage households below 100% of federal poverty line in 2009 (percentile)'\n", + "126. 'Unemployment (percent) in 2009 (percentile)'\n", + "127. 'Unemployment (percent) in 2010 (percentile)'\n", + "128. 'Percent of individuals less than 100% Federal Poverty Line in 2010 (percentile)'\n", + "129. 'Total population in 2009 (percentile)'\n", + "130. 'Leaky underground storage tanks (percentile)'\n", + "131. 'DOT Travel Barriers Score (percentile)'\n", + "132. 'Share of properties at risk of flood in 30 years (percentile)'\n", + "133. 'Share of properties at risk of fire in 30 years (percentile)'\n", + "134. 'Share of the tract\\'s land area that is covered by impervious surface or cropland as a percent (percentile)'\n", + "135. 'Percent of individuals below 200% Federal Poverty Line, imputed and adjusted (percentile)'\n", + "136. 'Percent Black or African American (percentile)'\n", + "137. 'Percent American Indian / Alaska Native (percentile)'\n", + "138. 'Percent Asian (percentile)'\n", + "139. 'Percent Native Hawaiian or Pacific (percentile)'\n", + "140. 'Percent two or more races (percentile)'\n", + "141. 'Percent White (percentile)'\n", + "142. 'Percent Hispanic or Latino (percentile)'\n", + "143. 'Percent other races (percentile)'\n", + "144. 'Percent age under 10 (percentile)'\n", + "145. 'Percent age 10 to 64 (percentile)'\n", + "146. 'Percent age over 64 (percentile)'\n", + "147. 'Percent of the Census tract that is within Tribal areas (percentile)'\n", + "148. 'Number of Tribal areas within Census tract for Alaska (percentile)'\n", + "149. 'Number of Tribal areas within Census tract (percentile)'\n", + "150. 'Percent of the Census tract that is within Tribal areas, for display (percentile)'\n", + "151. 'Percent Black or African American in 2009 (percentile)'\n", + "152. 'Percent American Indian / Alaska Native in 2009 (percentile)'\n", + "153. 'Percent Asian in 2009 (percentile)'\n", + "154. 'Percent Native Hawaiian or Pacific in 2009 (percentile)'\n", + "155. 'Percent two or more races in 2009 (percentile)'\n", + "156. 'Percent White in 2009 (percentile)'\n", + "157. 'Percent Hispanic or Latino in 2009 (percentile)'\n", + "158. 'Percent other races in 2009 (percentile)'\n", + "159. 'Low median household income as a percent of area median income (percentile)'\n", + "160. 'Low life expectancy (percentile)'\n", + "161. 'Low median household income as a percent of territory median income in 2009 (percentile)'\n", + "162. 'Total population in 2009 (island areas) and 2019 (states and PR)'\n", + "163. 'Total threshold criteria exceeded'\n", + "164. 'Is low income (imputed and adjusted)?'\n", + "165. 'Greater than or equal to the 90th percentile for expected population loss'\n", + "166. 'Greater than or equal to the 90th percentile for expected agricultural loss'\n", + "167. 'Greater than or equal to the 90th percentile for expected building loss'\n", + "168. 'Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years'\n", + "169. 'Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years'\n", + "170. 'At least one climate threshold exceeded'\n", + "171. 'Greater than or equal to the 90th percentile for expected population loss rate and is low income?'\n", + "172. 'Greater than or equal to the 90th percentile for expected agriculture loss rate and is low income?'\n", + "173. 'Greater than or equal to the 90th percentile for expected building loss rate and is low income?'\n", + "174. 'Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income?'\n", + "175. 'Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income?'\n", + "176. 'Climate Factor (Definition N)'\n", + "177. 'Greater than or equal to the 90th percentile for energy burden'\n", + "178. 'Greater than or equal to the 90th percentile for pm2.5 exposure'\n", + "179. 'At least one energy threshold exceeded'\n", + "180. 'Greater than or equal to the 90th percentile for PM2.5 exposure and is low income?'\n", + "181. 'Greater than or equal to the 90th percentile for energy burden and is low income?'\n", + "182. 'Energy Factor (Definition N)'\n", + "183. 'Greater than or equal to the 90th percentile for diesel particulate matter'\n", + "184. 'Greater than or equal to the 90th percentile for DOT travel barriers'\n", + "185. 'Greater than or equal to the 90th percentile for traffic proximity'\n", + "186. 'At least one traffic threshold exceeded'\n", + "187. 'Greater than or equal to the 90th percentile for diesel particulate matter and is low income?'\n", + "188. 'Greater than or equal to the 90th percentile for traffic proximity and is low income?'\n", + "189. 'Greater than or equal to the 90th percentile for DOT transit barriers and is low income?'\n", + "190. 'Transportation Factor (Definition N)'\n", + "191. 'Tract-level redlining score meets or exceeds 3.25 and is low income'\n", + "192. 'Greater than or equal to the 90th percentile for share of homes without indoor plumbing or a kitchen'\n", + "193. 'Greater than or equal to the 90th percentile for share of homes with no kitchen or indoor plumbing and is low income?'\n", + "194. 'Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile'\n", + "195. 'Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile and is low income?'\n", + "196. 'Greater than or equal to the 90th percentile for housing burden'\n", + "197. 'Greater than or equal to the 90th percentile for housing burden and is low income?'\n", + "198. 'Greater than or equal to the 90th percentile for share of the tract\\'s land area that is covered by impervious surface or cropland as a percent'\n", + "199. 'Greater than or equal to the 90th percentile for share of the tract\\'s land area that is covered by impervious surface or cropland as a percent and is low income?'\n", + "200. 'At least one housing threshold exceeded'\n", + "201. 'Housing Factor (Definition N)'\n", + "202. 'Greater than or equal to the 90th percentile for RMP proximity'\n", + "203. 'Greater than or equal to the 90th percentile for NPL (superfund sites) proximity'\n", + "204. 'Greater than or equal to the 90th percentile for proximity to hazardous waste sites'\n", + "205. 'Is there at least one Formerly Used Defense Site (FUDS) in the tract, where missing data is treated as False?'\n", + "206. 'Is there at least one abandoned mine in this census tract, where missing data is treated as False?'\n", + "207. 'At least one pollution threshold exceeded'\n", + "208. 'Greater than or equal to the 90th percentile for proximity to RMP sites and is low income?'\n", + "209. 'Greater than or equal to the 90th percentile for proximity to superfund sites and is low income?'\n", + "210. 'Greater than or equal to the 90th percentile for proximity to hazardous waste facilities and is low income?'\n", + "211. 'There is at least one abandoned mine in this census tract and the tract is low income.'\n", + "212. 'There is at least one Formerly Used Defense Site (FUDS) in the tract and the tract is low income.'\n", + "213. 'Pollution Factor (Definition N)'\n", + "214. 'Greater than or equal to the 90th percentile for wastewater discharge'\n", + "215. 'Greater than or equal to the 90th percentile for leaky underwater storage tanks'\n", + "216. 'Greater than or equal to the 90th percentile for wastewater discharge and is low income?'\n", + "217. 'Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?'\n", + "218. 'At least one water threshold exceeded'\n", + "219. 'Water Factor (Definition N)'\n", + "220. 'Greater than or equal to the 90th percentile for diabetes'\n", + "221. 'Greater than or equal to the 90th percentile for asthma'\n", + "222. 'Greater than or equal to the 90th percentile for heart disease'\n", + "223. 'Greater than or equal to the 90th percentile for low life expectancy'\n", + "224. 'At least one health threshold exceeded'\n", + "225. 'Greater than or equal to the 90th percentile for diabetes and is low income?'\n", + "226. 'Greater than or equal to the 90th percentile for asthma and is low income?'\n", + "227. 'Greater than or equal to the 90th percentile for heart disease and is low income?'\n", + "228. 'Greater than or equal to the 90th percentile for low life expectancy and is low income?'\n", + "229. 'Health Factor (Definition N)'\n", + "230. 'Low high school education'\n", + "231. 'Greater than or equal to the 90th percentile for unemployment'\n", + "232. 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income'\n", + "233. 'Greater than or equal to the 90th percentile for households in linguistic isolation'\n", + "234. 'Greater than or equal to the 90th percentile for households at or below 100% federal poverty level'\n", + "235. 'Greater than or equal to the 90th percentile for households in linguistic isolation and has low HS attainment?'\n", + "236. 'Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS attainment?'\n", + "237. 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS attainment?'\n", + "238. 'Greater than or equal to the 90th percentile for unemployment and has low HS attainment?'\n", + "239. 'At least one workforce threshold exceeded'\n", + "240. 'Unemployment (percent) in 2009 (island areas) and 2010 (states and PR)'\n", + "241. 'Unemployment (percent) in 2009 for island areas (percentile)'\n", + "242. 'Unemployment (percent) in 2009 exceeds 90th percentile'\n", + "243. 'Percentage households below 100% of federal poverty line in 2009 (island areas) and 2010 (states and PR)'\n", + "244. 'Percentage households below 100% of federal poverty line in 2009 for island areas (percentile)'\n", + "245. 'Percentage households below 100% of federal poverty line in 2009 exceeds 90th percentile'\n", + "246. 'Low median household income as a percent of territory median income in 2009 exceeds 90th percentile'\n", + "247. 'Low high school education in 2009 (island areas)'\n", + "248. 'Greater than or equal to the 90th percentile for unemployment and has low HS education in 2009 (island areas)?'\n", + "249. 'Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS education in 2009 (island areas)?'\n", + "250. 'Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)?'\n", + "251. 'Both workforce socioeconomic indicators exceeded'\n", + "252. 'Workforce Factor (Definition N)'\n", + "253. 'Total categories exceeded'\n", + "254. 'Definition N (communities)'\n", + "255. 'Definition N (communities) (percentile)'\n", + "256. 'Meets the less stringent low income criterion for the adjacency index?'\n", + "257. 'Definition N (communities) (average of neighbors)'\n", + "258. 'Is the tract surrounded by disadvantaged communities?'\n", + "259. 'Definition N (communities) (based on adjacency index and low income alone)'\n", + "260. 'Definition N community, including adjacency index tracts'\n", + "261. 'Percentage of tract that is disadvantaged'\n", + "\n", + "\n" + ], + "text/plain": [ + " [1] \"GEOID10_TRACT\" \n", + " [2] \"Does the tract have at least 35 acres in it?\" \n", + " [3] \"Contains agricultural value\" \n", + " [4] \"Names of Tribal areas within Census tract\" \n", + " [5] \"Housing burden (percent)\" \n", + " [6] \"Share of homes with no kitchen or indoor plumbing (percent)\" \n", + " [7] \"Total population\" \n", + " [8] \"Median household income (% of state median household income)\" \n", + " [9] \"Current asthma among adults aged greater than or equal to 18 years\" \n", + " [10] \"Coronary heart disease among adults aged greater than or equal to 18 years\" \n", + " [11] \"Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years\" \n", + " [12] \"Current lack of health insurance among adults aged 18-64 years\" \n", + " [13] \"Diagnosed diabetes among adults aged greater than or equal to 18 years\" \n", + " [14] \"Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years\" \n", + " [15] \"Percent of individuals < 100% Federal Poverty Line\" \n", + " [16] \"Percent of individuals < 150% Federal Poverty Line\" \n", + " [17] \"Percent of individuals below 200% Federal Poverty Line\" \n", + " [18] \"Area Median Income (State or metropolitan)\" \n", + " [19] \"Median household income in the past 12 months\" \n", + " [20] \"Energy burden\" \n", + " [21] \"FEMA Risk Index Expected Annual Loss Score\" \n", + " [22] \"Urban Heuristic Flag\" \n", + " [23] \"Air toxics cancer risk\" \n", + " [24] \"Respiratory hazard index\" \n", + " [25] \"Diesel particulate matter exposure\" \n", + " [26] \"PM2.5 in the air\" \n", + " [27] \"Ozone\" \n", + " [28] \"Traffic proximity and volume\" \n", + " [29] \"Proximity to Risk Management Plan (RMP) facilities\" \n", + " [30] \"Proximity to hazardous waste sites\" \n", + " [31] \"Proximity to NPL sites\" \n", + " [32] \"Wastewater discharge\" \n", + " [33] \"Percent pre-1960s housing (lead paint indicator)\" \n", + " [34] \"Individuals under 5 years old\" \n", + " [35] \"Individuals over 64 years old\" \n", + " [36] \"Linguistic isolation (percent)\" \n", + " [37] \"Percent of households in linguistic isolation\" \n", + " [38] \"Poverty (Less than 200% of federal poverty line)\" \n", + " [39] \"Percent individuals age 25 or over with less than high school degree\" \n", + " [40] \"Unemployment (percent)\" \n", + " [41] \"Median value ($) of owner-occupied housing units\" \n", + " [42] \"Percent enrollment in college or graduate school\" \n", + " [43] \"Percent of population not currently enrolled in college or graduate school\" \n", + " [44] \"Expected building loss rate (Natural Hazards Risk Index)\" \n", + " [45] \"Expected agricultural loss rate (Natural Hazards Risk Index)\" \n", + " [46] \"Expected population loss rate (Natural Hazards Risk Index)\" \n", + " [47] \"Percent individuals age 25 or over with less than high school degree in 2009\" \n", + " [48] \"Percentage households below 100% of federal poverty line in 2009\" \n", + " [49] \"Unemployment (percent) in 2009\" \n", + " [50] \"Unemployment (percent) in 2010\" \n", + " [51] \"Percent of individuals less than 100% Federal Poverty Line in 2010\" \n", + " [52] \"Total population in 2009\" \n", + " [53] \"Leaky underground storage tanks\" \n", + " [54] \"DOT Travel Barriers Score\" \n", + " [55] \"Share of properties at risk of flood in 30 years\" \n", + " [56] \"Share of properties at risk of fire in 30 years\" \n", + " [57] \"Share of the tract's land area that is covered by impervious surface or cropland as a percent\" \n", + " [58] \"Percent of individuals below 200% Federal Poverty Line, imputed and adjusted\" \n", + " [59] \"Percent Black or African American\" \n", + " [60] \"Percent American Indian / Alaska Native\" \n", + " [61] \"Percent Asian\" \n", + " [62] \"Percent Native Hawaiian or Pacific\" \n", + " [63] \"Percent two or more races\" \n", + " [64] \"Percent White\" \n", + " [65] \"Percent Hispanic or Latino\" \n", + " [66] \"Percent other races\" \n", + " [67] \"Percent age under 10\" \n", + " [68] \"Percent age 10 to 64\" \n", + " [69] \"Percent age over 64\" \n", + " [70] \"Percent of the Census tract that is within Tribal areas\" \n", + " [71] \"Number of Tribal areas within Census tract for Alaska\" \n", + " [72] \"Number of Tribal areas within Census tract\" \n", + " [73] \"Percent of the Census tract that is within Tribal areas, for display\" \n", + " [74] \"Median household income as a percent of area median income\" \n", + " [75] \"Life expectancy (years)\" \n", + " [76] \"Median household income as a percent of territory median income in 2009\" \n", + " [77] \"Is there at least one abandoned mine in this census tract?\" \n", + " [78] \"Income data has been estimated based on neighbor income\" \n", + " [79] \"Is there at least one Formerly Used Defense Site (FUDS) in the tract?\" \n", + " [80] \"Tract-level redlining score meets or exceeds 3.25\" \n", + " [81] \"Identified as disadvantaged due to tribal overlap\" \n", + " [82] \"Housing burden (percent) (percentile)\" \n", + " [83] \"Share of homes with no kitchen or indoor plumbing (percent) (percentile)\" \n", + " [84] \"Total population (percentile)\" \n", + " [85] \"Median household income (% of state median household income) (percentile)\" \n", + " [86] \"Current asthma among adults aged greater than or equal to 18 years (percentile)\" \n", + " [87] \"Coronary heart disease among adults aged greater than or equal to 18 years (percentile)\" \n", + " [88] \"Cancer (excluding skin cancer) among adults aged greater than or equal to 18 years (percentile)\" \n", + " [89] \"Current lack of health insurance among adults aged 18-64 years (percentile)\" \n", + " [90] \"Diagnosed diabetes among adults aged greater than or equal to 18 years (percentile)\" \n", + " [91] \"Physical health not good for greater than or equal to 14 days among adults aged greater than or equal to 18 years (percentile)\" \n", + " [92] \"Percent of individuals < 100% Federal Poverty Line (percentile)\" \n", + " [93] \"Percent of individuals < 150% Federal Poverty Line (percentile)\" \n", + " [94] \"Percent of individuals below 200% Federal Poverty Line (percentile)\" \n", + " [95] \"Area Median Income (State or metropolitan) (percentile)\" \n", + " [96] \"Median household income in the past 12 months (percentile)\" \n", + " [97] \"Energy burden (percentile)\" \n", + " [98] \"FEMA Risk Index Expected Annual Loss Score (percentile)\" \n", + " [99] \"Urban Heuristic Flag (percentile)\" \n", + "[100] \"Air toxics cancer risk (percentile)\" \n", + "[101] \"Respiratory hazard index (percentile)\" \n", + "[102] \"Diesel particulate matter exposure (percentile)\" \n", + "[103] \"PM2.5 in the air (percentile)\" \n", + "[104] \"Ozone (percentile)\" \n", + "[105] \"Traffic proximity and volume (percentile)\" \n", + "[106] \"Proximity to Risk Management Plan (RMP) facilities (percentile)\" \n", + "[107] \"Proximity to hazardous waste sites (percentile)\" \n", + "[108] \"Proximity to NPL sites (percentile)\" \n", + "[109] \"Wastewater discharge (percentile)\" \n", + "[110] \"Percent pre-1960s housing (lead paint indicator) (percentile)\" \n", + "[111] \"Individuals under 5 years old (percentile)\" \n", + "[112] \"Individuals over 64 years old (percentile)\" \n", + "[113] \"Linguistic isolation (percent) (percentile)\" \n", + "[114] \"Percent of households in linguistic isolation (percentile)\" \n", + "[115] \"Poverty (Less than 200% of federal poverty line) (percentile)\" \n", + "[116] \"Percent individuals age 25 or over with less than high school degree (percentile)\" \n", + "[117] \"Unemployment (percent) (percentile)\" \n", + "[118] \"Median value ($) of owner-occupied housing units (percentile)\" \n", + "[119] \"Percent enrollment in college or graduate school (percentile)\" \n", + "[120] \"Percent of population not currently enrolled in college or graduate school (percentile)\" \n", + "[121] \"Expected building loss rate (Natural Hazards Risk Index) (percentile)\" \n", + "[122] \"Expected agricultural loss rate (Natural Hazards Risk Index) (percentile)\" \n", + "[123] \"Expected population loss rate (Natural Hazards Risk Index) (percentile)\" \n", + "[124] \"Percent individuals age 25 or over with less than high school degree in 2009 (percentile)\" \n", + "[125] \"Percentage households below 100% of federal poverty line in 2009 (percentile)\" \n", + "[126] \"Unemployment (percent) in 2009 (percentile)\" \n", + "[127] \"Unemployment (percent) in 2010 (percentile)\" \n", + "[128] \"Percent of individuals less than 100% Federal Poverty Line in 2010 (percentile)\" \n", + "[129] \"Total population in 2009 (percentile)\" \n", + "[130] \"Leaky underground storage tanks (percentile)\" \n", + "[131] \"DOT Travel Barriers Score (percentile)\" \n", + "[132] \"Share of properties at risk of flood in 30 years (percentile)\" \n", + "[133] \"Share of properties at risk of fire in 30 years (percentile)\" \n", + "[134] \"Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)\" \n", + "[135] \"Percent of individuals below 200% Federal Poverty Line, imputed and adjusted (percentile)\" \n", + "[136] \"Percent Black or African American (percentile)\" \n", + "[137] \"Percent American Indian / Alaska Native (percentile)\" \n", + "[138] \"Percent Asian (percentile)\" \n", + "[139] \"Percent Native Hawaiian or Pacific (percentile)\" \n", + "[140] \"Percent two or more races (percentile)\" \n", + "[141] \"Percent White (percentile)\" \n", + "[142] \"Percent Hispanic or Latino (percentile)\" \n", + "[143] \"Percent other races (percentile)\" \n", + "[144] \"Percent age under 10 (percentile)\" \n", + "[145] \"Percent age 10 to 64 (percentile)\" \n", + "[146] \"Percent age over 64 (percentile)\" \n", + "[147] \"Percent of the Census tract that is within Tribal areas (percentile)\" \n", + "[148] \"Number of Tribal areas within Census tract for Alaska (percentile)\" \n", + "[149] \"Number of Tribal areas within Census tract (percentile)\" \n", + "[150] \"Percent of the Census tract that is within Tribal areas, for display (percentile)\" \n", + "[151] \"Percent Black or African American in 2009 (percentile)\" \n", + "[152] \"Percent American Indian / Alaska Native in 2009 (percentile)\" \n", + "[153] \"Percent Asian in 2009 (percentile)\" \n", + "[154] \"Percent Native Hawaiian or Pacific in 2009 (percentile)\" \n", + "[155] \"Percent two or more races in 2009 (percentile)\" \n", + "[156] \"Percent White in 2009 (percentile)\" \n", + "[157] \"Percent Hispanic or Latino in 2009 (percentile)\" \n", + "[158] \"Percent other races in 2009 (percentile)\" \n", + "[159] \"Low median household income as a percent of area median income (percentile)\" \n", + "[160] \"Low life expectancy (percentile)\" \n", + "[161] \"Low median household income as a percent of territory median income in 2009 (percentile)\" \n", + "[162] \"Total population in 2009 (island areas) and 2019 (states and PR)\" \n", + "[163] \"Total threshold criteria exceeded\" \n", + "[164] \"Is low income (imputed and adjusted)?\" \n", + "[165] \"Greater than or equal to the 90th percentile for expected population loss\" \n", + "[166] \"Greater than or equal to the 90th percentile for expected agricultural loss\" \n", + "[167] \"Greater than or equal to the 90th percentile for expected building loss\" \n", + "[168] \"Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years\" \n", + "[169] \"Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years\" \n", + "[170] \"At least one climate threshold exceeded\" \n", + "[171] \"Greater than or equal to the 90th percentile for expected population loss rate and is low income?\" \n", + "[172] \"Greater than or equal to the 90th percentile for expected agriculture loss rate and is low income?\" \n", + "[173] \"Greater than or equal to the 90th percentile for expected building loss rate and is low income?\" \n", + "[174] \"Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income?\" \n", + "[175] \"Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income?\" \n", + "[176] \"Climate Factor (Definition N)\" \n", + "[177] \"Greater than or equal to the 90th percentile for energy burden\" \n", + "[178] \"Greater than or equal to the 90th percentile for pm2.5 exposure\" \n", + "[179] \"At least one energy threshold exceeded\" \n", + "[180] \"Greater than or equal to the 90th percentile for PM2.5 exposure and is low income?\" \n", + "[181] \"Greater than or equal to the 90th percentile for energy burden and is low income?\" \n", + "[182] \"Energy Factor (Definition N)\" \n", + "[183] \"Greater than or equal to the 90th percentile for diesel particulate matter\" \n", + "[184] \"Greater than or equal to the 90th percentile for DOT travel barriers\" \n", + "[185] \"Greater than or equal to the 90th percentile for traffic proximity\" \n", + "[186] \"At least one traffic threshold exceeded\" \n", + "[187] \"Greater than or equal to the 90th percentile for diesel particulate matter and is low income?\" \n", + "[188] \"Greater than or equal to the 90th percentile for traffic proximity and is low income?\" \n", + "[189] \"Greater than or equal to the 90th percentile for DOT transit barriers and is low income?\" \n", + "[190] \"Transportation Factor (Definition N)\" \n", + "[191] \"Tract-level redlining score meets or exceeds 3.25 and is low income\" \n", + "[192] \"Greater than or equal to the 90th percentile for share of homes without indoor plumbing or a kitchen\" \n", + "[193] \"Greater than or equal to the 90th percentile for share of homes with no kitchen or indoor plumbing and is low income?\" \n", + "[194] \"Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile\" \n", + "[195] \"Greater than or equal to the 90th percentile for lead paint and the median house value is less than 90th percentile and is low income?\" \n", + "[196] \"Greater than or equal to the 90th percentile for housing burden\" \n", + "[197] \"Greater than or equal to the 90th percentile for housing burden and is low income?\" \n", + "[198] \"Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent\" \n", + "[199] \"Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income?\"\n", + "[200] \"At least one housing threshold exceeded\" \n", + "[201] \"Housing Factor (Definition N)\" \n", + "[202] \"Greater than or equal to the 90th percentile for RMP proximity\" \n", + "[203] \"Greater than or equal to the 90th percentile for NPL (superfund sites) proximity\" \n", + "[204] \"Greater than or equal to the 90th percentile for proximity to hazardous waste sites\" \n", + "[205] \"Is there at least one Formerly Used Defense Site (FUDS) in the tract, where missing data is treated as False?\" \n", + "[206] \"Is there at least one abandoned mine in this census tract, where missing data is treated as False?\" \n", + "[207] \"At least one pollution threshold exceeded\" \n", + "[208] \"Greater than or equal to the 90th percentile for proximity to RMP sites and is low income?\" \n", + "[209] \"Greater than or equal to the 90th percentile for proximity to superfund sites and is low income?\" \n", + "[210] \"Greater than or equal to the 90th percentile for proximity to hazardous waste facilities and is low income?\" \n", + "[211] \"There is at least one abandoned mine in this census tract and the tract is low income.\" \n", + "[212] \"There is at least one Formerly Used Defense Site (FUDS) in the tract and the tract is low income.\" \n", + "[213] \"Pollution Factor (Definition N)\" \n", + "[214] \"Greater than or equal to the 90th percentile for wastewater discharge\" \n", + "[215] \"Greater than or equal to the 90th percentile for leaky underwater storage tanks\" \n", + "[216] \"Greater than or equal to the 90th percentile for wastewater discharge and is low income?\" \n", + "[217] \"Greater than or equal to the 90th percentile for leaky underground storage tanks and is low income?\" \n", + "[218] \"At least one water threshold exceeded\" \n", + "[219] \"Water Factor (Definition N)\" \n", + "[220] \"Greater than or equal to the 90th percentile for diabetes\" \n", + "[221] \"Greater than or equal to the 90th percentile for asthma\" \n", + "[222] \"Greater than or equal to the 90th percentile for heart disease\" \n", + "[223] \"Greater than or equal to the 90th percentile for low life expectancy\" \n", + "[224] \"At least one health threshold exceeded\" \n", + "[225] \"Greater than or equal to the 90th percentile for diabetes and is low income?\" \n", + "[226] \"Greater than or equal to the 90th percentile for asthma and is low income?\" \n", + "[227] \"Greater than or equal to the 90th percentile for heart disease and is low income?\" \n", + "[228] \"Greater than or equal to the 90th percentile for low life expectancy and is low income?\" \n", + "[229] \"Health Factor (Definition N)\" \n", + "[230] \"Low high school education\" \n", + "[231] \"Greater than or equal to the 90th percentile for unemployment\" \n", + "[232] \"Greater than or equal to the 90th percentile for low median household income as a percent of area median income\" \n", + "[233] \"Greater than or equal to the 90th percentile for households in linguistic isolation\" \n", + "[234] \"Greater than or equal to the 90th percentile for households at or below 100% federal poverty level\" \n", + "[235] \"Greater than or equal to the 90th percentile for households in linguistic isolation and has low HS attainment?\" \n", + "[236] \"Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS attainment?\" \n", + "[237] \"Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS attainment?\" \n", + "[238] \"Greater than or equal to the 90th percentile for unemployment and has low HS attainment?\" \n", + "[239] \"At least one workforce threshold exceeded\" \n", + "[240] \"Unemployment (percent) in 2009 (island areas) and 2010 (states and PR)\" \n", + "[241] \"Unemployment (percent) in 2009 for island areas (percentile)\" \n", + "[242] \"Unemployment (percent) in 2009 exceeds 90th percentile\" \n", + "[243] \"Percentage households below 100% of federal poverty line in 2009 (island areas) and 2010 (states and PR)\" \n", + "[244] \"Percentage households below 100% of federal poverty line in 2009 for island areas (percentile)\" \n", + "[245] \"Percentage households below 100% of federal poverty line in 2009 exceeds 90th percentile\" \n", + "[246] \"Low median household income as a percent of territory median income in 2009 exceeds 90th percentile\" \n", + "[247] \"Low high school education in 2009 (island areas)\" \n", + "[248] \"Greater than or equal to the 90th percentile for unemployment and has low HS education in 2009 (island areas)?\" \n", + "[249] \"Greater than or equal to the 90th percentile for households at or below 100% federal poverty level and has low HS education in 2009 (island areas)?\" \n", + "[250] \"Greater than or equal to the 90th percentile for low median household income as a percent of area median income and has low HS education in 2009 (island areas)?\" \n", + "[251] \"Both workforce socioeconomic indicators exceeded\" \n", + "[252] \"Workforce Factor (Definition N)\" \n", + "[253] \"Total categories exceeded\" \n", + "[254] \"Definition N (communities)\" \n", + "[255] \"Definition N (communities) (percentile)\" \n", + "[256] \"Meets the less stringent low income criterion for the adjacency index?\" \n", + "[257] \"Definition N (communities) (average of neighbors)\" \n", + "[258] \"Is the tract surrounded by disadvantaged communities?\" \n", + "[259] \"Definition N (communities) (based on adjacency index and low income alone)\" \n", + "[260] \"Definition N community, including adjacency index tracts\" \n", + "[261] \"Percentage of tract that is disadvantaged\" " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "
A tibble: 6 × 4
Share of the tract's land area that is covered by impervious surface or cropland as a percentShare of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percentGreater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income?
<dbl><dbl><lgl><lgl>
21.24750.2685590FALSEFALSE
42.12540.5569694FALSEFALSE
18.37480.2323578FALSEFALSE
37.92300.4961469FALSEFALSE
51.48350.6894912FALSEFALSE
54.54830.7298005FALSEFALSE
\n" + ], + "text/latex": [ + "A tibble: 6 × 4\n", + "\\begin{tabular}{llll}\n", + " Share of the tract's land area that is covered by impervious surface or cropland as a percent & Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile) & Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent & Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income?\\\\\n", + " & & & \\\\\n", + "\\hline\n", + "\t 21.2475 & 0.2685590 & FALSE & FALSE\\\\\n", + "\t 42.1254 & 0.5569694 & FALSE & FALSE\\\\\n", + "\t 18.3748 & 0.2323578 & FALSE & FALSE\\\\\n", + "\t 37.9230 & 0.4961469 & FALSE & FALSE\\\\\n", + "\t 51.4835 & 0.6894912 & FALSE & FALSE\\\\\n", + "\t 54.5483 & 0.7298005 & FALSE & FALSE\\\\\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 6 × 4\n", + "\n", + "| Share of the tract's land area that is covered by impervious surface or cropland as a percent <dbl> | Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile) <dbl> | Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent <lgl> | Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income? <lgl> |\n", + "|---|---|---|---|\n", + "| 21.2475 | 0.2685590 | FALSE | FALSE |\n", + "| 42.1254 | 0.5569694 | FALSE | FALSE |\n", + "| 18.3748 | 0.2323578 | FALSE | FALSE |\n", + "| 37.9230 | 0.4961469 | FALSE | FALSE |\n", + "| 51.4835 | 0.6894912 | FALSE | FALSE |\n", + "| 54.5483 | 0.7298005 | FALSE | FALSE |\n", + "\n" + ], + "text/plain": [ + " Share of the tract's land area that is covered by impervious surface or cropland as a percent\n", + "1 21.2475 \n", + "2 42.1254 \n", + "3 18.3748 \n", + "4 37.9230 \n", + "5 51.4835 \n", + "6 54.5483 \n", + " Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)\n", + "1 0.2685590 \n", + "2 0.5569694 \n", + "3 0.2323578 \n", + "4 0.4961469 \n", + "5 0.6894912 \n", + "6 0.7298005 \n", + " Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent\n", + "1 FALSE \n", + "2 FALSE \n", + "3 FALSE \n", + "4 FALSE \n", + "5 FALSE \n", + "6 FALSE \n", + " Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income?\n", + "1 FALSE \n", + "2 FALSE \n", + "3 FALSE \n", + "4 FALSE \n", + "5 FALSE \n", + "6 FALSE " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "score_full_cols = colnames(score_dat_full)\n", + "score_full_cols\n", + "impervious_cols = score_full_cols[grepl(\"impervious\", score_full_cols)]\n", + "score_dat_impervious = score_dat_full[,impervious_cols ]\n", + "head(score_dat_impervious)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "90f2ec46", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "1595" + ], + "text/latex": [ + "1595" + ], + "text/markdown": [ + "1595" + ], + "text/plain": [ + "[1] 1595" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "1595" + ], + "text/latex": [ + "1595" + ], + "text/markdown": [ + "1595" + ], + "text/plain": [ + "[1] 1595" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# check base score.\n", + "sum(is.na(score_dat_impervious[,1]))\n", + "nrow(score_dat_impervious) - length(impervious_in) ## the missing tracts were initiated after the join. they aren't in the original data set. Its likely because of the CONUS issue. \n", + "sum(score_dat_impervious[,1] >= quantile(score_dat_impervious[,1], .9, na.rm = TRUE), na.rm = TRUE) ## calculate the number at or above 90th percentile" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "0aa90b2b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Check the calculated percentile\n", + "sum(score_dat_impervious[, 2] >= .9, na.rm = TRUE)\n", + "## the calculated percentile lines up" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "8ec31ba9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Check in on the TRUE/FALSE Flag\n", + "sum(score_dat_impervious[,3] == TRUE)\n", + "## okay, the flag here is correct as well. So where does it go wrong?" + ] + }, + { + "cell_type": "markdown", + "id": "a8199ac4", + "metadata": {}, + "source": [ + "Next, the data gets post processed to add in demographic information about the tracts" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "bcd854e3", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "\u001b[36m──\u001b[39m \u001b[1m\u001b[1mColumn specification\u001b[1m\u001b[22m \u001b[36m────────────────────────────────────────────────────────\u001b[39m\n", + "cols(\n", + " .default = col_double(),\n", + " `Census tract 2010 ID` = \u001b[31mcol_character()\u001b[39m,\n", + " `County Name` = \u001b[31mcol_character()\u001b[39m,\n", + " `State/Territory` = \u001b[31mcol_character()\u001b[39m,\n", + " `Identified as disadvantaged without considering neighbors` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Identified as disadvantaged based on neighbors and relaxed low income threshold only` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Identified as disadvantaged due to tribal overlap` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Identified as disadvantaged` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Income data has been estimated based on geographic neighbor income` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for expected agriculture loss rate and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for expected building loss rate and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for expected population loss rate and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for share of properties at risk of flood in 30 years and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for share of properties at risk of fire in 30 years and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for energy burden and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for PM2.5 exposure and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for diesel particulate matter and is low income?` = \u001b[33mcol_logical()\u001b[39m,\n", + " `Greater than or equal to the 90th percentile for traffic proximity and is low income?` = \u001b[33mcol_logical()\u001b[39m\n", + " # ... with 32 more columns\n", + ")\n", + "\u001b[36mℹ\u001b[39m Use \u001b[30m\u001b[47m\u001b[30m\u001b[47m`spec()`\u001b[47m\u001b[30m\u001b[49m\u001b[39m for the full column specifications.\n", + "\n", + "\n", + "Warning message:\n", + "“52 parsing failures.\n", + " row col expected actual file\n", + "1182 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 8.0 '../data/score/downloadable/beta-communities.csv'\n", + "1183 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 4.0 '../data/score/downloadable/beta-communities.csv'\n", + "1184 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 1.0 '../data/score/downloadable/beta-communities.csv'\n", + "1185 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 1.0 '../data/score/downloadable/beta-communities.csv'\n", + "1203 Number of Tribal areas within Census tract for Alaska 1/0/T/F/TRUE/FALSE 5.0 '../data/score/downloadable/beta-communities.csv'\n", + ".... ..................................................... .................. ...... .................................................\n", + "See problems(...) for more details.\n", + "”\n" + ] + } + ], + "source": [ + "score_post_full_path = list.files(\"../data/score/downloadable\", pattern = \".csv\", full.names = TRUE)[3]\n", + "score_post = read_csv(score_post_full_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "ad43a10e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "
A tibble: 6 × 4
Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income?Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percentShare of the tract's land area that is covered by impervious surface or cropland as a percentShare of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)
<lgl><lgl><dbl><dbl>
FALSEFALSE 76010
FALSEFALSE205826
FALSEFALSE235329
FALSEFALSE233329
FALSEFALSE395551
FALSEFALSE193724
\n" + ], + "text/latex": [ + "A tibble: 6 × 4\n", + "\\begin{tabular}{llll}\n", + " Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income? & Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent & Share of the tract's land area that is covered by impervious surface or cropland as a percent & Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)\\\\\n", + " & & & \\\\\n", + "\\hline\n", + "\t FALSE & FALSE & 760 & 10\\\\\n", + "\t FALSE & FALSE & 2058 & 26\\\\\n", + "\t FALSE & FALSE & 2353 & 29\\\\\n", + "\t FALSE & FALSE & 2333 & 29\\\\\n", + "\t FALSE & FALSE & 3955 & 51\\\\\n", + "\t FALSE & FALSE & 1937 & 24\\\\\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 6 × 4\n", + "\n", + "| Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income? <lgl> | Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent <lgl> | Share of the tract's land area that is covered by impervious surface or cropland as a percent <dbl> | Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile) <dbl> |\n", + "|---|---|---|---|\n", + "| FALSE | FALSE | 760 | 10 |\n", + "| FALSE | FALSE | 2058 | 26 |\n", + "| FALSE | FALSE | 2353 | 29 |\n", + "| FALSE | FALSE | 2333 | 29 |\n", + "| FALSE | FALSE | 3955 | 51 |\n", + "| FALSE | FALSE | 1937 | 24 |\n", + "\n" + ], + "text/plain": [ + " Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent and is low income?\n", + "1 FALSE \n", + "2 FALSE \n", + "3 FALSE \n", + "4 FALSE \n", + "5 FALSE \n", + "6 FALSE \n", + " Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent\n", + "1 FALSE \n", + "2 FALSE \n", + "3 FALSE \n", + "4 FALSE \n", + "5 FALSE \n", + "6 FALSE \n", + " Share of the tract's land area that is covered by impervious surface or cropland as a percent\n", + "1 760 \n", + "2 2058 \n", + "3 2353 \n", + "4 2333 \n", + "5 3955 \n", + "6 1937 \n", + " Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)\n", + "1 10 \n", + "2 26 \n", + "3 29 \n", + "4 29 \n", + "5 51 \n", + "6 24 " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "score_post_cols = colnames(score_post)\n", + "score_post_impervious_cols = score_post_cols[grepl(\"impervious\", score_post_cols)]\n", + "score_post_impervious = score_post[,score_post_impervious_cols]\n", + "head(score_post_impervious)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "c62ea209", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "1595" + ], + "text/latex": [ + "1595" + ], + "text/markdown": [ + "1595" + ], + "text/plain": [ + "[1] 1595" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "1595" + ], + "text/latex": [ + "1595" + ], + "text/markdown": [ + "1595" + ], + "text/plain": [ + "[1] 1595" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "7258" + ], + "text/latex": [ + "7258" + ], + "text/markdown": [ + "7258" + ], + "text/plain": [ + "[1] 7258" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# check base score. That still came through\n", + "sum(is.na(score_post_impervious[,3]))\n", + "nrow(score_post_impervious) - length(impervious_in) \n", + "sum(score_post_impervious[,3] >= quantile(score_post_impervious[,3], .9, na.rm = TRUE), na.rm = TRUE) ## calculate the number at or above 90th percentile" + ] + }, + { + "cell_type": "markdown", + "id": "89be6c95", + "metadata": {}, + "source": [ + "I think there is likely just a rounding error that made that 7258 instead of 7254" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "2a905ca6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sum(score_post_impervious[, 4] >= 90, na.rm = TRUE)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "7a1116b0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sum(score_post_impervious[,2] == TRUE)" + ] + }, + { + "cell_type": "markdown", + "id": "f6cd3ce5", + "metadata": {}, + "source": [ + "Take a look at the tiles themselves. " + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "256b3cf6", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "\u001b[36m──\u001b[39m \u001b[1m\u001b[1mColumn specification\u001b[1m\u001b[22m \u001b[36m────────────────────────────────────────────────────────\u001b[39m\n", + "cols(\n", + " .default = col_logical(),\n", + " GTF = \u001b[31mcol_character()\u001b[39m,\n", + " SF = \u001b[31mcol_character()\u001b[39m,\n", + " CF = \u001b[31mcol_character()\u001b[39m,\n", + " DF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " AF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " HDF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " DSF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " EBF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " EALR_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " EBLR_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " EPLR_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " HBF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " LLEF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " LIF_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " LMI_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " PM25F_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " HSEF = \u001b[32mcol_double()\u001b[39m,\n", + " P100_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " P200_I_PFS = \u001b[32mcol_double()\u001b[39m,\n", + " LPF_PFS = \u001b[32mcol_double()\u001b[39m\n", + " # ... with 30 more columns\n", + ")\n", + "\u001b[36mℹ\u001b[39m Use \u001b[30m\u001b[47m\u001b[30m\u001b[47m`spec()`\u001b[47m\u001b[30m\u001b[49m\u001b[39m for the full column specifications.\n", + "\n", + "\n", + "Warning message:\n", + "“513 parsing failures.\n", + " row col expected actual file\n", + "1182 TA_COUNT_AK 1/0/T/F/TRUE/FALSE 1.0 '../data/score/csv/tiles/usa.csv'\n", + "1183 TA_COUNT_AK 1/0/T/F/TRUE/FALSE 4.0 '../data/score/csv/tiles/usa.csv'\n", + "1184 TA_COUNT_AK 1/0/T/F/TRUE/FALSE 3.0 '../data/score/csv/tiles/usa.csv'\n", + "1187 TA_COUNT_AK 1/0/T/F/TRUE/FALSE 7.0 '../data/score/csv/tiles/usa.csv'\n", + "1189 TA_COUNT_AK 1/0/T/F/TRUE/FALSE 3.0 '../data/score/csv/tiles/usa.csv'\n", + ".... ........... .................. ...... .................................\n", + "See problems(...) for more details.\n", + "”\n" + ] + } + ], + "source": [ + "score_tiles_path = list.files(\"../data/score/csv/tiles\", pattern = \".csv\", full.names = TRUE)\n", + "score_tiles = read_csv(score_tiles_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "097afdae", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\n", + "
A tibble: 1 × 2
IS_PFSIS_ET
<int><int>
72547254
\n" + ], + "text/latex": [ + "A tibble: 1 × 2\n", + "\\begin{tabular}{ll}\n", + " IS\\_PFS & IS\\_ET\\\\\n", + " & \\\\\n", + "\\hline\n", + "\t 7254 & 7254\\\\\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 1 × 2\n", + "\n", + "| IS_PFS <int> | IS_ET <int> |\n", + "|---|---|\n", + "| 7254 | 7254 |\n", + "\n" + ], + "text/plain": [ + " IS_PFS IS_ET\n", + "1 7254 7254 " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "score_tiles %>% select(IS_PFS, IS_ET) %>%\n", + "summarise(\n", + " IS_PFS = sum(IS_PFS >=.9, na.rm = TRUE) \n", + " , IS_ET = sum(IS_ET) # okay, this came through correctly this time. \n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "bb3a53e0", + "metadata": {}, + "outputs": [], + "source": [ + "score_mapping_path = list.files(\"../data/score/csv/tiles\", pattern = \"json\", full.names = TRUE)\n", + " score_mapping = fromJSON(file = score_mapping_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "716ecfad", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "
A tibble: 2 × 2
abbrevnames
<chr><named list>
IS_PFSShare of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)
IS_ET Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent
\n" + ], + "text/latex": [ + "A tibble: 2 × 2\n", + "\\begin{tabular}{ll}\n", + " abbrev & names\\\\\n", + " & \\\\\n", + "\\hline\n", + "\t IS\\_PFS & Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile)\\\\\n", + "\t IS\\_ET & Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent\\\\\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 2 × 2\n", + "\n", + "| abbrev <chr> | names <named list> |\n", + "|---|---|\n", + "| IS_PFS | Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile) |\n", + "| IS_ET | Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent |\n", + "\n" + ], + "text/plain": [ + " abbrev\n", + "1 IS_PFS\n", + "2 IS_ET \n", + " names \n", + "1 Share of the tract's land area that is covered by impervious surface or cropland as a percent (percentile) \n", + "2 Greater than or equal to the 90th percentile for share of the tract's land area that is covered by impervious surface or cropland as a percent" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tibble(\n", + " abbrev = names(score_mapping)\n", + " , names = flatten(score_mapping )\n", + " ) %>%\n", + "filter(grepl(\"impervious\", names))" + ] + }, + { + "cell_type": "markdown", + "id": "289a9e93", + "metadata": {}, + "source": [ + "Next, we have the Json with the shape files. And the problem propogates into the .json files. " + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "c81c867e", + "metadata": {}, + "outputs": [], + "source": [ + "high_res_json_path = list.files(\"../data/score/geojson\", pattern = \"high\", full.names = TRUE)\n", + "high_res_json <- fromJSON(file = high_res_json_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "142c8a38", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "List of 3\n", + " $ type : chr \"FeatureCollection\"\n", + " $ crs :List of 2\n", + " ..$ type : chr \"name\"\n", + " ..$ properties:List of 1\n", + " .. ..$ name: chr \"urn:ogc:def:crs:OGC:1.3:CRS84\"\n", + " $ features:List of 74134\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " ..$ :List of 3\n", + " .. ..$ type : chr \"Feature\"\n", + " .. ..$ properties:List of 123\n", + " .. ..$ geometry :List of 2\n", + " .. [list output truncated]\n" + ] + } + ], + "source": [ + "glimpse(high_res_json)" + ] + }, + { + "cell_type": "markdown", + "id": "ae309c2c", + "metadata": {}, + "source": [ + "We want IS_PFS and IS_ET" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "dbf131fa", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "'FeatureCollection'" + ], + "text/latex": [ + "'FeatureCollection'" + ], + "text/markdown": [ + "'FeatureCollection'" + ], + "text/plain": [ + "[1] \"FeatureCollection\"" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "0.26" + ], + "text/latex": [ + "0.26" + ], + "text/markdown": [ + "0.26" + ], + "text/plain": [ + "[1] 0.26" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "FALSE" + ], + "text/latex": [ + "FALSE" + ], + "text/markdown": [ + "FALSE" + ], + "text/plain": [ + "[1] FALSE" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "high_res_json$type\n", + "high_res_json$features[[1]]$properties$IS_PFS\n", + "high_res_json$features[[1]]$properties$IS_ET" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "56e93d0e", + "metadata": {}, + "outputs": [], + "source": [ + "impervious_json = map(\n", + " # 1:10, \n", + " 1:length(high_res_json$features), \n", + " ~ tibble(\n", + " GEOID = high_res_json$features[[.x]]$properties$GEOID\n", + " , IS_PFS = as.numeric(high_res_json$features[[.x]]$properties$IS_PFS)\n", + " , IS_ET = high_res_json$features[[.x]]$properties$IS_ET\n", + " )\n", + " ) " + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "961e6d31", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "
A tibble: 6 × 3
GEOIDIS_PFSIS_ET
<chr><dbl><lgl>
010730011000.26FALSE
010730014000.55FALSE
010730020000.23FALSE
010730038020.49FALSE
010730040000.68FALSE
010730051010.72FALSE
\n" + ], + "text/latex": [ + "A tibble: 6 × 3\n", + "\\begin{tabular}{lll}\n", + " GEOID & IS\\_PFS & IS\\_ET\\\\\n", + " & & \\\\\n", + "\\hline\n", + "\t 01073001100 & 0.26 & FALSE\\\\\n", + "\t 01073001400 & 0.55 & FALSE\\\\\n", + "\t 01073002000 & 0.23 & FALSE\\\\\n", + "\t 01073003802 & 0.49 & FALSE\\\\\n", + "\t 01073004000 & 0.68 & FALSE\\\\\n", + "\t 01073005101 & 0.72 & FALSE\\\\\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 6 × 3\n", + "\n", + "| GEOID <chr> | IS_PFS <dbl> | IS_ET <lgl> |\n", + "|---|---|---|\n", + "| 01073001100 | 0.26 | FALSE |\n", + "| 01073001400 | 0.55 | FALSE |\n", + "| 01073002000 | 0.23 | FALSE |\n", + "| 01073003802 | 0.49 | FALSE |\n", + "| 01073004000 | 0.68 | FALSE |\n", + "| 01073005101 | 0.72 | FALSE |\n", + "\n" + ], + "text/plain": [ + " GEOID IS_PFS IS_ET\n", + "1 01073001100 0.26 FALSE\n", + "2 01073001400 0.55 FALSE\n", + "3 01073002000 0.23 FALSE\n", + "4 01073003802 0.49 FALSE\n", + "5 01073004000 0.68 FALSE\n", + "6 01073005101 0.72 FALSE" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "impervious_json_df <- bind_rows(impervious_json)\n", + "head(impervious_json_df)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "1aa32ec9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "7254" + ], + "text/latex": [ + "7254" + ], + "text/markdown": [ + "7254" + ], + "text/plain": [ + "[1] 7254" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "sum(impervious_json_df$IS_PFS >= .9)\n", + "sum(impervious_json_df$IS_ET)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "190aa389", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "
A tibble: 0 × 3
GEOIDIS_PFSIS_ET
<chr><dbl><lgl>
\n" + ], + "text/latex": [ + "A tibble: 0 × 3\n", + "\\begin{tabular}{lll}\n", + " GEOID & IS\\_PFS & IS\\_ET\\\\\n", + " & & \\\\\n", + "\\hline\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 0 × 3\n", + "\n", + "| GEOID <chr> | IS_PFS <dbl> | IS_ET <lgl> |\n", + "|---|---|---|\n", + "\n" + ], + "text/plain": [ + " GEOID IS_PFS IS_ET" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "impervious_json_df %>% filter(IS_PFS >= .9, IS_ET == FALSE) %>% head() # This is correct!" + ] + }, + { + "cell_type": "markdown", + "id": "f08da689", + "metadata": {}, + "source": [ + " okay, how did we get that the IS_ET is false when IS_PFS >= .9?. This is now fixed\n" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "b4fc9575", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\n", + "
A tibble: 1 × 3
GEOIDIS_PFSIS_ET
<chr><dbl><lgl>
110010047010.95TRUE
\n" + ], + "text/latex": [ + "A tibble: 1 × 3\n", + "\\begin{tabular}{lll}\n", + " GEOID & IS\\_PFS & IS\\_ET\\\\\n", + " & & \\\\\n", + "\\hline\n", + "\t 11001004701 & 0.95 & TRUE\\\\\n", + "\\end{tabular}\n" + ], + "text/markdown": [ + "\n", + "A tibble: 1 × 3\n", + "\n", + "| GEOID <chr> | IS_PFS <dbl> | IS_ET <lgl> |\n", + "|---|---|---|\n", + "| 11001004701 | 0.95 | TRUE |\n", + "\n" + ], + "text/plain": [ + " GEOID IS_PFS IS_ET\n", + "1 11001004701 0.95 TRUE " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "impervious_json_df %>% filter(GEOID == \"11001004701\")" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "id": "23c08b31", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Linking to GEOS 3.8.1, GDAL 3.1.4, PROJ 6.3.1\n", + "\n" + ] + } + ], + "source": [ + "library(osmextract)\n", + "library(sf)" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "id": "42ba5744", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "'../data/score/tiles/low/0/0/0.gpkg'" + ], + "text/latex": [ + "'../data/score/tiles/low/0/0/0.gpkg'" + ], + "text/markdown": [ + "'../data/score/tiles/low/0/0/0.gpkg'" + ], + "text/plain": [ + "[1] \"../data/score/tiles/low/0/0/0.gpkg\"" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tile_path = list.files(\"../data/score/tiles/low/0/0\", full.names = TRUE)[1]\n", + "tile_path" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "id": "ec4be11d", + "metadata": {}, + "outputs": [ + { + "ename": "ERROR", + "evalue": "Error: Cannot open \"/Users/samuelpowers/Documents/USDS/justice40-tool/data/data-pipeline/data_pipeline/data/score/tiles/low/0/0/0.gpkg\"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.\n", + "output_type": "error", + "traceback": [ + "Error: Cannot open \"/Users/samuelpowers/Documents/USDS/justice40-tool/data/data-pipeline/data_pipeline/data/score/tiles/low/0/0/0.gpkg\"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.\nTraceback:\n", + "1. oe_read(tile_path)", + "2. sf::st_read(dsn = file_path, layer = layer, quiet = quiet, ...)", + "3. st_read.character(dsn = file_path, layer = layer, quiet = quiet, \n . ...)", + "4. CPL_read_ogr(dsn, layer, query, as.character(options), quiet, \n . type, fid_column_name, drivers, wkt_filter, promote_to_multi, \n . int64_as_string, dsn_exists, dsn_isdb)" + ] + } + ], + "source": [ + "tile_read = oe_read(tile_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "a81e1b1e", + "metadata": {}, + "outputs": [ + { + "ename": "ERROR", + "evalue": "Error in eval(expr, envir, enclos): object 'tile_read' not found\n", + "output_type": "error", + "traceback": [ + "Error in eval(expr, envir, enclos): object 'tile_read' not found\nTraceback:\n" + ] + } + ], + "source": [ + "tile_read" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "R", + "language": "R", + "name": "ir" + }, + "language_info": { + "codemirror_mode": "r", + "file_extension": ".r", + "mimetype": "text/x-r-source", + "name": "R", + "pygments_lexer": "r", + "version": "4.0.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/data/data-pipeline/data_pipeline/score/score_narwhal.py b/data/data-pipeline/data_pipeline/score/score_narwhal.py index 65753090..88473ca5 100644 --- a/data/data-pipeline/data_pipeline/score/score_narwhal.py +++ b/data/data-pipeline/data_pipeline/score/score_narwhal.py @@ -4,7 +4,9 @@ import data_pipeline.etl.score.constants as constants import data_pipeline.score.field_names as field_names import numpy as np import pandas as pd -from data_pipeline.score.score import Score +from data_pipeline.score.score import ( + Score, +) # this just adds the framework of the score class from data_pipeline.score.utils import calculate_tract_adjacency_scores from data_pipeline.utils import get_module_logger @@ -14,7 +16,7 @@ logger = get_module_logger(__name__) class ScoreNarwhal(Score): """Score N, aka Narwhal.""" - LOW_INCOME_THRESHOLD: float = 0.65 + LOW_INCOME_THRESHOLD: float = 0.65 # this is the low income threshold that gets compared against the other indicators. It is a percentile rank MAX_COLLEGE_ATTENDANCE_THRESHOLD: float = 0.20 ENVIRONMENTAL_BURDEN_THRESHOLD: float = 0.90 MEDIAN_HOUSE_VALUE_THRESHOLD: float = 0.90 @@ -441,9 +443,13 @@ class ScoreNarwhal(Score): ) # any of the burdens - self.df[field_names.HOUSING_THREHSOLD_EXCEEDED] = self.df[ + self.df[ + field_names.HOUSING_THREHSOLD_EXCEEDED + ] = self.df[ # we need this to include all of the ones that are intersected with low income in order to properly calculate the total score. housing_eligibility_columns - ].any(axis="columns") + ].any( + axis="columns" + ) self._increment_total_eligibility_exceeded( housing_eligibility_columns, @@ -461,7 +467,7 @@ class ScoreNarwhal(Score): # Source: Census's American Community Survey pollution_eligibility_columns = [ - field_names.RMP_LOW_INCOME_FIELD, + field_names.RMP_LOW_INCOME_FIELD, # include low income in these fields because they help calculate the overall score field_names.SUPERFUND_LOW_INCOME_FIELD, field_names.HAZARDOUS_WASTE_LOW_INCOME_FIELD, field_names.AML_LOW_INCOME_FIELD,