Add disaggregated census data/maps
This MR adds targets and slightly adjusts the previous get_census_data()
2_process/src/data_utils.R
to add a renaming of col name from estimate to percent for percent specific pulled census varialbes (namely income & age related variables)
Also slightly edited viz mapping function to apply a 0-100 legend for the percent census variable data
Merge request reports
Activity
mentioned in issue #4 (closed)
requested review from @cnell
- Resolved by Azadpour, Elmera
- Resolved by Azadpour, Elmera
- Resolved by Azadpour, Elmera
316 percent_leg = FALSE, 317 var = 'estimate', 318 conus_sf = p1_conus_sf, 319 outfile_path = "3_visualize/out/tot_education_18-24_highschool_2022.png", 320 pal = "OrRd", 321 leg_title = "Total population 18-24 years\nHigh school graduate (includes equivalency), 2022", 322 width = 6, 323 height = 4, 324 dpi = 300, 325 counties_outline_col = "grey80", 326 conus_outline_col = 'grey50', 327 bg_col = "white", 328 load_font = 'Source Sans Pro', 329 font_size = 10 330 ), 331 format = "file" - Comment on lines +311 to +331
This map and the next map are the only ones that appear to be disaggregated. What I was thinking was being able to show how different indicators intersect with one another. For example, showing a map that shows median income for black populations. That requires the data to be in a format where for different race and ethnicity categories there is a median income estimate. For for these two we can see age differences in education level. I think it'd be useful to see them side-by-side for a visual comparison that connects to the indicators.
In contrast, aggregated data shows the median income across the total population and we are not able to see how it directly relates to race. Were you able to find any data layers like this? With the importance of demographic indicators, this would be a nice addition.
After digging a bit more
View(load_variables(2022, "acs5", cache = TRUE))
B19013A_001, B19013B_001, B19013C_001, B19013D_001, B19013E_001, B19013I_001
look like they could work.B19013A_001
Estimate!!Median household income in the past 12 months (in 2022 inflation-adjusted dollars) Median Household Income in the Past 12 Months (in 2022 Inflation-Adjusted Dollars) (White Alone Householder)
B19013B_001
Estimate!!Median household income in the past 12 months (in 2022 inflation-adjusted dollars) Median Household Income in the Past 12 Months (in 2022 Inflation-Adjusted Dollars) (Black or African American Alone Householder)
B19013C_001
Estimate!!Median household income in the past 12 months (in 2022 inflation-adjusted dollars) Median Household Income in the Past 12 Months (in 2022 Inflation-Adjusted Dollars) (American Indian and Alaska Native Alone Householder)
B19013D_001
Estimate!!Median household income in the past 12 months (in 2022 inflation-adjusted dollars) Median Household Income in the Past 12 Months (in 2022 Inflation-Adjusted Dollars) (Asian Alone Householder)
B19013E_001
Estimate!!Median household income in the past 12 months (in 2022 inflation-adjusted dollars) Median Household Income in the Past 12 Months (in 2022 Inflation-Adjusted Dollars) (Native Hawaiian and Other Pacific Islander Alone Householder)
B19013I_001
Estimate!!Median household income in the past 12 months (in 2022 inflation-adjusted dollars) Median Household Income in the Past 12 Months (in 2022 Inflation-Adjusted Dollars) (Hispanic or Latino Householder)
Edited by Azadpour, Elmera
87 iteration = "list"), 88 # income related variables 89 # S1901_C01_014 = Estimate!!Households!!PERCENT ALLOCATED!!Household income in the past 12 months 90 # S1901_C01_015 = Estimate!!Households!!PERCENT ALLOCATED!!Family income in the past 12 months 91 # S1901_C01_016 = Estimate!!Households!!PERCENT ALLOCATED!!Nonfamily income in the past 12 months 92 tar_target(p2_census_acs5sub_income_layers, 93 c("S1901_C01_014", "S1901_C01_015", "S1901_C01_016")), 94 tar_target(p2_census_acs5sub_income_data, 95 get_census_data(geography = 'county', variable = p2_census_acs5sub_income_layers, 96 states = p1_census_states, year = 2022, proj = p1_proj, 97 survey_var = "acs5", percent_rename = TRUE), 98 pattern = map(p2_census_acs5sub_income_layers), 99 iteration = "list"), 100 # education related variables 101 # S1501_C01_003 = Estimate!!Total!!AGE BY EDUCATIONAL ATTAINMENT!!Population 18 to 24 years!!High school graduate (includes equivalency) 102 # S1501_C01_009 = Estimate!!Total!!AGE BY EDUCATIONAL ATTAINMENT!!Population 25 years and over!!High school graduate (includes equivalency) Unfortunately not %black/latino/etc 18-24 years old with high school equivalency. But there is:
Estimate!!Percent Female!!MEDIAN EARNINGS IN THE PAST 12 MONTHS (IN 2022 INFLATION-ADJUSTED DOLLARS)!!Population 25 years and over with earnings
Estimate!!Percent Female!!MEDIAN EARNINGS IN THE PAST 12 MONTHS (IN 2022 INFLATION-ADJUSTED DOLLARS)!Population 25 years and over with earnings!!Bachelor's degree
Estimate!!Percent Female!!MEDIAN EARNINGS IN THE PAST 12 MONTHS (IN 2022 INFLATION-ADJUSTED DOLLARS)!!Population 25 years and over with earnings!!Graduate or professional degree
Estimate!!Percent Female!!MEDIAN EARNINGS IN THE PAST 12 MONTHS (IN 2022 INFLATION-ADJUSTED DOLLARS)!!Population 25 years and over with earnings!!High school graduate (includes equivalency)
and same for male...
@cnell - for awareness:
In the project check-in meeting today, we went through the whole site and how these maps fit into the wider narrative. We decided that to really bring out the main takeaways from the study's findings, Elmera could create a smaller, more specified subset of maps. These maps will each take one of the main conclusions and (1) add the geographical context while also providing (2) the direction of the conclusion, which is otherwise not readily apparent to readers. Each map will be its own little case study, and Mandie and Elmera will work together on the narratives to go with the maps.
Example Finding: Household structure, such as female-lead households, affects water vulnerability (high agreement, high evidence). To illustrate this, create a map that shows where the highest proportion of female-lead households are, and use a color ramp that indicates that this factor is positively related to vulnerability (i.e., increases vulnerability).
Based on our discussion, I think this means that there will be about three or four maps now with clear takeaways.
More edits to come re:case study approach but wanted to streamline some of the code - thanks for the tsibble suggestion Cee
Edited by Azadpour, Elmera
added 6 commits
- 8ed29031 - drop supplemental data Oronde provided
- de6c1d17 - drop previous indicator tree png
- 473a227a - add p0 naming and slight cleaning of code structure
- 0ce311d0 - drop raw data provided by oronde targets
- fa8146fa - edit processing to use SB data csv
- 861dd54a - push determinant aggregated data for Aileen to use and edit gitignore to reflect
Toggle commit listmentioned in issue #2 (closed)
added 1 commit
- 45a8696e - add evidence and agreement bins for determinant agg data
added 1 commit
- 52dc8c72 - add indicator_uncertainty.csv output for Aileens bubble charts