Objective

The United Nations Food and Agriculture Organization publication. The State of Food Security and Nutrition in the world 2022 might lead one to the conclusion that its an elsewhere problem that the people who are suffering malnutrition and starvation are elsewhere not in our backyard. For this assignment you will need to take a closer look here at home (the US).

Links: https://www.fao.org/documents/card/en/c/cc0639en

Libraries Used

library(tidyverse)
library(plotly)
library(plotly)
library(ggplot2)
library(dplyr)
library(sf)
library(rnaturalearth)
library(rnaturalearthdata)

Data Source

foodsecurity <- read.csv("https://raw.githubusercontent.com/Jlok17/2022MSDS/main/Source/Data608/foodsecurity_2001_to%202022.csv")
state <- read.csv('https://raw.githubusercontent.com/Jlok17/2022MSDS/main/Source/Data608/food-security-states.csv')
poverty <- read.csv('https://raw.githubusercontent.com/Jlok17/2022MSDS/main/Source/Data608/US-poverty.csv')
state_abv <- read.csv('https://raw.githubusercontent.com/Jlok17/2022MSDS/main/Source/Data608/State%20Key%20-%20Sheet1.csv')

Introduction

Food insecurity in the United States is a significant issue that affects millions of Americans across the country. Food insecurity is referred as the lack of consistent access to food for everyone around the country, which are typically due to limited financial resources or other social-economical constraints. Despite being one of the wealthiest nations in the world, the U.S. faces persistent food insecurity issues, with certain populations. As factors contributing to food insecurity include poverty, unemployment, and high living costs. This situation is often accelerated when there is an economical downturn or crises, most recently with the COVID-19 pandemic. As the pandemic had caused a significant amount of job loss and food supply disruption, we could see a significant increase in the number of people facing food insecurity. Various government programs and non-profit organizations attempt to help address this issue with food assistance programs, but food insecurity remains a consistent hardship in the United States.

Food Security and Ethnicity in the U.S.?

First thing first is to see that current state of Food Security within the United States. As shown below in the 2 linear graphs, we can see that it was decreasing until the COVID-19 Pandemic when it did increase in both levels of Food Insecurity, Low Food Security and Very Low Food Security. It should ne noted that despite the Food Insecurity level decreasing until the pandemic, Very Low Food Security didn’t decrease by that much maining within the 4-6% of all US Households. Even further when looking at it by Ethnicity we can see that Food Insecurity is the highest among African Americans at a staggering 22%. While the White Non-Hispanic Group is the lowest among ethnicities but still has a higher around 9% rate.
# Data Manipulation

foodsecurity_row <- foodsecurity<- foodsecurity[-c(1:210), ]
foodsecurity_index <- foodsecurity_row                       
rownames(foodsecurity_index) <- 1:nrow(foodsecurity_index) 
foodsec_all <- select(filter(foodsecurity_index, Category == 'All households'),c(Year, Food.secure.percent, Food.insecure.percent, Low.food.security.percent, Very.low.food.security.percent))


x <- foodsec_all$Year
y1 <- foodsec_all$Food.insecure.percent
y2 <- foodsec_all$Low.food.security.percent
y3 <- foodsec_all$Very.low.food.security.percent

text1 <- paste("Year: ", x,
               "<br>Percent of Households: ", y1)
text2 <- paste("Year: ", x,
               "<br>Percent of Households: ", y2)
text3 <- paste("Year: ", x,
               "<br>Percent of Households: ", y3)
# Graph

fig1 <- plot_ly(x = ~x, y = ~y1, type = 'scatter', mode = 'lines+markers',
               text = text1, hoverinfo = 'text',
               name = "Total Food Insecurity") %>%
  add_trace(x = ~x, y = ~y2, type = 'scatter', mode = 'lines+markers',
            text = text2, hoverinfo = 'text',
            name = "Low Food Security") %>%
  add_trace(x = ~x, y = ~y3, type = 'scatter', mode = 'lines+markers',
            text = text3, hoverinfo = 'text',
            name = "Very Low Food Security") %>%
  layout(
    xaxis = list(title = "Year", tickmode = "linear"),
    yaxis = list(title = "Percentage of Households", range = c(0, max(c(y1, y2, y3)))),
    margin = list(b = 100, l = 60, r = 160, t = 80), 
    height = 500,  
    width = 800,  
    legend = list(x = 1.0, y = .80)
  ) %>%
  add_annotations(
    text = "FOOD INSECURITY IN ALL U.S. HOUSEHOLDS",
    x = 0, xref = "paper",
    y = 1.15, yref = "paper",  
    showarrow = FALSE,
    font = list(size = 20),
    align = "left"
  ) %>%
  add_annotations(
    text = "Breakdown in Food Insecurity Showcases a consistent level of Food Insecurity",
    x = 0, xref = "paper",
    y = 1.1, yref = "paper",  
    showarrow = FALSE,
    font = list(size = 14),
    align = "left",
    width = 800  
  )

fig1
# Data Manipulation

foodsec_eth <- filter(foodsecurity_index, Category %in% c("All households", "Race/ethnicity of households"))
foodsec_eth <- select(foodsec_eth, Year, Category, Subcategory, Food.insecure.percent, Very.low.food.security.percent)

# Graph

foodsec_eth %>%
  plot_ly(
    x = ~Year,
    y = ~Food.insecure.percent,
    color = ~interaction(Category, Subcategory),  
    type = 'scatter',
    mode = 'lines+markers',
    name = ~ifelse(Category == "All households", "All households", paste(Subcategory, sep = " - "))) %>%
  layout(
    xaxis = list(title = "Year", tickmode = "linear"),
    yaxis = list(title = "Percentage of Food Insecurity"),
    margin = list(b = 100, l = 60, r = 160, t = 80),
    height = 500,  
    width = 810, 
    legend = list(x = .9, y = 1.1)) %>%
  add_annotations(
    text = "FOOD INSECURITY BY ETHNICITY IN THE U.S.",
    x = 0, xref = "paper",
    y = 1.15, yref = "paper", 
    showarrow = FALSE,
    font = list(size = 20),
    align = "left")  

Poverty Vs Food Insecurity

As we compare the 2 map graphs below, we can see the first one is the Food Insecurity Percentage Broken up by States and the 2nd One is Poverty Rate broken out by State. When comparing the 2 maps we can see an overlay in a higher Poverty Rate corresponding to a Higher Food Insecurity Rate. With Louisana, Arkansas, and Mississippi being towards the higher end of both groups. Comparatively we can see on the lower end that Washington, Minnesota and New Hampshire all have lower rates on both maps.
# Data Manipulation

states_recent <- state %>%
  filter(Year == "2020–2022") %>%
  slice(-1)

# Graph

text4 <- paste("State: ", states_recent$State,
               "<br>Food Insecurity Percentage: ", states_recent$Food.insecurity.prevalence)
  
fig2 <- plot_ly(data = states_recent, locations = ~State, type = 'choropleth',
               locationmode = 'USA-states', z = ~`Food.insecurity.prevalence`,
               colors = 'Oranges', text = text4, colorbar = list(title = "% Food Insecurity")) %>%
  layout(geo = list(scope = 'usa', bgcolor = 'rgba(0,0,0,0)'),
         title = list(text = "Food Insecurity Percentage by State",
                 font = list(size = 24, color = "black"),
                 x = 0,
                 y = 0.9),
         margin = list(r = 0, t = 0, l = 0, b = 0))

fig2 %>%
  config(toImageButtonOptions = list(format = 'svg', width = 1000, height = 500)) %>%
  add_annotations(
    text = "FOOD INSECURITY BY U.S. STATES",
    x = 0, xref = "paper",
    y = 1.15, yref = "paper",  
    showarrow = FALSE,
    font = list(size = 20),
    align = "left"
  )
# Data Manipulation
poverty$Poverty.Rate <- as.numeric(gsub("%", "", poverty$Poverty.Rate))
poverty$State <- trimws(poverty$State)
state_abv$STATE.TERRITORY <- trimws(state_abv$STATE.TERRITORY)
poverty_all <- merge(poverty, state_abv, by.x = "State", by.y = "STATE.TERRITORY", all.x = TRUE)
names(poverty_all)[names(poverty_all) == "Abbreviation"] <- "State_Abbreviation"


# Graph
text5 <- paste("State: ", poverty_all$State_Abbreviation,
               "<br>Poverty Rate: ", poverty_all$Poverty.Rate)

fig3 <- plot_ly(data = poverty_all, locations = ~State_Abbreviation, type = 'choropleth',
               locationmode = 'USA-states', z = ~`Poverty.Rate`,
               colors = 'Oranges', text = text5, colorbar = list(title = "% Poverty Rate")) %>%
  layout(geo = list(scope = 'usa', bgcolor = 'rgba(0,0,0,0)'),
         title = list(text = "Poverty Rate by State",
                 font = list(size = 24, color = "black"),
                 x = 0,
                 y = 0.9),
         margin = list(r = 0, t = 0, l = 0, b = 0))

fig3 %>%
  config(toImageButtonOptions = list(format = 'svg', width = 1000, height = 500))

What is the State of Food Security and Nutrition in the U.S.?

Food Security in the U.S. has been bad during the past 14 years with the recent pandemic decreasing the food security, the population has. As one the leading countries in economical growth in 2022 with a staggering 25.44 Trillion Dollar GDP, we still have 12.8% of U.S. Households with Food Insecurity and 5% in the Very Low Food Security. When looking at the 2022 funding for government funding of Food and Nutrition Assistance Programs totaled around 183.0 Billion dollars. Food Security issues also helps with the general issue of poverty in the United States as the lower income families are not able to sufficiently feed themselves.