Exploratory Analysis of Food Deserts and Health Indicators in The United States
Introduction
Heart disease is the number one cause of death in the United States. Every year, roughly 700,000 deaths occur that are in part due to heart disease. (Centers for Disease Control and Prevention, 2023) Diabetes, the eighth leading cause of death in the US, kills around 100,000 people. (U.S. Department of Agriculture, Economic Research Service, 2023) That accounts for nearly 800,000 deaths annually due to diseases, where most cases could be eliminated if Americans end their unhealthy eating habits.
Unfortunately, for many Americans, eating a healthy diet is not just difficult but entirely impossible. The foundational hypothesis of this analysis focuses on food deserts, defined as low-income areas where the nearest supermarket is further than one mile away, or ten miles in rural areas. (Food Empowerment Project, 2023) In recent years, food deserts have been targeted by organizations like the Food Empowerment Project (Food Empowerment Project, 2023) and First Lady Michelle Obama’s “Let’s Move” campaign (Obama White House Archives, 2010b) as a way to fight the obesity epidemic. The “Let’s Move” campaign went so far as to invest $400,000 in 2017 to provide tax breaks for supermarkets that open in food deserts. (U.S. Department of Agriculture, Economic Research Service, 2023)
With this knowledge in hand, the first hypothesis assumes that because there has been a great deal of discussion around this issue from organizations and politicians alike and because the significant investment towards eradicating food deserts directly cites eliminating obesity as the primary goal, there must be at least a moderate correlation between lack of food access and poor health outcomes.
Initial Data Import
# Needed for label_percent()
library(scales)
suppressPackageStartupMessages({
library(tidyverse)
library(extrafont)
library(patchwork)
})
# used for theme_ipsum, density plot styling
library(hrbrthemes)
# Used in the creation of correlation matrix
library(ggcorrplot)
library(patchwork)
loadfonts(quiet = TRUE)
# import datasets for analysis
obesity_data <- read_csv(file = "data/obesity_data.csv", show_col_types = FALSE)
acs_data <- read_csv(
file = "data/acs_2010_five_year_estimates_median_income_poverty_snap_housing.csv",
show_col_types = FALSE)
food_environment_atlas_df <- read.csv("data/StateAndCountyData.csv")Data Cleaning
Preliminary Steps
- Data Selection: Identify variables for analysis in each data set.
- Data Quality Pivot wider and convert column names to human readable values.
- Geographical Filtering Exclude non-continental US States.
- Data Quality Identify missing values and determine course of action.
- Type Conversion Convert character variables to numeric.
- Rate Conversion: Convert population data to percentages.
# this function is useful because many social explorer data frames have a `Geo_QName`
# data frame that can be separated into county and state
clean_social_explorer <- function(data_frame) {
data_frame |>
rename(
fips = Geo_FIPS
) |>
separate(Geo_QNAME,
into = c("county","state"),
sep = ",",
remove = TRUE
) |>
mutate(fips = as.double(fips)
)
}Variables of Interest
- FIPS
- State
- County
- Percent of Population With Low Access to Food
- Percent of Population With Low Access to Food and Low Income
- Percent of Population with Diabetes, 2013
- Obesity Rate, 2010
- Population Count
- Population Count in Poverty
- Median Family Income
- Number of Households in Poverty
- Number of Households Recieving Snap
Data Set One: Food Environment Atlas, 2019
Contains vast amounts of food environment and health related data. For the purpose of this exploratory analysis I will identify 3 key variables to focus on: percent of population with low access, percent of population with low access and low income, and the adult diabetes rate in 2013. 2013 was chosen for diabetes because that was the year that was available in their dataset. All other data is based on 2010.
usda_df <- food_environment_atlas_df |>
# original data frame has all the columns under variable code
pivot_wider(
names_from = "Variable_Code",
values_from = "Value"
) |>
select(
FIPS,
State,
County,
PCT_LACCESS_POP10,
PCT_LACCESS_LOWI10,
PCT_DIABETES_ADULTS13
) |>
filter(State != "AK", State != "HI") |>
# this removes a bunch of empty duplicate counties
drop_na() |>
rename(
fips = FIPS,
state = State,
county = County,
pct_laccess = PCT_LACCESS_POP10,
pct_laccess_lowi = PCT_LACCESS_LOWI10,
pct_diabetes_adult_13 = PCT_DIABETES_ADULTS13
) |>
# converting percentage values from whole numbers to decimal
mutate(
pct_laccess = pct_laccess / 100,
pct_laccess_lowi = pct_laccess_lowi / 100,
pct_diabetes_adult_13 = pct_diabetes_adult_13 / 100
)
knitr::kable(usda_df[1:5, ], caption = "United States Department of Agriculture Data")| fips | state | county | pct_laccess | pct_laccess_lowi | pct_diabetes_adult_13 |
|---|---|---|---|---|---|
| 1001 | AL | Autauga | 0.3376966 | 0.0979353 | 0.130 |
| 1003 | AL | Baldwin | 0.1931847 | 0.0546026 | 0.104 |
| 1005 | AL | Barbour | 0.2084097 | 0.1142032 | 0.184 |
| 1007 | AL | Bibb | 0.0455975 | 0.0214466 | 0.148 |
| 1009 | AL | Blount | 0.0270084 | 0.0106247 | 0.141 |
Data Set Two: County Health Rankings and Roadmap Obesity Rates, 2010
Obesity Rate is the percentage of adults (20 and older) reporting a body mass index greater than or equal to 30kg/m^2.
# this will be the data frame for obesity data, all data will be continental US
obesity_df <- clean_social_explorer(obesity_data) |>
select(fips, state, SE_T008_001) |>
rename(obesity_rate_10 = SE_T008_001) |>
# the original data frame had the percentage as a whole number
mutate(obesity_rate_10 = obesity_rate_10 / 100) |>
filter(state != "Alaska", state != "Hawaii") |>
select(fips, obesity_rate_10)
knitr::kable(obesity_df[1:5, ], caption = "CHRR Obesity Data Data")| fips | obesity_rate_10 |
|---|---|
| 1001 | 0.300 |
| 1003 | 0.245 |
| 1005 | 0.364 |
| 1007 | 0.317 |
| 1009 | 0.315 |
Data Set Three: American Community Survey Five Year Estimates, 2010
This source has a myriad of useful economic data that is used later on in the analysis. In particular, median income, number of households in poverty, population count, population in poverty, and number of households on snap are of interest.
acs_df <- acs_data |>
select(Geo_FIPS,
Geo_QName,
SE_A14010_001,
ACS10_5yr_B17019002,
ACS10_5yr_B17001001,
ACS10_5yr_B17001002,
ACS10_5yr_B22003002
) |>
rename(
fips = Geo_FIPS,
median_income = SE_A14010_001,
house_pov = ACS10_5yr_B17019002,
pop_2010 = ACS10_5yr_B17001001,
pov_pop_2010 = ACS10_5yr_B17001002,
house_snap = ACS10_5yr_B22003002
) |>
separate(Geo_QName,
into = c("county","state"),
sep = ",",
remove = TRUE
) |>
mutate(fips = as.double(fips)) |>
# filter out any county with 0 households in poverty, creates NaaN Issues
filter(state != "AK", state != "HI", house_pov != 0) |>
# convert population and housing data to rates and remove original columns
mutate(
pov_rate = pov_pop_2010 / pop_2010,
ratio_snap_house = house_snap / house_pov
) |>
select(fips, median_income, pov_rate, ratio_snap_house)
knitr::kable(acs_df[1:5, ], caption = "American Community Survey Data")| fips | median_income | pov_rate | ratio_snap_house |
|---|---|---|---|
| 1001 | 64271 | 0.1058746 | 1.5611111 |
| 1003 | 58429 | 0.1221023 | 0.9347589 |
| 1005 | 41786 | 0.2500302 | 1.4130926 |
| 1007 | 51956 | 0.1263901 | 1.2015504 |
| 1009 | 53564 | 0.1337132 | 1.2308690 |
note: `ratio_snap_house`` is based on the number of snap households / households in poverty. Not total households. I believe this is important for the analysis later on. If we simply did snap recipients as a proportion of total households, we risk having a variable that mimics pov_rate. By instead basing the proportion on the population that is in poverty I can more accurately examine the beneficial effects of the snap program on county level health outcomes.
Merging all Data Frames Together
# join all the data frames together by fips code
food_environment_df <- left_join(
usda_df,
obesity_df,
by = "fips"
) |>
left_join(
acs_df,
by = "fips"
) |>
drop_na()
# 4 counties missing median income, data retrieved from American Community Survey
# mutate(
# median_income = case_when(
# county == "San Juan" & state == "CO" ~ 43783,
# county == "Irion" & state == "TX" ~ 48833,
# county == "King" & state == "TX" ~ 61563,
# TRUE ~ median_income
# )
# ) |>
# Section above unused due to these counties being removed from the data set.
# These 3 counties were some of the smallest in the country and lacked data.
write_csv(food_environment_df, "data/food_environment_df.csv")
food_environment_df_browsing <- food_environment_df |>
mutate(across(where(is.numeric), ~ round(.,2)))
knitr::kable(food_environment_df_browsing[1:5, 3:6], caption = "Custom Data Set")| county | pct_laccess | pct_laccess_lowi | pct_diabetes_adult_13 |
|---|---|---|---|
| Autauga | 0.34 | 0.10 | 0.13 |
| Baldwin | 0.19 | 0.05 | 0.10 |
| Barbour | 0.21 | 0.11 | 0.18 |
| Bibb | 0.05 | 0.02 | 0.15 |
| Blount | 0.03 | 0.01 | 0.14 |
knitr::kable(food_environment_df_browsing[1:5, 7:10], caption = "Custom Data Set")| obesity_rate_10 | median_income | pov_rate | ratio_snap_house |
|---|---|---|---|
| 0.30 | 64271 | 0.11 | 1.56 |
| 0.24 | 58429 | 0.12 | 0.93 |
| 0.36 | 41786 | 0.25 | 1.41 |
| 0.32 | 51956 | 0.13 | 1.20 |
| 0.32 | 53564 | 0.13 | 1.23 |
Theme Used For Majority of Graphs
# theme applied to many of the graphs for this project
theme_hex <- function(graph) {
graph +
geom_hex(bins = 80, na.rm = TRUE) +
scale_y_continuous(label = label_percent()) +
scale_fill_viridis_c() +
theme_minimal() +
theme(
text = element_text(size = 18, family = "Roboto"),
plot.caption = element_text(size = 12, hjust = 1.1),
axis.title.x = element_text(size = 22, hjust = 0.5),
axis.title.y = element_text(size = 22, hjust = 0.5, vjust = 1),
plot.margin = margin(0,0, 5, 5),
)
}Density Plot Creating Function
density_plot <- function(data, variable, x_axis) {
ggplot(data) +
geom_density(aes(x = variable, y = after_stat(density)), fill= "#69b3a2") +
theme_ipsum() +
xlab(x_axis) +
theme(axis.text.y = element_blank(),
axis.title.y = element_text(size = 22, family = "", hjust = 0.5),
axis.title.x = element_text(size = 22, hjust = 0.5, vjust = - 2),
axis.text.x = element_text(size = 16))
}Low Access vs Diabetes
- Null Hypothesis (H0): There is no correlation between the percentage of a county’s population with low access to food and the percentage of the population that has diabetes.
- Alternative Hypothesis (H1): There is a positive correlation between the percentage of a county’s population with low access to food and the percentage of the population that has diabetes.
la_diabetes_plot <- food_environment_df |>
ggplot(aes(x = pct_laccess, y = pct_diabetes_adult_13)) |>
theme_hex() +
scale_x_continuous(label = label_percent(),
# limits = c(0, .35)
) +
labs(
x = "Share of Population in a Food Desert, 2010",
y = "Percentage of Adults with Diabetes, 2013",
caption = "Food Desert is an area more than 1 mile from a grocery store for
urban areas or more than 10 miles from a grocery store for rural areas"
)
laccess_spearman_cor <- cor.test(food_environment_df$pct_laccess, food_environment_df$pct_diabetes_adult_13, method = "spearman")## Warning in cor.test.default(food_environment_df$pct_laccess,
## food_environment_df$pct_diabetes_adult_13, : Cannot compute exact p-value with
## ties
# ties exist but are not a big concern due to the size of the data set
la_access_spearman_p_value <- laccess_spearman_cor$p.valueSlight Negative Correlation Between Low Food Access and Diabetes Rates
Rs: -.24 p: 3.09 ×
10-40
Hypothesis Testing
Spearman’s Correlation Coefficient was used to test the hypothesis due to the lack of linearity in the data.
Interpretation
Correlation Coefficient(-.24): Weak negative correlation. This coefficient suggests that as the percentage of the population with low access to food increases, the percentage of the population with diabetes slightly decreases, though the relationship is not strong.
P-value(3.09 × 10-40): This is an extremely small p-value, much lower than typical significance of 0.05. This value suggests that the observed correlation is highly unlikely to have occurred by chance if the null hypothesis were true.
Conclusion
I reject the null hypothesis of no correlation between the two variables. However, the negative correlation is contrary to the alternative hypothesis. It’s important to note that correlation does not imply causation, and other factors could be influencing these variables. It’s also important to note the limitations of this analysis, which will be laid out in the next section.
Limitations
- Aggregate Data: This data set is aggregated at the county level. The relationship between diabetes rate and low food access at the county level does not necessarily reflect the relationship between the variables on the individual level.
- Confounding Variables: There may be other variables that influence both food access and diabetes rate. One example of this is the socioeconomic status of people with low access to food. A possible explanation of the negative correlation seen in the aggregated data comes from a USDA study which found that people with low incomes were closer to supermarkets than those with moderate to high incomes. (Rhone, Ver Ploeg, Williams, & Breneman, 2019)
- Generalization: The findings from this data set may not be applicable to all regions in the United States. It is possible that low food access has an immense affect in some regions and no effect in others.
- Simplification: This correlation analysis is a simplified view of the relationship. This simplification is satisfactory for the goals of this analysis, as it is an exploratory analysis, meant as an early exploration of the issue, rather than a rigorous study.
Note: Due to the nature of this data set these limitations exist for all analysis performed. Therefore, they will not be restated in further analysis.
Low Access vs Obesity Rates
laccess_obesity <- food_environment_df |>
ggplot(aes(x = pct_laccess, y = obesity_rate_10)) |>
theme_hex() +
scale_x_continuous(label = label_percent()) +
labs(
x = "Share of Population in a Food Desert",
y = "Obesity Rate",
caption = "Food Desert is an area more than 1 mile from a grocery store for
urban areas or more than 10 miles from a grocery store for rural areas"
) +
theme(
plot.caption = element_text(size = 8, hjust = 1.1)
)
suppressWarnings(la_access_obesity_cor <- cor.test(food_environment_df$pct_laccess, food_environment_df$obesity_rate_10, method = "spearman"))
la_access_obesity_cor_p <- la_access_obesity_cor$p.valueSimilar Results When Examining Obesity Rates
Rs: -.18 p: 2.90 ×
10-23
Low Access and Low Income vs Diabetes Rate
The next step of this analysis examines the how county diabetes rate varies as the percentage of the county with low access to food and low income increases.
- Null Hypothesis (H0): There is no correlation between the percentage
of the county population with low income and low access to food and the
adult diabetes rate for the county
- Alternative Hypothesis (H1): There is a positive correlation between the percentage of the population with low income and low access to food and the adult diabetes rate for the county.
laccess_li_plot <- food_environment_df |>
ggplot(aes(x = pct_laccess_lowi, y = pct_diabetes_adult_13)) |>
theme_hex() +
scale_x_continuous(label = label_percent()) +
labs(
x = "Share of Population in a Food Desert With Low Income",
y = "Percentage of Adults with Diabetes",
caption = "Food Desert is an area more than 1 mile from a grocery store in an
urban area or more than 10 miles from a grocery store in a rural area"
) +
theme(
plot.caption = element_text(size = 8, hjust = 1.1)
)
suppressWarnings(laccess_lowi_cor <- cor.test(food_environment_df$pct_laccess_lowi, food_environment_df$pct_diabetes_adult_13, method = "spearman"))
laccess_lowi_cor_p <- laccess_lowi_cor$p.valueAlmost No Correlation in Low Food Access Areas With High Poverty
Rs: -.028 p: 0.12
Hypothesis Testing
Spearman’s Correlation Coefficient was used to test the hypothesis due to the lack of linearity in the data.
Interpretation
Correlation Coefficient(-.028): Very weak negative correlation. However, P-value is not low enough to indicate statistical significance.
P-value(0.12): P-value > 0.05 indicates the result is not statistically significant.
Conclusion
I fail to reject the null hypothesis due to P-value > 0.05. There is no significant correlation in this data set between the percentage of county population with low access and low income and the adult diabetes rate for the county.
This conclusion is consistent with a 2017 study by the National Bureau of Economic Research which found that 91% of nutritional inequality is created by demand, not supply. (Allcott et al., 2018)
Low Access and Low Income vs Obesity Rate
la_access_obesity_plot <- food_environment_df |>
ggplot(aes(x = pct_laccess_lowi, y = obesity_rate_10)) |>
theme_hex() +
labs(
x = "Share of Low Income Population in a Food Desert",
y = "Percentage of Adults with Diabetes",
caption = "Food Desert is an area more than 1 mile from a grocery store in an
urban area or more than 10 miles from a grocery store in a rural area"
) +
theme(
plot.caption = element_text(size = 8, hjust = 1.1)
)
suppressWarnings(la_lowi_cor <- cor.test(food_environment_df$pct_laccess_lowi, food_environment_df$obesity_rate_10, method = "spearman"))Correlation With Obesity Continues to Mimic Diabetes Rate
Rs: .01 p: 0.55
Poverty Rate vs Diabetes Rate
The next step in my analysis was to examine a variable that I intuitively felt would have a positive correlation with diabetes rate. For brevity, I’m not going to state the alternative and null hypothesis for this analysis.
The main reason I included this intermediate step was this project is designed to show off my data analysis/visualization skills using R, so I wanted to include a binned poverty rate graph. I chose to use a box-and whisker on top of individual points as an individual stylistic choice. I am aware that some prefer violin, but this is my preference. I find that it’s easier for someone without a statistical/data based background to understand this plot at first glance.
# bin poverty rates to mix up graph visuals
binned_pov_rate <- food_environment_df %>%
select(pov_rate, pct_diabetes_adult_13, obesity_rate_10) %>%
mutate(
pov_rate = cut(
pov_rate,
breaks = c(-Inf, 0.1, 0.2, 0.3, 0.4, Inf),
labels = c("0-10%", "10-20%", "20-30%", "30-40%", "40%+"),
right = FALSE)
)
pov_rate_plot <- binned_pov_rate |>
ggplot(aes(x = pov_rate, y = pct_diabetes_adult_13)) +
geom_jitter(color = "#414487FF", alpha = 0.5) +
geom_boxplot(varwidth = TRUE, fill = "#7AD151FF", alpha = 0.9) +
scale_y_continuous(labels = label_percent()) +
theme_minimal() +
labs(
x = "Poverty Rate",
y = "Percentage of Adults with Diabetes"
) +
theme(text = element_text(size = 22, family = "Roboto"))
pov_rate_cor_spearman <- suppressWarnings(cor.test(
food_environment_df$pov_rate,
food_environment_df$pct_diabetes_adult_13,
method = "spearman"))Significant Positive Correlation Betwen County Poverty Rate and Adult Diabetes Rate
Rs: .46 p: < 2.2 ×
10-16
Median Income vs Diabetes Rate
Building off of the observed correlation of diabetes rate and poverty rate, I examine the relationship between median family income and county level diabetes rate.
My expectation is that, in general, there should be a negative correlation between median family income and diabetes rate. This could be due to a variety of confounding variables, including ability to afford food, education as it relates to income (both general education and food education), access to medical care, and stress levels. These are all variables of interest for a future, more in depth analysis.
- Null Hypothesis (H0): There is no correlation between the median family income in a county and the percentage of the population that has diabetes.
- Alternative Hypothesis (H1): There is a negative correlation between the median family income in a county and the percentage of the population that has diabetes.
median_income_plot1 <- food_environment_df |>
ggplot(aes(x = median_income, y = pct_diabetes_adult_13)) |>
theme_hex() +
scale_x_log10(labels = label_currency()) +
scale_y_log10(breaks = c(0, .04, .08, .12, .16, .2), labels = label_percent()) +
geom_smooth(color = "red") +
labs(
x = "Median Family Income",
y = "Percentage of Adults with Diabetes")
cor.test(food_environment_df$median_income, food_environment_df$pct_diabetes_adult_13, method = "spearman")## Warning in cor.test.default(food_environment_df$median_income,
## food_environment_df$pct_diabetes_adult_13, : Cannot compute exact p-value with
## ties
##
## Spearman's rank correlation rho
##
## data: food_environment_df$median_income and food_environment_df$pct_diabetes_adult_13
## S = 7895942483, p-value < 2.2e-16
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.5841275
Strong Negative Correlation That Breaks Down at Certain Income Thresholds
Rs: -.58 p: < 2.2 ×
10-16
Hypothesis Testing
Spearman’s Correlation Coefficient was used to test the hypothesis due to the lack of linearity in the data.
Interpretation
Correlation Coefficient(-.58): Moderate negative correlation.
P-value(< 2.2 × 10-16): Extremely small probability value, probability of observing this correlation by chance, if null hypothesis were true, is essentially zero.
Conclusion
I reject the null hypothesis due to the moderate negative correlation. The alternative hypothesis that there is a negative correlation between county level median income and adult diabetes rate is supported by this data set with a statistically significant p-value.
Next Steps
Despite the overall negative correlation, the visualization suggests that there is a range of median income where the relationship between the two variables is multiplicative. The next steps of the analysis will focus on determing that range and quantifying the relationship.
Sliding Window Test for Correlation Range Upper Limit
# sequence based on lowest reasonable starting point for median income range
income_threshold <- seq(
from = 31000,
to = max(food_environment_df$median_income, na.rm = TRUE),
by = 1000)
# create blank df to hold correlation values
correlation_df <- tibble(upper_limit = double(), income_correlation = double())
# each loop tests a new maximum value for the subset of median income in cor
for (i in 1:(length(income_threshold)-1)) {
upper_limit <- income_threshold[i]
data_subset <- filter(food_environment_df, median_income <= income_threshold[i]) |>
mutate(
median_income = median_income,
pct_diabetes_adult_13 = pct_diabetes_adult_13
)
income_correlation <- cor(data_subset$median_income,
data_subset$pct_diabetes_adult_13,
method = "spearman")
# results of each loop are stored in a row in a data frame
correlation_df <- add_row(
correlation_df,
upper_limit = upper_limit,
income_correlation = income_correlation
)
}
minimum_cor <-correlation_df |>
slice_min(income_correlation)
minimum_cor[1,]## # A tibble: 1 × 2
## upper_limit income_correlation
## <dbl> <dbl>
## 1 131000 -0.584
Sliding Window Test for Correlation Range Lower Limit
# same thing as above this time looking for lower limit
income_threshold_low_limit <- seq(95000, 25000, -1000)
correlation_df_low <- tibble(
lower_limit = double(),
income_correlation_low = double())
for (i in 1:(length(income_threshold_low_limit)-1)) {
lower_limit <- income_threshold_low_limit[i]
data_subset_low <- food_environment_df |>
filter(median_income >= lower_limit, median_income < 95000) |>
mutate(
median_income = median_income,
pct_diabetes_adult_13 = pct_diabetes_adult_13
)
income_correlation_low <- cor(
data_subset_low$median_income,
data_subset_low$pct_diabetes_adult_13,
method = "spearman")
correlation_df_low <- add_row(
correlation_df_low,
lower_limit = lower_limit,
income_correlation_low = income_correlation_low
)
}
correlation_df_low |>
slice_min(income_correlation_low)## # A tibble: 1 × 2
## lower_limit income_correlation_low
## <dbl> <dbl>
## 1 27000 -0.575
Interpreting The Results of The Test
The strongest correlation I was able to find by utilizing the sliding window test was within median income ranges of $27,000 to $131,000. However, the most interesting result of the tests are within the correlation table that was created by the first test.
Notice how, as the range of median income values increases, the correlation becomes more negative at a fairly consistent rate up to approx. $85,000. This suggests that if I filter the data set to include values somewhere in this range and apply the appropriate transformations I may be able to quantify the relationship with a linear regression.
| upper_limit | income_correlation |
|---|---|
| 31000 | 0.2144332 |
| 32000 | 0.1965127 |
| 33000 | 0.0985520 |
| 34000 | -0.0806185 |
| 35000 | -0.1212802 |
| 36000 | -0.0930072 |
| 37000 | -0.1911300 |
| 38000 | -0.1622643 |
| 39000 | -0.2370512 |
| 40000 | -0.2114183 |
| 41000 | -0.1439076 |
| 42000 | -0.1696240 |
| 43000 | -0.1419663 |
| 44000 | -0.2089252 |
| 45000 | -0.2318722 |
| 46000 | -0.2586354 |
| 47000 | -0.2778155 |
| 48000 | -0.3052838 |
| 49000 | -0.3374451 |
| 50000 | -0.3381929 |
| 51000 | -0.3736143 |
| 52000 | -0.3818854 |
| 53000 | -0.3843128 |
| 54000 | -0.4059950 |
| 55000 | -0.4187990 |
| 56000 | -0.4311066 |
| 57000 | -0.4412892 |
| 58000 | -0.4476012 |
| 59000 | -0.4637617 |
| 60000 | -0.4660809 |
| 61000 | -0.4764834 |
| 62000 | -0.4868467 |
| 63000 | -0.4927169 |
| 64000 | -0.4956938 |
| 65000 | -0.5024135 |
| 66000 | -0.5163432 |
| 67000 | -0.5195493 |
| 68000 | -0.5214783 |
| 69000 | -0.5256140 |
| 70000 | -0.5309278 |
| 71000 | -0.5321767 |
| 72000 | -0.5335265 |
| 73000 | -0.5347618 |
| 74000 | -0.5382015 |
| 75000 | -0.5399368 |
| 76000 | -0.5435062 |
| 77000 | -0.5445266 |
| 78000 | -0.5477881 |
| 79000 | -0.5503352 |
| 80000 | -0.5527760 |
| 81000 | -0.5554263 |
| 82000 | -0.5577793 |
| 83000 | -0.5599868 |
| 84000 | -0.5625766 |
| 85000 | -0.5632039 |
| 86000 | -0.5641638 |
| 87000 | -0.5647548 |
| 88000 | -0.5672193 |
| 89000 | -0.5682495 |
| 90000 | -0.5689948 |
| 91000 | -0.5703761 |
| 92000 | -0.5718084 |
| 93000 | -0.5722340 |
| 94000 | -0.5725260 |
| 95000 | -0.5736829 |
| 96000 | -0.5743379 |
| 97000 | -0.5743705 |
| 98000 | -0.5748214 |
| 99000 | -0.5744504 |
| 100000 | -0.5748030 |
Median Income Density Curves
median_income_density_plot <- density_plot(
food_environment_df,
food_environment_df$median_income,
x_axis = "Median Income"
) +
scale_x_continuous(labels = label_currency()) +
theme(axis.text = element_text(size = 22))
median_income_log_density_plot <- density_plot(
food_environment_df,
food_environment_df$median_income,
x_axis = "Log Transformation Medium Income"
) +
scale_x_log10(labels = label_currency()) +
theme(axis.text = element_text(size = 22))Distribution of Median Income Improved by Log Transformation
Diabetes Rate Density Curves
diabetes_rate_density_plot <- density_plot(
food_environment_df,
food_environment_df$pct_diabetes_adult_13,
x_axis = "Adults Diabetes Rate"
) +
scale_x_continuous(labels = label_percent())
diabetes_rate_density_log_plot <- density_plot(
food_environment_df,
food_environment_df$pct_diabetes_adult_13,
x_axis = "Log Transformation Adults Diabetes Rate"
) +
scale_x_log10(label = label_percent())
diabetes_rate_density_sqrt_plot <- density_plot(
food_environment_df,
food_environment_df$pct_diabetes_adult_13,
x_axis = "Square Root Transformation of Adults Diabetes Rate"
) +
scale_x_sqrt(label = label_percent())Distribution of Diabetes Rate With Varying Transformations
The visualization suggests that a square root transformation would be
the most appropriate, but the skewness of the data is relatively low,
and a double log transformation in our desired range transforms the
relationship into one that is easily quantifiable using a linear model.
Final Median Income Graph
- Null Hypothesis (H0): There is no linear relationship between log-transformed median income and log-transformed diabetes rate in counties with median incomes between $35,000 and $85,000.
- Alternative Hypothesis (H1): There is a linear relationship between log-transformed median income and log-transformed diabetes rate in counties with median incomes between $35,000 and $85,000.
median_income_plot2 <- food_environment_df |>
ggplot(aes(x = median_income, y = pct_diabetes_adult_13)) |>
theme_hex() +
scale_x_log10(breaks = c(35000, 60000, 85000),
limit = c(35000, 85000),
labels = label_currency()) +
scale_y_log10(breaks = c(0, .04, .08, .12, .16, .2), labels = label_percent()) +
geom_smooth(color = "red", method = "lm", na.rm = TRUE) +
# geom_smooth() +
theme_minimal() +
labs(
x = "Median Family Income",
y = "Percentage of Adults with Diabetes")
median_income_filter_df <- food_environment_df |>
filter(median_income > 35000, median_income < 85000) |>
mutate(
log_median_income = log10(median_income),
log_pct_diabetes_adult_13 = log10(pct_diabetes_adult_13)
)
lm_median_income <- lm(log_pct_diabetes_adult_13 ~ log_median_income, median_income_filter_df)Negative Multiplicative Association Between Income and Diabetes When Income is Between $35,000 and $85,000
1% increase in median income correlates with a reduction in diabetes
rate of .64%
Hypothesis Testing
Linear Regression analysis is used on log transformed county level median income and diabetes rate due to the linear nature of the association of the two variables within this subset of data.
Interpretation
Slope(-0.64): The negative value of the slope indicates that there is an inverse relationship between median income and diabetes rate in their log-transformed forms. Specifically, within this subset of data a 1% decrease in median income correlates with a reduction of diabetes rate by .64%.
P-value(< 2.2 × 10-16): Extremely small probability value, probability of observing this correlation by chance, if null hypothesis were true, is essentially zero.
Conclusion
I reject the null hypothesis given the small p-value and moderately negative slope. I accept that alternative hypothesis that there is a linear relationship between log-transformed county level median income increases and log-transformed county level diabetes rate.
Next Steps
This data set suggests that there is a negative multiplicative relationship between county level median income and diabetes rate within a range $35,000 to $85,000. The lack of linearity on the extreme ends of the relationship could be attributed to confounding variables having a greater association with diabetes rate. Once again, this presents an exciting opportunity more multivariate analysis in future projects.
For now, I want to analyze the Supplemental Nutrition Assistance Program (SNAP) to see it’s affect on diabetes rate.
Ratio of SNAP Households to Households in Poverty
The final step of this analysis examines an the existing government SNAP program, which the USDA states “provides benefit to low-income families to supplement their grocery budget so they can afford the nutritious food essential to health and well being”
Since the stated goal of the program is to improve nutritional well being, I expect that if I take a ratio of the number of households receiving snap benefits to the number of households in poverty, the diabetes rate should have a negative correlation with the ratio. This isn’t a perfect analysis by any means, as not everyone below the poverty line receives snap benefits, and not everyone receiving snap benefits is below the poverty lines. However, for the purposes of this analysis this simplified look will suffice.
It is important to note that the denominator for the ratio is households in poverty, not total households. Some data sets include snap recipients as a portion of total population, which would not be as strong of a comparison because it would be similar to looking at poverty rates.
- Null Hypothesis (H0): There is no correlation between the ratio of SNAP households to households in poverty and the diabetes rate.
- Alternative Hypothesis (H1): There is a negative correlation between the ratio of SNAP households to households in poverty and the diabetes rate.
ratio_snap_plot <- food_environment_df |>
ggplot(aes(x = ratio_snap_house, y = pct_diabetes_adult_13)) |>
theme_hex() +
scale_y_sqrt() +
scale_x_sqrt() +
guides(
fill = guide_colourbar(barwidth = 0.7, barheight = 15),
guide_legend(title = NULL)
) +
geom_smooth(color = "red") +
labs(x = "SNAP Households Per Capita",
y = "Percentage of Adults with Diabetes, 2013")
food_environment_df ## # A tibble: 3,104 × 10
## fips state county pct_laccess pct_laccess_lowi pct_diabetes_adult_13
## <dbl> <chr> <chr> <dbl> <dbl> <dbl>
## 1 1001 AL Autauga 0.338 0.0979 0.13
## 2 1003 AL Baldwin 0.193 0.0546 0.104
## 3 1005 AL Barbour 0.208 0.114 0.184
## 4 1007 AL Bibb 0.0456 0.0214 0.148
## 5 1009 AL Blount 0.0270 0.0106 0.141
## 6 1011 AL Bullock 0.375 0.202 0.196
## 7 1013 AL Butler 0.0624 0.0283 0.177
## 8 1015 AL Calhoun 0.261 0.100 0.149
## 9 1017 AL Chambers 0.197 0.0882 0.164
## 10 1019 AL Cherokee 0.00306 0.00133 0.133
## # ℹ 3,094 more rows
## # ℹ 4 more variables: obesity_rate_10 <dbl>, median_income <dbl>,
## # pov_rate <dbl>, ratio_snap_house <dbl>
suppressWarnings(
snap_cor <- cor.test(
food_environment_df$ratio_snap_house,
food_environment_df$pct_diabetes_adult_13,
method = "spearman")
)
snap_cor##
## Spearman's rank correlation rho
##
## data: food_environment_df$ratio_snap_house and food_environment_df$pct_diabetes_adult_13
## S = 4208469381, p-value < 2.2e-16
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1556737
Higher Proportion of SNAP Households to Poverty Households Doesn’t Correlate With Lower Rates of diabetes
Rs: .16 p: < 2.2 ×
10-16
Hypothesis Testing
Spearman’s Correlation Coefficient was used to test the hypothesis due to the lack of linearity in the data.
Interpretation
Correlation Coefficient(.16): Weak positive correlation.
P-value(< 2.2 × 10-16): P-value > 0.05 indicates the result is statistically significant.
Conclusion
I reject the null hypothesis (H0) . However, the direction of the correlation is positive which is contrary to what was hypothesized in the alternative hypothesis (H1).
It’s again important that this is aggregated data and a simplified, imprecise method for examining the association of the two variables. However, one possible explanation for this finding is found in preceeding research.
In 2017, a Harvard study examined supermarket transactions and determined that, on average, snap recipients purchase higher quantities of red meat and sugary substances than their non-snap counterparts. (Franckle et al., 2017) The underlying cost of a healthy diet must be examined to better understand why families are choosing to use their benefits to purchase unhealthy foods.
Fortunately, the Society for Nutrition and Education in Behavior determined the true cost of maintaining a healthy diet in the United States. Their study found that, on average, a family of four would need to spend roughly $1,150 monthly to maintain a healthy diet. (Mulik & Haynes-Maslow, 2017) Even without accounting for the record-breaking food inflation since the Coronavirus pandemic, this expenditure is significantly higher than the average SNAP benefits a family of four receives. (Franckle et al., 2017)
Correlation Matrix
matrix_df <- food_environment_df |>
select(!fips) |>
select_if(is.numeric) |>
rename(
"Obesity Rate" = obesity_rate_10,
"Adult Diabetse Rate" = pct_diabetes_adult_13,
"Poverty Rate" = pov_rate,
"Percent Low Access" = pct_laccess,
"Percent Low Access/Low Income" = pct_laccess_lowi,
"Snap to Poverty Households Ratio" = ratio_snap_house,
"Median Income" = median_income
)
correlation_matrix <- cor(matrix_df, method = "spearman")
ggcorrplot(
correlation_matrix,
hc.order = TRUE,
tl.cex = 16,
type = "upper",
legend.title = "Pearson \n Corr",
lab = TRUE,
lab_col = "white", lab_size = 4,
outline.color = "black") +
scale_fill_viridis_c()Final Thoughts
This initial exploratory analysis serves as an excellent grounds for further research into related topics. The findings, while based on aggregated and simplified analysis, help to identify target areas for multivariate analysis such as the variables that make up the income-health relationship. The apparent parallels between more rigorous research and this analysis are encouraging. While I am hesitant to make any policy reccomendations forthright, I will cautiously provide support for further research into the plan proposed by the National Bureau of Economic Research.
NBER suggested a means tested subsidy that allows Americans below the poverty line to purchase fruits and vegetables. They found that this subsidy could be implemented at only 15% of the cost of the SNAP program. It would be of great interest to me to see this implemented and studied on a small scale in order to determine it’s effectiveness while simultaneously observing other confounding variables.