Permalink
Cannot retrieve contributors at this time
small_area_health_insurance_estimates/dashboards/dashboard_health_insurance_estimates.Rmd
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
793 lines (704 sloc)
22.8 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "Health Insurance Coverage Estimates in Arizona" | |
| output: flexdashboard::flex_dashboard | |
| --- | |
| ```{r setup, include=FALSE} | |
| library(flexdashboard) | |
| library(tidyverse) | |
| library(sf) | |
| library(ggthemes) | |
| library(RColorBrewer) | |
| library(plotly) | |
| # list of catchment counties | |
| uazcc_catchment_counties <- c( | |
| "Cochise", | |
| "Pima", | |
| "Pinal", | |
| "Santa Cruz", | |
| "Yuma" | |
| ) | |
| # Primary Color Palette 2 | |
| # c("UA Red", "Arizona Blue") | |
| uazcc_primary_palette <- c("#0C234B", "#AB0520") | |
| # read data #### | |
| # data frame | |
| sahie_az <- read_rds("../data/tidy/sahie_az.rds") | |
| # catchment only | |
| sahie_az_uazcc <- read_rds("../data/tidy/sahie_az.rds") %>% | |
| filter(uazcc_catchment == "yes") | |
| # spatial | |
| sahie_az_spatial <- read_rds("../data/tidy/sahie_az_spatial.rds") | |
| # catchment only spatial | |
| sahie_az_uazcc_spatial <- read_rds("../data/tidy/sahie_az_uazcc_spatial.rds") | |
| # set theme #### | |
| # set consistent theme for graphics & data visualizations | |
| theme_uazcc_brand <- theme_clean(base_size = 12) + | |
| theme( | |
| text = element_text( | |
| family = "sans", | |
| # face = "bold", | |
| color = "#001C48", | |
| # size = rel(1.5) | |
| ), | |
| panel.background = element_rect(fill = "white"), | |
| panel.grid = element_line(color = "#1E5288"), | |
| plot.background = element_rect(fill = "#EcE9EB"), | |
| # aspect.ratio = 3 / 4, | |
| legend.background = element_rect(fill = "white"), | |
| legend.position = "bottom", | |
| plot.caption = element_text(size = 8), | |
| # plot.subtitle = element_text(size = 12), | |
| # plot.title = element_text(size = 14), | |
| strip.background = element_rect(fill = "#EcE9EB") | |
| ) | |
| # spatial | |
| theme_uazcc_brand_spatial <- theme_map() + | |
| theme( | |
| text = element_text( | |
| family = "sans", | |
| face = "bold", | |
| color = "#001C48", | |
| size = 12 | |
| ), | |
| legend.position = "right", | |
| plot.caption = element_text(size = 8), | |
| plot.subtitle = element_text(size = 12), | |
| plot.title = element_text(size = 14), | |
| strip.background = element_rect(fill = "#EcE9EB") | |
| ) | |
| # catchment only in 2019 | |
| sahie_az_uazcc_2019 <- sahie_az_uazcc %>% | |
| filter(year == "2019", | |
| countyfips != "000", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) | |
| ``` | |
| Arizona | |
| ======================================== | |
| Column { data-width = 600 } | |
| ---------------------------------------- | |
| ### Rates of Uninsured Across the State | |
| ```{r, cache=TRUE} | |
| sahie_az_spatial %>% | |
| filter(year == "2019", | |
| countyfips != "000", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| ggplot() + | |
| geom_sf(mapping = aes(fill = pctelig), color = "white") + | |
| geom_sf(data = sahie_az_uazcc_spatial, fill = NA, color = "#AB0520") + | |
| scale_color_viridis_c("Percent uninsured") + | |
| scale_fill_viridis_c("Percent uninsured") + | |
| geom_sf_label(mapping = aes(label = name), size = 1.75) + | |
| labs( | |
| title = "Percent Uninsured in Arizona Counties", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All Incomes", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) | |
| # + | |
| # theme_uazcc_brand_spatial | |
| ``` | |
| Column { data-width = 400 } | |
| ---------------------------------------- | |
| ### Percent Uninsured in Each Arizona County | |
| ```{r, cache=TRUE} | |
| county <- sahie_az %>% | |
| filter( | |
| year == "2019", | |
| countyfips != "000", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| ggplot(mapping = aes(x = reorder(county_name, pctelig), y = pctelig)) + | |
| geom_bar(stat = "identity", mapping = aes(fill = pctelig)) + | |
| geom_bar(data = sahie_az_uazcc_2019, mapping = aes(x = reorder(county_name, pctelig), y = pctelig), color = "#AB0520", stat = "identity", fill = NA) + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| scale_fill_viridis_c() + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Arizona Counties", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All Incomes", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| fill = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand + | |
| theme(legend.position = "none") | |
| ggplotly(county) | |
| ``` | |
| ### Uninsured by Race and Sex in Arizona | |
| ```{r} | |
| # try instead adding the images { width=20% } | |
| # to chunk options, out.width = "20%" | |
| # ? flex dashboard enlarge or zoom image? | |
| # | |
| sex_by_race <- sahie_az %>% | |
| filter(year == "2019", | |
| countyfips == "000", | |
| iprcat == "0", | |
| agecat == "0" | |
| ) %>% | |
| ggplot(mapping = aes(x = reorder(racecat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| facet_wrap(~sexcat_labels) + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Arizona by Race", | |
| subtitle = "2019, Under 65 years, All Incomes, All Counties", | |
| x = "Race", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ggplotly(sex_by_race) | |
| ``` | |
| UAZCC | |
| ======================================== | |
| Row | |
| ------------------------------------- | |
| ### Over time | |
| ```{r} | |
| sahie_az %>% | |
| filter(countyfips != "000", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| group_by(uazcc_catchment, year) %>% | |
| summarise( | |
| nui = sum(nui), | |
| nipr = sum(nipr) | |
| ) %>% | |
| mutate(pct_ui = (nui / nipr) * 100) %>% | |
| ggplot() + | |
| geom_line(mapping = aes(x = year, y = pct_ui, color = uazcc_catchment), size = 2) + | |
| ylim(c(0,20)) + | |
| labs( | |
| title = "Percent Uninsured in Arizona Counties", | |
| subtitle = "Under 65 years, All Races, Both Sexes, Aggregate values", | |
| x = "Year", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| color = "UAZCC Catchment" | |
| ) + | |
| scale_color_manual(values = uazcc_primary_palette) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By income group | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(year == "2019", | |
| sexcat == "0", | |
| agecat == "0") %>% | |
| group_by(county_name) %>% | |
| ggplot(mapping = aes(x = reorder(county_name, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| facet_wrap(~iprcat_labels) + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Arizona UAZCC Catchment Counties by Income Category", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| Row | |
| ------------------------------------- | |
| ### By age | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(year == "2019", | |
| sexcat == "0", | |
| iprcat == "0") %>% | |
| group_by(county_name) %>% | |
| ggplot(mapping = aes(x = reorder(county_name, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| facet_wrap(~agecat_labels) + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Arizona UAZCC Catchment Counties by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By age and sex | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(year == "2019", | |
| iprcat == "0") %>% | |
| group_by(county_name) %>% | |
| ggplot(mapping = aes(x = reorder(county_name, pctelig), y = pctelig, fill = sexcat_labels)) + | |
| geom_bar(stat = "identity", position = "dodge") + | |
| facet_wrap(~agecat_labels) + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Arizona UAZCC Catchment Counties by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| fill = "Sex" | |
| ) + | |
| theme_uazcc_brand + | |
| scale_fill_brewer(palette = "Set1") | |
| ``` | |
| Cochise | |
| ======================================== | |
| Row | |
| ------------------------------------- | |
| ### Over time | |
| ```{r} | |
| sahie_az %>% | |
| filter(countyfips == "003", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| ggplot() + | |
| geom_line(mapping = aes(x = year, y = pctui), color = "#AB0520", size = 2) + | |
| ylim(c(0,20)) + | |
| labs( | |
| title = "Percent Uninsured in Cochise County ", | |
| subtitle = "Under 65 years, All Races, Both Sexes", | |
| x = "Year", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| color = "UAZCC Catchment" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By income group | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "003", | |
| year == "2019", | |
| sexcat == "0", | |
| agecat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(iprcat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Cochise County by Income Category", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes", | |
| x = "Income Category", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| Row | |
| ------------------------------------- | |
| ### By age | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "003", | |
| year == "2019", | |
| sexcat == "0", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Cochise County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "Age Group", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By age and sex | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "003", | |
| year == "2019", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig, fill = sexcat_labels)) + | |
| geom_bar(stat = "identity", position = "dodge") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Cochise County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, All income levels", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| fill = "Sex" | |
| ) + | |
| theme_uazcc_brand + | |
| scale_fill_brewer(palette = "Set1") | |
| ``` | |
| Pima | |
| ======================================== | |
| Row | |
| ------------------------------------- | |
| ### Over time | |
| ```{r} | |
| sahie_az %>% | |
| filter(countyfips == "019", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| ggplot() + | |
| geom_line(mapping = aes(x = year, y = pctui), color = "#AB0520", size = 2) + | |
| ylim(c(0,20)) + | |
| labs( | |
| title = "Percent Uninsured in Pima County ", | |
| subtitle = "Under 65 years, All Races, Both Sexes", | |
| x = "Year", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| color = "UAZCC Catchment" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By income group | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "019", | |
| year == "2019", | |
| sexcat == "0", | |
| agecat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(iprcat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Pima County by Income Category", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes", | |
| x = "Income Category", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| Row | |
| ------------------------------------- | |
| ### By age | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "019", | |
| year == "2019", | |
| sexcat == "0", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Pima County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "Age Group", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By age and sex | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "019", | |
| year == "2019", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig, fill = sexcat_labels)) + | |
| geom_bar(stat = "identity", position = "dodge") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Pima County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| fill = "Sex" | |
| ) + | |
| theme_uazcc_brand + | |
| scale_fill_brewer(palette = "Set1") | |
| ``` | |
| Pinal | |
| ======================================== | |
| Row | |
| ------------------------------------- | |
| ### Over time | |
| ```{r} | |
| sahie_az %>% | |
| filter(countyfips == "021", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| ggplot() + | |
| geom_line(mapping = aes(x = year, y = pctui), color = "#AB0520", size = 2) + | |
| ylim(c(0,20)) + | |
| labs( | |
| title = "Percent Uninsured in Pinal County ", | |
| subtitle = "Under 65 years, All Races, Both Sexes", | |
| x = "Year", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| color = "UAZCC Catchment" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By income group | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "021", | |
| year == "2019", | |
| sexcat == "0", | |
| agecat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(iprcat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Pinal County by Income Category", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes", | |
| x = "Income Category", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| Row | |
| ------------------------------------- | |
| ### By age | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "021", | |
| year == "2019", | |
| sexcat == "0", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Pinal County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "Age Group", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By age and sex | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "021", | |
| year == "2019", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig, fill = sexcat_labels)) + | |
| geom_bar(stat = "identity", position = "dodge") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Pinal County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| fill = "Sex" | |
| ) + | |
| theme_uazcc_brand + | |
| scale_fill_brewer(palette = "Set1") | |
| ``` | |
| Santa Cruz | |
| ======================================== | |
| Row | |
| ------------------------------------- | |
| ### Over time | |
| ```{r} | |
| sahie_az %>% | |
| filter(countyfips == "023", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| ggplot() + | |
| geom_line(mapping = aes(x = year, y = pctui), color = "#AB0520", size = 2) + | |
| ylim(c(0,20)) + | |
| labs( | |
| title = "Percent Uninsured in Santa Cruz County ", | |
| subtitle = "Under 65 years, All Races, Both Sexes", | |
| x = "Year", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| color = "UAZCC Catchment" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By income group | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "023", | |
| year == "2019", | |
| sexcat == "0", | |
| agecat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(iprcat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Santa Cruz County by Income Category", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes", | |
| x = "Income Category", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| Row | |
| ------------------------------------- | |
| ### By age | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "023", | |
| year == "2019", | |
| sexcat == "0", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Santa Cruz County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "Age Group", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By age and sex | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "023", | |
| year == "2019", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig, fill = sexcat_labels)) + | |
| geom_bar(stat = "identity", position = "dodge") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Santa Cruz County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| fill = "Sex" | |
| ) + | |
| theme_uazcc_brand + | |
| scale_fill_brewer(palette = "Set1") | |
| ``` | |
| Yuma | |
| ======================================== | |
| Row | |
| ------------------------------------- | |
| ### Over time | |
| ```{r} | |
| sahie_az %>% | |
| filter(countyfips == "027", | |
| agecat == "0", | |
| racecat == "0", | |
| sexcat == "0", | |
| iprcat == "0" | |
| ) %>% | |
| ggplot() + | |
| geom_line(mapping = aes(x = year, y = pctui), color = "#AB0520", size = 2) + | |
| ylim(c(0,20)) + | |
| labs( | |
| title = "Percent Uninsured in Yuma County ", | |
| subtitle = "Under 65 years, All Races, Both Sexes", | |
| x = "Year", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| color = "UAZCC Catchment" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By income group | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "027", | |
| year == "2019", | |
| sexcat == "0", | |
| agecat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(iprcat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Yuma County by Income Category", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes", | |
| x = "Income Category", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| Row | |
| ------------------------------------- | |
| ### By age | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "027", | |
| year == "2019", | |
| sexcat == "0", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig)) + | |
| geom_bar(fill = "#1E5288", stat = "identity", position = "dodge") + | |
| geom_errorbar(aes(ymin = (pctelig - pctelig_moe), ymax = (pctelig + pctelig_moe)), color = "#001C48") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Yuma County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "Age Group", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program" | |
| ) + | |
| theme_uazcc_brand | |
| ``` | |
| ### By age and sex | |
| ```{r} | |
| sahie_az_uazcc %>% | |
| filter(countyfips == "027", | |
| year == "2019", | |
| iprcat == "0") %>% | |
| ggplot(mapping = aes(x = reorder(agecat_labels, pctelig), y = pctelig, fill = sexcat_labels)) + | |
| geom_bar(stat = "identity", position = "dodge") + | |
| coord_flip() + | |
| labs( | |
| title = "Percent Uninsured in Yuma County by Age Group", | |
| subtitle = "2019, Under 65 years, All Races, Both Sexes, All income levels", | |
| x = "County", | |
| y = "Percent Uninsured", | |
| caption = "Source: U.S. Census Bureau, 2019 Small Area Health Insurance Estimates (SAHIE) program", | |
| fill = "Sex" | |
| ) + | |
| theme_uazcc_brand + | |
| scale_fill_brewer(palette = "Set1") | |
| ``` |