Retrieving data for equity analysis. I decided to look at mean
hosuehold income, health insurance status, and access to personal
transportation. Income is a good base indicator of equity, because it
can highlight how many individuals in a population can afford
health-related procedures. Health insurance coverage will show the
amount of the population that has access to insurance, which is often a
barrier to healthcare. Lastly, access to personal transportation will
show how many individuals have an efficient means of getting to a
hospital to receive care.
clean_tractdata <- mini3_tractdata %>% drop_na()
###Removed NA values from census data
tm_shape(clean_tractdata %>% group_by(GEOID) %>% summarise(hhincomeE=mean(hhincomeE))) + tm_polygons(col = "hhincomeE", breaks = c(0, 20000, 40000, 60000, 80000, 100000)) + tm_shape(hospitalsf) + tm_dots(col = "red", size = 0.2, title = "Hospitals")
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────
## [v3->v4] `tm_polygons()`: migrate the argument(s) related to the scale of the
## visual variable `fill` namely 'breaks' to fill.scale = tm_scale(<HERE>).
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
## Warning: Values have found that are higher than the highest break. They are
## assigned to the highest interval
###Hospitals mapped over census tracts by mean household income
tm_shape(clean_tractdata %>% group_by(GEOID) %>% summarise(health_insurance=mean(health_insurance))) + tm_polygons(col = "health_insurance", breaks = c(0, 1000, 2000, 3000, 4000, 5000), palette = "Greens") + tm_shape(hospitalsf) + tm_dots(col = "red", size = 0.2, title = "Hospitals")
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────
## [v3->v4] `tm_polygons()`: migrate the argument(s) related to the scale of the
## visual variable `fill` namely 'breaks', 'palette' (rename to 'values') to
## fill.scale = tm_scale(<HERE>).
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
## Warning: Values have found that are higher than the highest break. They are
## assigned to the highest interval
## [cols4all] color palettes: use palettes from the R package cols4all. Run 'cols4all::c4a_gui()' to explore them. The old palette name "Greens" is named "greens" (in long format "brewer.greens")
###Hospitals mapped over census tracts by population covered by health
insurance
tm_shape(clean_tractdata %>% group_by(GEOID) %>% summarise(transportation=mean(transportation))) + tm_polygons(col = "transportation", breaks = c(0, 1000, 2000, 3000, 4000, 5000), palette = "reds") + tm_shape(hospitalsf) + tm_dots(col = "red", size = 0.2, title = "Hospitals")
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────
## [v3->v4] `tm_polygons()`: migrate the argument(s) related to the scale of the
## visual variable `fill` namely 'breaks', 'palette' (rename to 'values') to
## fill.scale = tm_scale(<HERE>).
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
###Hospitals mapped over census tracts by population with access to
personal transportation
clean_tractdata <- st_transform(clean_tractdata, st_crs(hospitalsf))
tract_buffers <- st_buffer(clean_tractdata, dist = 402)
intersections <- st_intersects(tract_buffers, hospitalsf)
tracts_with_hospitals <- clean_tractdata %>% mutate(hospitals_within_025_mile = lengths(intersections))
distances <- st_distance(clean_tractdata, hospitalsf)
nearest_hospital_distance <- apply(distances, 1, min)
tracts_with_hospital_distance <- clean_tractdata %>%
mutate(distance_to_nearest_hospital = nearest_hospital_distance)
###converting data frames to use same CRS, and creating buffers to
calculate distance to hospital within each census tract
tm_shape(tracts_with_hospital_distance) + tm_polygons(col = "distance_to_nearest_hospital", breaks = c(0, 500, 1000, 1500, 2000, 3000, 4000, 5000), palette = "Blues", title = "Distance to Nearest Hospital") + tm_shape(clean_tractdata %>% group_by(GEOID) %>% summarise(transportation=mean(transportation))) + tm_polygons(col = "transportation", breaks = c(0, 1000, 2000, 3000, 4000, 5000), palette = "reds") + tm_shape(hospitalsf) + tm_dots(col = "red", size = 0.2, title = "Hospitals") + tm_layout(legend.outside = TRUE)
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────
## [v3->v4] `tm_polygons()`: migrate the argument(s) related to the scale of the
## visual variable `fill` namely 'breaks', 'palette' (rename to 'values') to
## fill.scale = tm_scale(<HERE>).
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
##
## [v3->v4] tm_polygons(): migrate the argument(s) related to the legend of the visual variable 'fill', namely 'title' to 'fill.legend = tm_legend(<HERE>)'
##
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
## Warning: Values have found that are higher than the highest break. They are
## assigned to the highest interval
## [cols4all] color palettes: use palettes from the R package cols4all. Run 'cols4all::c4a_gui()' to explore them. The old palette name "Blues" is named "blues" (in long format "brewer.blues")
###Map of hospital distance compared to access to personal transport
tm_shape(tracts_with_hospital_distance) + tm_polygons(col = "distance_to_nearest_hospital", breaks = c(0, 500, 1000, 1500, 2000, 3000, 4000, 5000), palette = "Blues", title = "Distance to Nearest Hospital") + tm_shape(clean_tractdata %>% group_by(GEOID) %>% summarise(health_insurance=mean(health_insurance))) + tm_polygons(col = "health_insurance", breaks = c(0, 1000, 2000, 3000, 4000, 5000), palette = "Greens") + tm_shape(clean_tractdata %>% group_by(GEOID) %>% summarise(hhincomeE=mean(hhincomeE))) + tm_polygons(col = "hhincomeE", breaks = c(0, 20000, 40000, 60000, 80000, 100000)) + tm_shape(hospitalsf) + tm_dots(col = "red", size = 0.2, title = "Hospitals") + tm_layout(legend.outside = TRUE)
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────
## [v3->v4] `tm_polygons()`: migrate the argument(s) related to the scale of the
## visual variable `fill` namely 'breaks', 'palette' (rename to 'values') to
## fill.scale = tm_scale(<HERE>).
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
##
## [v3->v4] tm_polygons(): migrate the argument(s) related to the legend of the visual variable 'fill', namely 'title' to 'fill.legend = tm_legend(<HERE>)'
##
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
##
## [v3->v4] tm_polygons(): use 'fill' for the fill color of polygons/symbols (instead of 'col'), and 'col' for the outlines (instead of 'border.col')
## Warning: Values have found that are higher than the highest break. They are
## assigned to the highest interval
## [cols4all] color palettes: use palettes from the R package cols4all. Run 'cols4all::c4a_gui()' to explore them. The old palette name "Blues" is named "blues" (in long format "brewer.blues")
## Warning: Values have found that are higher than the highest break. They are
## assigned to the highest interval
## [cols4all] color palettes: use palettes from the R package cols4all. Run 'cols4all::c4a_gui()' to explore them. The old palette name "Greens" is named "greens" (in long format "brewer.greens")
## Warning: Values have found that are higher than the highest break. They are
## assigned to the highest interval
## [plot mode] legend/component: Some components or legends are too high and are therefore rescaled. Set the tmap option 'component.autoscale' to FALSE to disable rescaling.
###Map of hospital distance compared to income level and health
insurance coverage
data_for_scatter1 <- tracts_with_hospital_distance %>% select(GEOID, distance_to_nearest_hospital, health_insurance)
ggplot(data_for_scatter1, aes(x = distance_to_nearest_hospital, y = health_insurance)) + geom_point(color = "blue", alpha = 0.6) + labs(title = "Distance to Hospital vs. Insurance Coverage", x = "Distance to Hospital in Meters", y = "Individuals with Insurance") + theme_minimal() + geom_smooth(method = "lm", color = "red", se = FALSE)
## `geom_smooth()` using formula = 'y ~ x'
###Scatterplot comparing distance to hospital and health insurance
coverage
data_for_scatter2 <- tracts_with_hospital_distance %>% select(GEOID, distance_to_nearest_hospital, hhincomeE)
ggplot(data_for_scatter2, aes(x = distance_to_nearest_hospital, y = hhincomeE)) + geom_point(color = "blue", alpha = 0.6) + labs(title = "Distance to Hospital vs. Mean Household Income", x = "Distance to Hospital in Meters", y = "Mean Household Income") + theme_minimal() + geom_smooth(method = "lm", color = "red", se = FALSE)
## `geom_smooth()` using formula = 'y ~ x'
### Overall Analysis: It appears that Atlanta’s hospitals are centrally
located. The majority of them are clustered in the center of the two
counties. When comparing insurance coverage to hospital location, it
appears that hospitals are located in census tracts with lower levels of
insurance, compared to higher ones. Additionally, hospitals seemed to be
located in census tracts with fewer car ownership. While this may seem
counterintuitive, I would argue that hospitals are located relatively
equitably in Atlanta. While insurance and transportation are barriers to
accessing healthcare, the location of hospitals tend to be closer to
those with higher barriers. This may be because those without insurance
tend to visit hospitals more, rather than visiting private practices
that require specific insurance or have higher out of pocket costs.
Secondly, those that have access to personal transportation are able to
drive themselves to the care that they need, rather than relying on
public transportation. Because of this, it seems that hospitals are
located in opportune locations for those that need those services.