Introduction:

This project investigates the spatial distribution of hospitals in Fulton and DeKalb counties, Georgia, with a focus on understanding how various socioeconomic factors influence healthcare access across different neighborhoods. Utilizing Point of Interest (POI) data from Yelp alongside American Community Survey (ACS) data, this analysis aims to identify potential inequities in hospital accessibility among different demographic groups. By examining key variables such as median household income, poverty status, and population density, the project seeks to highlight disparities in healthcare access and inform discussions on the need for equitable healthcare resources in these urban areas. Through spatial analysis and visualizations, I aim to answer the critical question: Is the spatial distribution of hospitals in Fulton and DeKalb counties equitable?

# Load necessary libraries
library(sf)
library(tidycensus)
## Warning: package 'tidycensus' was built under R version 4.3.3
library(dplyr)
library(ggplot2)
library(tmap)
library(tidyr)
tidycensus::census_api_key(Sys.getenv("Census_API")) #importing census API key from environment
## To install your API key for use in future sessions, run this function with `install = TRUE`.

Steps 2 & 3: Download ACS data for chosen variables for Census Tracts in Fulton and DeKalb counties using tidycensus.

I chose the following variables becuase I believe median house hold income and poverty status measure equity within the census tarcts, and population was needed to make an additional variable of density (hospitals per capita).

tract <- suppressMessages(
  get_acs(geography = "tract", 
          state = "GA",
          county = c("Fulton", "Dekalb"), 
          # chose 3 variables: median house hold income, poverty status, and population
          variables = c(hhincome = 'B19019_001E',
                        poverty = 'B17001_001E',
                        population = 'B01003_001E'), 
          year = 2021,
          survey = "acs5", # American Community Survey 5-year estimate
          geometry = TRUE, # returns sf objects
          output = "wide") # wide vs. long
)

Step 4: Prepare the data to be suitable for analysis (NAs values and joining data).

#dropping NAs of both data sets
tract2 <- tract %>%
  drop_na()

hospitals2 <- hospitals %>%
  drop_na()

tract2 <- st_transform(tract2, crs = st_crs(hospitals2)) # Ensure both data sets have the same CRS, which is needed to join

hospital_with_acs <- 
  st_join(tract2, hospitals2) #joining data sets

Step 5: Examine the spatial distribution of hospitals from an equity perspective.

Map 1: Census tracts of Fulton and DeKalb counties with buffers

buffer_distance <- 0.25 * 1609.34  # 0.25 miles converted to ~402 meters

epsg_id <- 4326

tract2_projected <- tract2 %>%  # Transform the tract polygons to a projected CRS
  st_transform(crs = epsg_id)

tract_centroids <- tract2_projected %>%  # Calculate the centroid for each tract
  st_centroid()
## Warning: st_centroid assumes attributes are constant over geometries
centroid_buffers <- tract_centroids %>%  # Apply buffer around each centroid using sf::st_buffer
  st_buffer(dist = buffer_distance)


tmap_mode('view')
## tmap mode set to interactive viewing
tm_shape(tract2_projected) + 
  tm_polygons(col = 'lightblue') +
  tm_shape(centroid_buffers) + 
  tm_polygons(alpha = 0.5, col = 'red')

Calculate the number of hospitals within the 0.25-mile buffer for each tract using sf::st_intersects

hospitals_within_buffer <- st_intersects(centroid_buffers, hospitals2) 

tract2 <- tract2 %>%
  mutate(hospitals_within_0_25_mile = lengths(hospitals_within_buffer)) # adding data to the tract 2 table

tract_with_hospitals <- tract2 %>%  # Filter out tracts with no hospitals (hospitals_within_0_25_mile == 0)
  filter(hospitals_within_0_25_mile > 0)
tract_with_hospitals
## Simple feature collection with 14 features and 9 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -84.43 ymin: 33.69894 xmax: -84.25717 ymax: 34.07549
## Geodetic CRS:  WGS 84
## First 10 features:
##          GEOID                                        NAME hhincome B19019_001M
## 1  13089021225 Census Tract 212.25, DeKalb County, Georgia    63712       10883
## 2  13121001203  Census Tract 12.03, Fulton County, Georgia    68507       10582
## 3  13121002802  Census Tract 28.02, Fulton County, Georgia    27851        9668
## 4  13121001205  Census Tract 12.05, Fulton County, Georgia    79315       25735
## 5  13121001902  Census Tract 19.02, Fulton County, Georgia    65980       13186
## 6  13089020700    Census Tract 207, DeKalb County, Georgia    76023       27172
## 7  13121011901 Census Tract 119.01, Fulton County, Georgia    29414       24359
## 8  13121003500     Census Tract 35, Fulton County, Georgia    50687        9023
## 9  13089021224 Census Tract 212.24, DeKalb County, Georgia    54457       13876
## 10 13121011647 Census Tract 116.47, Fulton County, Georgia    85052       24490
##    poverty B17001_001M population B01003_001M                       geometry
## 1     2533         514       2533         514 MULTIPOLYGON (((-84.31594 3...
## 2     2753         732       2791         732 MULTIPOLYGON (((-84.38331 3...
## 3     1202         297       1627         367 MULTIPOLYGON (((-84.3842 33...
## 4     1867         254       1867         254 MULTIPOLYGON (((-84.38732 3...
## 5     2264         330       2264         330 MULTIPOLYGON (((-84.39054 3...
## 6     2681         389       2725         383 MULTIPOLYGON (((-84.33035 3...
## 7     1380         325       2103         613 MULTIPOLYGON (((-84.39432 3...
## 8     2190         554       2801        1172 MULTIPOLYGON (((-84.40229 3...
## 9     4267         707       4336         736 MULTIPOLYGON (((-84.31381 3...
## 10    4659         659       4908         676 MULTIPOLYGON (((-84.33567 3...
##    hospitals_within_0_25_mile
## 1                           3
## 2                           2
## 3                           1
## 4                           2
## 5                           3
## 6                           2
## 7                           4
## 8                          13
## 9                           1
## 10                          2

Calculate distance from each tract to the nearest hospital

nearest_hospital_dist <- st_distance(tract2, hospitals2) %>%
  apply(1, min)  # Find minimum distance for each tract
nearest_hospital_dist
##   [1]  4904.610936  1738.562225   181.433966  2973.225615  2034.833886
##   [6]  2659.007043  4724.660203  5015.601189   125.792961  2601.841918
##  [11]   494.817203   867.119652   310.662131  3733.259777   943.461010
##  [16]  5373.049851   332.574291   426.249788   833.105822  7179.177601
##  [21]  4011.335753   179.057163  3165.171948  4527.118142  1745.178977
##  [26]   976.005089  2243.674205     0.000000  3458.636488  1298.591798
##  [31]  1613.015387  1265.190606   740.239711   977.841995  2529.137347
##  [36]   354.121654  1826.414606   136.767607  5432.611739  1317.950980
##  [41]  1677.627549   974.873235  3092.212567  1768.195831  2242.307208
##  [46]  3152.836589   432.054214   418.654423 12023.327674  1491.160516
##  [51]   283.467190   505.055708   705.966055  5073.116179  2652.861416
##  [56]   104.862816  1063.377581  6191.158773  1852.705204   843.760935
##  [61]   604.599707  1373.878347   351.727461   451.056139   530.516269
##  [66]  2498.887436  2551.993757  2173.370033  2709.173944  2506.308761
##  [71]  2213.267312  2146.717151     0.000000  4204.017058   679.501289
##  [76]  1558.129878  2228.535070   392.387283  1491.967272   307.008500
##  [81]  1160.337234  1457.282386 10533.209115  3343.245292  5148.860288
##  [86]  4578.056055   318.614690  2172.434150   967.956738  3348.287222
##  [91]   462.182779   945.334560    81.029709  4389.921447   623.062243
##  [96]   890.152983   138.182504  5230.567234  3228.709737     0.000000
## [101]     0.000000   886.880788   614.072540  6553.865330  1279.087948
## [106]  2241.933421  4715.466639   107.687313  1248.865446  1452.964911
## [111]  1702.880272   818.501956  1495.893550   242.310445 14603.155390
## [116] 11143.267565     0.000000  1309.831849  3455.697297  2580.649177
## [121]  1568.030738   375.789070  1601.940991  1057.546542   871.541582
## [126]  4018.595277  1045.149600  2772.235573     0.000000  3782.590744
## [131]  5385.382222  2769.876241  2734.001069  3404.079105   413.588722
## [136]  1575.911923     0.000000  2213.711606   136.586597   660.723990
## [141]  5079.108250  2813.853285   494.626112  3416.874729   124.940836
## [146] 10264.778102   315.262199     0.000000     0.000000     0.000000
## [151]    87.405906     0.000000   803.367068  5311.254406   608.970537
## [156]  7635.072003   640.697101  3709.282753  3649.611418  2379.469591
## [161]  1299.672429  1275.738119     0.000000   844.917050   381.997512
## [166]  2692.245856    68.841153  3989.202000  2675.415930  4536.691790
## [171] 10323.416927   383.362039  1296.258440  2996.927580     0.000000
## [176]   788.935227  4629.408581  1545.473354  2840.329179  4914.399312
## [181]   799.625442  3592.670226  3993.833040  2795.349266  2148.647797
## [186]   606.891598  1167.521495  9219.840602  1271.620545  3216.953636
## [191]  2447.643382  1340.628527   315.710958     0.000000  2114.382516
## [196]  2803.357882   797.533320  4035.558706  1111.985181 10057.389019
## [201]  2568.070646     0.000000  1689.138765  1834.123919     0.000000
## [206]   627.247389    87.630323  1560.108421  5378.377723  3073.441834
## [211]   746.596353  4031.145113  2976.227639   647.614553  1415.820109
## [216]   772.297039  2779.078324  1308.817476  2480.486491    98.840876
## [221]  3087.668648  2651.706156  1163.386455  1129.380552  3205.644128
## [226]     0.000000     0.000000  2081.071624  3584.161802  2164.395706
## [231]  1908.205731  2008.134401  1630.046914  6379.412097   683.830006
## [236]  2500.067712   520.901131   824.058459    23.309050  6793.801624
## [241]   988.727036  3338.240218  7200.595552   618.722753  2227.765624
## [246]  6661.624367  2562.609136  5979.658287   100.805369  2966.419390
## [251]  8974.087478  3184.148477   811.996452  2898.742279  1800.722498
## [256]     0.000000  2569.523042  2093.061483  3935.046892  1413.422953
## [261]  9905.015407  5500.233539 11904.945877  6164.945535  2233.146921
## [266]  1980.098973  3377.860426   508.322068  1908.452142  9969.700216
## [271]  2252.110870  7658.709096  2917.914612  2410.346186  3446.835281
## [276]  2211.033519     0.000000   883.153858  4571.158064   343.369300
## [281]    67.729465  7850.353849  9170.642999  1372.411128  5501.906694
## [286]  2354.878898  1768.254167  2103.079885  4349.730734   841.316501
## [291]  1553.114913  4000.279504  8847.606464  3874.215335   590.451972
## [296]   730.238669   378.084148  1376.830055  4715.235495   900.202869
## [301]  2166.968053     0.000000   211.355765   595.860948   912.406080
## [306]  3446.191601  7062.140456  4781.343739  6795.102207   587.455918
## [311]  1636.569979  6354.129059   154.131055  1225.595740  2782.896322
## [316]  4293.080375   425.909987  1371.789620  3140.249229  1928.241654
## [321]     0.000000   440.164373  4753.272493  4100.951331   244.155760
## [326]  3149.197794   530.469741  4386.761482  1950.225685  1491.714037
## [331]  3303.961429   942.439115 11933.571558  2763.255865  2423.409891
## [336]  7223.353614  2321.423763   631.835522  4257.124746  3066.199541
## [341]  1850.944878  2228.389461  3298.603640  9242.379902  1322.279455
## [346]   685.932610   988.796904    65.805932  6247.290863   505.778359
## [351]  5858.174619  1267.201466  1601.401635  4089.774079   834.359072
## [356]     0.000000  5405.299425   685.964452     6.806092  1710.428711
## [361]  1023.243804   224.005465   318.781102 13654.227818   698.341471
## [366]    19.030804 12882.476464     0.000000  3097.499046   583.903165
## [371]     0.000000  1257.766726  1638.935539  1669.188186  2360.189506
## [376]  1187.406180  8927.183266  3327.892401  1926.060546  3243.250192
## [381]   592.323014  1445.137073  2471.398305    13.924440  1590.029519
## [386]  8141.178314     0.000000  2762.135674  1021.156876  3255.095771
## [391]  3245.625245  2272.319431  3165.555176  2685.751383   332.008473
## [396]  6484.048115  4911.482090  3333.202922  1174.436076   647.717629
## [401]   556.153153  1651.852791  8867.322329  1820.114379  2023.959698
## [406]    93.140643   687.900910  3443.504196  4359.328288  1013.746554
## [411]     0.000000   892.187129  6161.778519   816.464180  2086.611211
## [416]  3493.635261   494.236211   514.271545   430.318385  2836.967705
## [421]  2030.719310   407.194661     0.000000  5936.502830  2606.545001
## [426]     8.227623  2912.257435 10951.359105  3108.066225  1275.738119
## [431]     0.000000  2638.619730 14958.326346   633.266022 16402.852999
## [436]  1901.548107  4630.286880  1864.764485   611.686967   110.594044
## [441]  1445.968016  1844.668143     0.000000  4889.588887  3255.515617
## [446]  1570.910520   406.398376   813.815459  6874.357316  2598.383817
## [451]  1349.856669     0.000000   152.773269  3629.831842  2871.732207
## [456]  4655.908838  1263.341929  6688.342139     0.000000  2631.031440
## [461]     0.000000  4658.174430  2774.005396 10165.632762   637.510284
## [466]  9405.156722     0.000000   738.108810  6976.280354  2632.123677
## [471]  1501.281200  7072.141747  1880.770654  2031.076420  7599.305658
## [476]  1310.438705  6302.180247  1381.140247    43.383739  3553.566113
## [481]     0.000000  3106.498569  2515.323606  1628.772023  1372.441122
## [486]  5299.313750  5863.073749     0.000000  3955.369847  2410.834018
## [491]   897.510435     0.000000  1482.078386   576.174424  1183.572342
## [496]  3301.788349  2429.771682   805.255912  1414.374004  2710.384044
## [501]  1559.550555     0.000000     0.000000   565.847665   686.077465
## [506]   239.766153     0.000000  3025.964912   828.679683  2190.441028
## [511]     0.000000

Create a hospital per capita variable

density <- tract_with_hospitals %>%
  mutate(hospital_density = hospitals_within_0_25_mile / population)

Map 2: Distribution of all hospitals compared to median house hold income

tmap_mode("view") 
## tmap mode set to interactive viewing
map1 <- tm_shape(tract2) +
  tm_polygons("hhincome", palette = "Greens", title = "Median Income") +
  tm_shape(hospitals2) +
  tm_dots(col = "purple", size = 0.1, title = "Hospitals")
map1

Map 3: Hospitals only witihin buffer zones of each census tract

tmap_mode("view") 
## tmap mode set to interactive viewing
map2 <- tm_shape(tract2) + 
  tm_polygons(col = "hospitals_within_0_25_mile", palette = "Blues", title = "Hospital Count Within Each Buffer") +
  tm_shape(tract_with_hospitals) +  
  tm_dots(col = "yellow", size = 0.1, title = "Hospitals Within Buffer")

map2

Graph 1: Hospitaks by poverty rate

ggplot(tract_with_hospitals, aes(x = poverty, y = hospitals_within_0_25_mile)) +
  geom_point() +
  geom_smooth(method = "lm") +
  labs(title = "Hospitals Nearby vs Poverty Rate", x = "Poverty Rate", y = "Hospital Count")
## `geom_smooth()` using formula = 'y ~ x'

Graph 2: Hospitals by median income

ggplot(tract_with_hospitals, aes(x = hhincome, y = hospitals_within_0_25_mile)) +
  geom_point() +
  geom_smooth(method = "lm") +
  labs(title = "Hospitals Nearby vs Median Household Income", x = "Median Household Income", y = "Hospital Count")
## `geom_smooth()` using formula = 'y ~ x'

Graph 3: Hospital density vs median income

ggplot(density, aes(x = hhincome, y = hospital_density)) +
  geom_point() +
  geom_smooth(method = "lm") +
  labs(title = "Hospitals Density vs Median Household Income", x = "Median Household Income", y = "Hospital Density")
## `geom_smooth()` using formula = 'y ~ x'

Answer to the Question: Is the Spatial Distribution of Hospitals in Fulton and DeKalb Counties Equitable?

Based on the analysis conducted, it is evident that the spatial distribution of hospitals in Fulton and DeKalb counties is not equitable. The findings from the data, visualizations, and statistical correlations provide a comprehensive picture of healthcare accessibility in these regions.

Spatial Distribution and Socioeconomic Factors: The maps produced in this analysis illustrate a significant concentration of hospitals in areas characterized by higher median household incomes, particularly in the northern and central parts of the counties. Map 2 highlights that the majority of hospitals are situated in neighborhoods with greater economic resources, suggesting that wealthier communities enjoy better access to healthcare facilities. Conversely, neighborhoods with lower income levels, which often correspond to higher poverty rates, have fewer hospitals in proximity, exacerbating existing disparities in healthcare access.

Accessibility Analysis: Map 3 further emphasizes the issue of accessibility. The analysis reveals that only a limited number of hospitals fall within the 0.25-mile buffer zones surrounding each census tract. This finding indicates that many residents, particularly in lower-income neighborhoods, may face challenges in accessing hospitals without traveling significant distances. The lack of hospitals nearby can lead to delayed medical care, which disproportionately affects vulnerable populations who may already experience barriers to healthcare.

Statistical Correlations: While the graphical representations show a slight negative correlation between the number of hospitals within a 0.25-mile buffer and poverty rates, as well as median household income, these relationships underscore the complex nature of healthcare accessibility. The graphs illustrate that as poverty increases, the number of nearby hospitals tends to decrease, and vice versa. However, the weak correlation suggests that other factors may also influence hospital distribution and access, warranting further investigation into the underlying causes of these disparities.

Conclusion: In conclusion, the spatial distribution of hospitals in Fulton and DeKalb counties raises concerns about equity in healthcare access. The analysis clearly indicates that wealthier neighborhoods are favored in terms of hospital availability, while low-income areas suffer from insufficient healthcare resources. These findings highlight the urgent need for policies aimed at improving healthcare access in underserved communities, ensuring that all residents have equitable opportunities to receive medical care. Future research could explore additional variables, such as transportation access and the quality of healthcare services, to provide a more nuanced understanding of healthcare disparities in these regions.