# change target metro and peers here
# target_cbsa <- "19740"
target_cbsa <- "31140"
# peer_cbsa <- c("35620", "16980", "31080", "47900")
peer_cbsa <- c("13820","16740","17140","18140","24660","26900","28140","34980", "36540", "32820")
# peer_cbsa <- c("12420", "33460", "38060", "38900", "41740", "41620", "42660")
# get counties
target_co <- (county_cbsa_st %>%
filter(cbsa_code == target_cbsa) )[["stco_code"]]
peer_co <- (county_cbsa_st %>%
filter(cbsa_code %in% peer_cbsa) )[["stco_code"]]
# filter datasets
cbsa_output <- cbsa_all %>%
filter(cbsa_code %in% c(target_cbsa, peer_cbsa)) %>%
left_join(county_cbsa_st[c("cbsa_code", "cbsa_emp")], by = "cbsa_code") %>%
unique()
# make it a shiny app!
# selectInput("target_cbsa", "", )
Annual average R&D expenditure at higher education institutions per 1000 workers, 2012 - 2016 (plots can be generated for other tables as well, if needed)
cbsa_output %>%
select(cbsa_code, cbsa_name, rd_total, cbsa_emp) %>%
mutate(rd_per_1000worker = rd_total/cbsa_emp * 1000/5) %>%
knitr::kable()
| cbsa_code | cbsa_name | rd_total | cbsa_emp | rd_per_1000worker |
|---|---|---|---|---|
| 13820 | Birmingham-Hoover, AL Metro Area | 2195530.9 | 436077 | 1006.9464 |
| 16740 | Charlotte-Concord-Gastonia, NC-SC Metro Area | 196464.6 | 1058398 | 37.1249 |
| 17140 | Cincinnati, OH-KY-IN Metro Area | 2104942.5 | 946308 | 444.8747 |
| 18140 | Columbus, OH Metro Area | 3708114.7 | 874951 | 847.6165 |
| 24660 | Greensboro-High Point, NC Metro Area | 265721.8 | 323805 | 164.1246 |
| 26900 | Indianapolis-Carmel-Anderson, IN Metro Area | 1020124.2 | 911388 | 223.8617 |
| 28140 | Kansas City, MO-KS Metro Area | 1512807.6 | 954263 | 317.0630 |
| 31140 | Louisville/Jefferson County, KY-IN Metro Area | 918709.5 | 577816 | 317.9938 |
| 32820 | Memphis, TN-MS-AR Metro Area | 559642.9 | 539734 | 207.3773 |
| 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN Metro Area | 3187781.5 | 855849 | 744.9402 |
| 36540 | Omaha-Council Bluffs, NE-IA Metro Area | 828706.9 | 419890 | 394.7257 |
quick_bar(cbsa_output, "rd_total",HL = target_cbsa, wt = T, scale = 200)
Annual R&D expenditure at UofL, thousand US dollar
load("univ_rd_detail/univ_rd_18.rda")
univ_rd_18 %>%
filter(stco_code %in% target_co) %>%
select(year, univ_name, field_broad, field_detail, total_rd)%>%
unique()%>%
filter(field_detail == "Total") %>%
pivot_wider(names_from = "year", values_from = "total_rd") %>%
DT::datatable()
Number of start-ups launched at universities, 2006 - 2017
cbsa_output %>%
select(cbsa_code, cbsa_name, tot_st) %>%
knitr::kable()
| cbsa_code | cbsa_name | tot_st | |
|---|---|---|---|
| 1 | 13820 | Birmingham-Hoover, AL Metro Area | 6 |
| 7 | 16740 | Charlotte-Concord-Gastonia, NC-SC Metro Area | 4 |
| 18 | 17140 | Cincinnati, OH-KY-IN Metro Area | 5 |
| 34 | 18140 | Columbus, OH Metro Area | 9 |
| 44 | 24660 | Greensboro-High Point, NC Metro Area | 0 |
| 47 | 26900 | Indianapolis-Carmel-Anderson, IN Metro Area | NA |
| 58 | 28140 | Kansas City, MO-KS Metro Area | 0 |
| 72 | 31140 | Louisville/Jefferson County, KY-IN Metro Area | 5 |
| 82 | 32820 | Memphis, TN-MS-AR Metro Area | 0 |
| 90 | 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN Metro Area | 12 |
| 103 | 36540 | Omaha-Council Bluffs, NE-IA Metro Area | 0 |
Number of Inc.5000 high growth companies per 1M workers, 2011 - 2017
cbsa_output %>%
select(cbsa_code, cbsa_name, i5hgc_density) %>%
knitr::kable()
| cbsa_code | cbsa_name | i5hgc_density | |
|---|---|---|---|
| 1 | 13820 | Birmingham-Hoover, AL Metro Area | 78.0 |
| 7 | 16740 | Charlotte-Concord-Gastonia, NC-SC Metro Area | 114.4 |
| 18 | 17140 | Cincinnati, OH-KY-IN Metro Area | 104.9 |
| 34 | 18140 | Columbus, OH Metro Area | 117.2 |
| 44 | 24660 | Greensboro-High Point, NC Metro Area | 66.3 |
| 47 | 26900 | Indianapolis-Carmel-Anderson, IN Metro Area | 111.4 |
| 58 | 28140 | Kansas City, MO-KS Metro Area | 99.3 |
| 72 | 31140 | Louisville/Jefferson County, KY-IN Metro Area | 88.3 |
| 82 | 32820 | Memphis, TN-MS-AR Metro Area | 46.7 |
| 90 | 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN Metro Area | 152.5 |
| 103 | 36540 | Omaha-Council Bluffs, NE-IA Metro Area | 96.7 |
load("../crunchbase/cb-result/data/cb_cbsa_index.rda")
index %>%
filter(cbsa_code %in% c(target_cbsa, peer_cbsa))%>%
select(cbsa_code, cbsa_name, msa_total, SCI = div) %>%
unique()%>%
left_join(cbsa_output[c("cbsa_code", "cbsa_emp")], by = "cbsa_code") %>%
mutate(startup_per_million = msa_total/cbsa_emp*1000000)%>%
knitr::kable()
| cbsa_code | cbsa_name | msa_total | SCI | cbsa_emp | startup_per_million |
|---|---|---|---|---|---|
| 31140 | Louisville/Jefferson County, KY-IN | 5 | 24.88571 | 577816 | 8.653274 |
| 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN | 317 | 72.66204 | 855849 | 370.392441 |
| 28140 | Kansas City, MO-KS | 166 | 60.14050 | 954263 | 173.956236 |
| 18140 | Columbus, OH | 255 | 65.20317 | 874951 | 291.444892 |
| 32820 | Memphis, TN-MS-AR | 52 | 41.88420 | 539734 | 96.343755 |
| 13820 | Birmingham-Hoover, AL | 42 | 36.08807 | 436077 | 96.313266 |
| 16740 | Charlotte-Concord-Gastonia, NC-SC | 197 | 59.92288 | 1058398 | 186.130359 |
| 36540 | Omaha-Council Bluffs, NE-IA | 19 | 26.96706 | 419890 | 45.249946 |
| 17140 | Cincinnati, OH-KY-IN | 205 | 64.96580 | 946308 | 216.631372 |
| 26900 | Indianapolis-Carmel-Anderson, IN | 170 | 52.80212 | 911388 | 186.528679 |
cbsa_output %>%
select(cbsa_code, cbsa_name, pct_edu_associate, pct_edu_baplus)%>%
knitr::kable()
| cbsa_code | cbsa_name | pct_edu_associate | pct_edu_baplus | |
|---|---|---|---|---|
| 1 | 13820 | Birmingham-Hoover, AL Metro Area | 0.084 | 0.296 |
| 7 | 16740 | Charlotte-Concord-Gastonia, NC-SC Metro Area | 0.090 | 0.346 |
| 18 | 17140 | Cincinnati, OH-KY-IN Metro Area | 0.084 | 0.330 |
| 34 | 18140 | Columbus, OH Metro Area | 0.075 | 0.361 |
| 44 | 24660 | Greensboro-High Point, NC Metro Area | 0.088 | 0.289 |
| 47 | 26900 | Indianapolis-Carmel-Anderson, IN Metro Area | 0.078 | 0.339 |
| 58 | 28140 | Kansas City, MO-KS Metro Area | 0.076 | 0.365 |
| 72 | 31140 | Louisville/Jefferson County, KY-IN Metro Area | 0.084 | 0.286 |
| 82 | 32820 | Memphis, TN-MS-AR Metro Area | 0.070 | 0.277 |
| 90 | 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN Metro Area | 0.073 | 0.348 |
| 103 | 36540 | Omaha-Council Bluffs, NE-IA Metro Area | 0.089 | 0.358 |
cbsa_output %>%
select(cbsa_code, cbsa_name, epratio_total)%>%
knitr::kable()
| cbsa_code | cbsa_name | epratio_total | |
|---|---|---|---|
| 1 | 13820 | Birmingham-Hoover, AL Metro Area | 0.569 |
| 7 | 16740 | Charlotte-Concord-Gastonia, NC-SC Metro Area | 0.630 |
| 18 | 17140 | Cincinnati, OH-KY-IN Metro Area | 0.625 |
| 34 | 18140 | Columbus, OH Metro Area | 0.642 |
| 44 | 24660 | Greensboro-High Point, NC Metro Area | 0.584 |
| 47 | 26900 | Indianapolis-Carmel-Anderson, IN Metro Area | 0.636 |
| 58 | 28140 | Kansas City, MO-KS Metro Area | 0.648 |
| 72 | 31140 | Louisville/Jefferson County, KY-IN Metro Area | 0.615 |
| 82 | 32820 | Memphis, TN-MS-AR Metro Area | 0.591 |
| 90 | 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN Metro Area | 0.650 |
| 103 | 36540 | Omaha-Council Bluffs, NE-IA Metro Area | 0.675 |
library(RSocrata)
token <- Sys.getenv("RSocrata_token")
cities <- paste0(gsub("\\,.+","",cbsa_output$cbsa_name_short), collapse = "','")
cityhealth <- read.socrata(paste0("https://chronicdata.cdc.gov/resource/csmm-fdhi.csv?category=Health Outcomes&$where=cityname in",
"('",cities,"')"),token)
# peer comparison
cityhealth %>%
filter(measureid %in% c("MHLTH", "PHLTH")) %>%
filter(geographiclevel == "City") %>%
filter(datavaluetypeid == "AgeAdjPrv") %>%
select(cityname, measure, data_value, year) %>%
group_by(cityname, measure)%>%
summarise(data_value = mean(data_value))%>%
pivot_wider(names_from = "measure", values_from = "data_value") %>%
knitr::kable()
| cityname | Mental health not good for >=14 days among adults aged >=18 Years | Physical health not good for >=14 days among adults aged >=18 Years |
|---|---|---|
| Birmingham | 16.80 | 17.10 |
| Charlotte | 12.50 | 12.10 |
| Cincinnati | 16.00 | 15.20 |
| Columbus | 14.65 | 13.40 |
| Indianapolis | 14.80 | 14.00 |
| Kansas City | 14.55 | 14.55 |
| Louisville | 14.90 | 15.10 |
| Memphis | 15.80 | 16.10 |
| Nashville | 13.80 | 13.00 |
not available
| cbsa_code | cbsa_name | cbsa_pct_high_02 | cbsa_pct_medium_02 | cbsa_pct_low_02 | cbsa_pct_high_16 | cbsa_pct_medium_16 | cbsa_pct_low_16 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 13820 | Birmingham-Hoover, AL Metro Area | 0.0447100 | 0.4019414 | 0.5533486 | 0.2213629 | 0.5019834 | 0.2766537 |
| 7 | 16740 | Charlotte-Concord-Gastonia, NC-SC Metro Area | 0.0393641 | 0.3869759 | 0.5736600 | 0.2411426 | 0.4735609 | 0.2852965 |
| 18 | 17140 | Cincinnati, OH-KY-IN Metro Area | 0.0448693 | 0.3812387 | 0.5738921 | 0.2285413 | 0.4799647 | 0.2914940 |
| 34 | 18140 | Columbus, OH Metro Area | 0.0573894 | 0.3825038 | 0.5601068 | 0.2483362 | 0.4617268 | 0.2899370 |
| 44 | 24660 | Greensboro-High Point, NC Metro Area | 0.0419281 | 0.3782357 | 0.5798363 | 0.2043621 | 0.4620994 | 0.3335386 |
| 47 | 26900 | Indianapolis-Carmel-Anderson, IN Metro Area | 0.0474312 | 0.3844814 | 0.5680874 | 0.2162944 | 0.4660410 | 0.3176646 |
| 58 | 28140 | Kansas City, MO-KS Metro Area | 0.0600598 | 0.3875261 | 0.5524141 | 0.2577715 | 0.4674781 | 0.2747504 |
| 72 | 31140 | Louisville/Jefferson County, KY-IN Metro Area | 0.0432075 | 0.3834751 | 0.5733174 | 0.2015948 | 0.4749915 | 0.3234137 |
| 82 | 32820 | Memphis, TN-MS-AR Metro Area | 0.0354234 | 0.3712143 | 0.5933623 | 0.1951220 | 0.4507223 | 0.3541557 |
| 90 | 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN Metro Area | 0.0449740 | 0.3749311 | 0.5800949 | 0.2387505 | 0.4739482 | 0.2873012 |
| 103 | 36540 | Omaha-Council Bluffs, NE-IA Metro Area | 0.0640518 | 0.3803509 | 0.5555973 | 0.2418920 | 0.4655395 | 0.2925685 |
we don’t have block group data in the warehouse yet - can ask Joanne
Only available for core city
tract_health <- cityhealth %>%
filter(measureid %in% c("MHLTH", "PHLTH")) %>%
filter(geographiclevel == "Census Tract") %>%
mutate(stcotr_code = str_pad(tractfips, 11, "left","0"))%>%
select(year, stcotr_code, measureid, data_value) %>%
pivot_wider(names_from = "measureid", values_from = "data_value")
map_health <- map %>%
mutate(stco_code = str_sub(GEOID,1,5)) %>%
left_join(tract_health, by = c("GEOID" = "stcotr_code"))
tm_shape(map_health %>%
filter(stco_code %in% target_co) %>%
filter(!is.na(year)))+
tm_polygons(c("MHLTH", "PHLTH"), alpha = 0.7)+
tm_facets(nrow = 1, sync = T)
Number of jobs reachable by 30 minutes auto and 30 minutes transit
cbsa_output %>%
select(cbsa_code, cbsa_name,auto_30, transit_30, ratio_30)%>%
knitr::kable()
| cbsa_code | cbsa_name | auto_30 | transit_30 | ratio_30 | |
|---|---|---|---|---|---|
| 1 | 13820 | Birmingham-Hoover, AL Metro Area | 268251 | 2713 | 98.87615 |
| 7 | 16740 | Charlotte-Concord-Gastonia, NC-SC Metro Area | 450125 | 7682 | 58.59477 |
| 18 | 17140 | Cincinnati, OH-KY-IN Metro Area | 494927 | 7080 | 69.90494 |
| 34 | 18140 | Columbus, OH Metro Area | 605435 | 10857 | 55.76448 |
| 44 | 24660 | Greensboro-High Point, NC Metro Area | NA | NA | NA |
| 47 | 26900 | Indianapolis-Carmel-Anderson, IN Metro Area | 556698 | 7491 | 74.31558 |
| 58 | 28140 | Kansas City, MO-KS Metro Area | 615321 | 6864 | 89.64467 |
| 72 | 31140 | Louisville/Jefferson County, KY-IN Metro Area | 423448 | 7263 | 58.30208 |
| 82 | 32820 | Memphis, TN-MS-AR Metro Area | 402266 | NA | NA |
| 90 | 34980 | Nashville-Davidson–Murfreesboro–Franklin, TN Metro Area | 307872 | 5380 | 57.22528 |
| 103 | 36540 | Omaha-Council Bluffs, NE-IA Metro Area | NA | NA | NA |
map: http://access.umn.edu/research/america/transit/2018/maps/index.html
You can download school level data from NCES. we aggregated school level data to various geography.
tract_school <- final %>%
mutate(stco_code = str_sub(fips,1,5)) %>%
filter(stco_code %in% target_co) %>%
mutate(stcotr_code = str_sub(fips, 1,11)) %>%
group_by(stcotr_code) %>%
summarise(pct_pass = sum(ALL_TOTAL_passed_H)/sum(ALL_TOTAL_total))
map_school <- map %>%
mutate(stco_code = str_sub(GEOID,1,5)) %>%
left_join(tract_school, by = c("GEOID" = "stcotr_code"))
tm_shape(map_school%>%
filter(str_sub(GEOID,1,5) %in% target_co) %>%
mutate(lab = scales::percent(pct_pass)))+
tm_polygons(col = "pct_pass", id = "lab", alpha = 0.7)
# map_school %>%
# filter(str_sub(GEOID,1,5) %in% target_co)%>%
# ggplot(aes(fill = pct_pass))+
# scale_fill_distiller(type = "div", palette = "PiYG")+
# geom_sf()+
# coord_sf(crs = 26911)