During my time as an MPH student at Johns Hopkins University, I have taken a research assistant position with the department of Health Policy and Management. I wanted to use my page as a visual log of the work I have done this year.

This project is one in which I was asked to create a bivalent chloropleth map visualizing the concurrence of the income inequality and obesity prevalence. We have used the gini index, which is a single statistic measure that represents income inequality, as data points to stand in for inequality.

Obesity data comes from the CDC

Gini data comes for the US Census

Code is below

{r map1, warning=FALSE, results = 'hide', message=FALSE, fig.show='hide'}

library(biscale)
library(ggplot2)
library(cowplot)
library(sf)
library(dplyr)
library(tidyverse)
setwd("C:/Users/shasu/OneDrive/Desktop/R Files")
library(tigris)

gini_obesity <- read_csv("county_lat_long_gini_obiisty_average.csv")
gini_obesity_subset <- gini_obesity %>% 
  filter(region <= 9999)

gini_obesity_subset2 <- gini_obesity %>%
  filter(!(region <= 9999))

gini_obesity2 <- rbind(gini_obesity_subset, gini_obesity_subset2)

gini_obesity3 <- gini_obesity2

gini_obesity3 = bi_class(gini_obesity3, x = gini, y = obesity_adult, style = "quantile", dim = 3)

us_counties <- counties(cb = TRUE, resolution = "20m")

us_counties_shifted <- shift_geometry(us_counties) %>% st_as_sf()

us_counties_shifted$GEOID <- as.numeric(us_counties_shifted$GEOID)

gini_obesity4 <- us_counties_shifted %>%
  left_join(gini_obesity3, by = c("GEOID" = "region"))

map1 <- ggplot() + 
  geom_sf(data = gini_obesity4, aes(fill = bi_class), show.legend = FALSE) + 
  bi_scale_fill(pal = "PurpleOr", dim = 3) +
  bi_theme() +
  labs(title = 'Gini and Obesity in the U.S.',)

legend <- bi_legend(pal = "PurpleOr",
                    dim = 3,
                    xlab = "Higher Gini",
                    ylab = "Higher Obesity",
                    size = 6)

finalPlot <- ggdraw() +
  draw_plot(map1, 0, 0, 1, 1) +
  draw_plot(legend, 0.83, .1, 0.2, 0.2)

finalPlot