To answer the question, “Is the spatial distribution of hospitals in the area equitable?”, it is important to examine both the potential demand for hospital visits and the available supply of hospitals. The supply data is sourced from Yelp, which provides the geolocation of each hospital. For potential demand, I will focus on two key sociodemographic factors: race and age, investigating whether individuals from every neighborhood have equal access regardless of these characteristics.
Specifically, I will follow these steps:
The data is sourced from a given Yelp data link
# Load hospital data
yelp_data <- st_read("https://raw.githubusercontent.com/ujhwang/urban-analytics-2024/main/Assignment/mini_3/yelp_hospital.geojson")
# Download ACS data (Age and Race)
bg <- suppressMessages(
get_acs(geography = "block group",
state = "GA",
county = c("Dekalb", "Fulton"),
variables = c(race_all = "B02001_001E",
white = "B02001_002E",
age_all = "B01001_001E",
age_male_65_66 = "B01001_020E",
age_male_67_69 = "B01001_021E",
age_male_70_74 = "B01001_022E",
age_male_75_79 = "B01001_023E",
age_male_80_84 = "B01001_024E",
age_male_85_over = "B01001_025E",
age_female_65_66 = "B01001_044E",
age_female_67_69 = "B01001_045E",
age_female_70_74 = "B01001_046E",
age_female_75_79 = "B01001_047E",
age_female_80_84 = "B01001_048E",
age_female_85_over = "B01001_049E"),
year = 2021,
survey = "acs5",
geometry = TRUE,
output = "wide")
)
bg %<>% mutate(age.over65 = age_male_65_66 + age_male_67_69 + age_male_70_74 +
age_male_75_79 + age_male_80_84 + age_male_85_over +
age_female_65_66 + age_female_67_69 + age_female_70_74 +
age_female_75_79 + age_female_80_84 + age_female_85_over)
bg %<>% select(GEOID, race_all, white, age_all, age.over65)
bg %<>% mutate(race_minor = (race_all - white) / race_all,
age_elderly = age.over65 / age_all)
## Visualize the Hospital Locations
tmap_mode("view")
tm_shape(yelp_data) + tm_dots(col = "review_count", style="quantile") +
tm_shape(bg) + tm_borders(lwd = 0.5)
The accessibility score is calculated using a gravity-based model, where the distance (in kilometers) between the centroid of each block group and nearby hospitals serves as the denominator. The weight of each hospital is determined by its “review_count”, with more reviews indicating a higher likelihood of people attempting to visit it. This suggests that the hospital has a greater capacity to serve a diverse patient population. Since people typically prefer hospitals within a reasonable driving distance, the model considers only hospitals that fall within a 10 km radius from each block group centroid.
The equation for the accessibility score is: \[ A_i = \sum_{j=1}^{n} \frac{W_j}{d_{ij}} \]
where: \(A_i\) is the accessibility score for block group \(i\), \(W_j\) is the weight of hospital \(j\) based on its review count:
\(W_j = 1\) if review count \(< 10\),
\(W_j = 2\) if \(10 \leq\) review count \(\leq 100\),
\(W_j = 3\) if review count \(> 100\)
\(d_{ij}\) is the Euclidean distance (in kilometers) between block group centroid \(i\) and hospital \(j\), and \(n\) is the number of hospitals within the 10 km buffer.
bg_centroids <- st_centroid(bg)
bg_centroids <- st_transform(bg_centroids, crs = 32616)
yelp_data <- st_transform(yelp_data, crs = 32616)
bg_centroids_buffer <- st_buffer(bg_centroids, dist = 10000)
yelp_data %<>% mutate(weight = case_when(
review_count < 10 ~ 1,
review_count >= 10 & review_count <= 100 ~ 2,
review_count > 100 ~ 3
))
# Calcualte the accessibility score using gravity-based model
bg$access_score <- 0
for (i in 1:nrow(bg_centroids_buffer)) {
temp <- bg_centroids[i,]
temp_buffer <- bg_centroids_buffer[i,]
hospitals_in_buffer <- yelp_data[temp_buffer, ]
if (nrow(hospitals_in_buffer) == 0) {
bg$access_score[i] <- 0
} else {
distances <- st_distance(temp$geometry, hospitals_in_buffer$geometry)
distances <- as.numeric(distances) / 1000
accessibility_score <- sum(hospitals_in_buffer$weight / distances)
bg$access_score[i] <- accessibility_score
}
}
# Visualize the accessibility score for each block group
tm_shape(bg) +
tm_polygons(col = "access_score", style = "quantile", palette = "Blues",
title = "Accessibility Score") +
tm_shape(yelp_data) + tm_dots(col = "review_count", palette = "Reds",
title = "Hospital Review Count", size = 0.1) +
tm_layout(legend.outside = TRUE)
To explore the equity of hospital accessibility, two plots are presented, showing the relationship between each block group’s accessibility score and two factors: the ratio of minority populations (i.e., non-White residents) and the ratio of elderly residents. Elderly individuals are defined as those aged 65 and older. The ratio for each group is calculated by dividing the number of non-White or elderly residents by the total population within the block group.
ggplot(bg, aes(x = race_minor, y = access_score, color = age_all)) +
geom_point(alpha = 0.7) +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(x = "Ratio of Minority (non-White)",
y = "Accessibility Score",
title = "Accessibility to Hospitals vs. Minority Population",
color = "Total Residents") +
theme_minimal() +
scale_color_viridis_c(option = "plasma", direction = -1)
# Calculate the correlation between age_elderly and access_score
correlation <- cor(bg$race_minor, bg$access_score, use = "complete.obs")
print(paste("Correlation :", correlation))
## [1] "Correlation : -0.333902868227568"
ggplot(bg, aes(x = age_elderly, y = access_score, color = age_all)) +
geom_point(alpha = 0.7) +
geom_smooth(method = "lm", se = FALSE, color = "red") +
labs(x = "Ratio of Elderly Population (65+)",
y = "Accessibility Score",
title = "Accessibility to Hospitals vs. Elderly Population",
color = "Total Residents") +
theme_minimal() +
scale_color_viridis_c(option = "plasma", direction = -1)
correlation <- cor(bg$age_elderly, bg$access_score, use = "complete.obs")
print(paste("Correlation :", correlation))
## [1] "Correlation : -0.0898500350442845"
The regression lines in both plots indicate a negative slope. This suggests that block groups with higher proportions of minority populations, whether in terms of race or age, experience lower accessibility to hospitals. This finding highlights that hospitals are not fairly distributed, failing to ensure both equality and equity in access. In other words, because not everyone has similar levels of accessibility, equality is not achieved. Furthermore, as minority groups experience disproportionately lower access to hospital services, equity is also not met.