In this project, we will aim to test significant growth in number of antimicrobial resistance in retail meats over the past some 5, 10, and 15 years. It is hypothesized there will be a positive correlation between time and cases of bacterial growth. We will address this using a one sample t-test, and interpret that the number of positive cases has been significantly higher in more recent years. There will be sections in which to view the distribution of positive antimicrobial resistance cases across time, different states, and the density distribution of cases for each meat cut. You will also have the option look at specific brands and their weighted responsibility for this issue.
The National Antimicrobial Resistance Monitoring System (NARMS) gathers surveillance data from human clinical samples, animal slaughter samples and retail meat samples. This approach to integrated surveillance provides information needed to assess the nature and magnitude of resistance in bacteria moving through the food supply and causing illnesses in humans. The meat industry does not prioritize sanitary environments for their products at the same rank as profit. It is common for these institutions to have less square feet per animal than the size of the animal itself, leading animals in these conditions to often be prone to diseases and illnesses. It is for this reason that many retail meat institutions have introduced a constant low dose of antibiotics into animal feed. However, over a period of time, this can cause animals to develop resistance to this form of medicine. In a similar manner, a human consuming antibiotic-treated meat consistently will also develop a resistance to antibiotics. This can cause extreme danger as the treatment toward meat-related illnesses is often in the form of an antibiotic, which would deem no longer functional.
Due to the age of the data set and the nature of flagging growth cases, we will be looking at 2019 as the most current full year of cases recorded when performing our t-tests.
Let’s analyze our plots and t-test results. While there is not a strictly positive linear relationship between time and the number of positive growth cases, we do see that there are natural rises and falls in the yearly totals with a strong uptick at the year 2019. There is the same state origin distribution across most years in the span 2002-2019, which can be expected given the central locations of retail meat production/distribution. It was interesting to see that chicken had the highest number of yearly cases in comparison to other meat sources, generally around 1500, with pork chops having the yearly numbers less than 500. For the year 2019, there is an extremely small p-value, indicating that the true average number of cases over the range of data collection (2002-2019) is much less than the number of positive cases recorded in 2019. We see somewhat similar results in 2004 with a larger p-value, but still small enough to reject the null hypothesis. However, there was not enough evidence to reject the hypothesis that the true mean was less than the total number of positive cases in the years 2009 and 2014. In conclusion, we can have extreme confidence that the cases in 2019 were much higher than previous years. It would be helpful to see if this trend continues upwards into the year 2020-2024 once that data is available.
“National Antimicrobial Resistance Monitoring System for Enteric Bacteria (NARMS).” Centers for Disease Control and Prevention, Centers for Disease Control and Prevention, 7 Aug. 2023, www.cdc.gov/narms/index.html.
Medicine, Center for Veterinary. “Integrated Reports/Summaries.” U.S. Food and Drug Administration, FDA, 2 Aug. 2023, www.fda.gov/animal-veterinary/national-antimicrobial-resistance-monitoring-system/integrated-reportssummaries.
---
title: "Retail Meats v. Medicine"
author: "Miller Christen"
date: "2024-04-05"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
source_code: embed
runtime: shiny
---
```{r setup, include=FALSE}
library(shiny)
library(DT)
library(tidyverse)
library(knitr)
library(readxl)
library(cowplot)
```
# Abstract {.tabset .tabset-fade}
## Abstract
### Medicine v. Meats
In this project, we will aim to test significant growth in number of antimicrobial resistance in retail meats over the past some 5, 10, and 15 years. It is hypothesized there will be a positive correlation between time and cases of bacterial growth. We will address this using a one sample t-test, and interpret that the number of positive cases has been significantly higher in more recent years. There will be sections in which to view the distribution of positive antimicrobial resistance cases across time, different states, and the density distribution of cases for each meat cut. You will also have the option look at specific brands and their weighted responsibility for this issue.
# Introduction {.tabset .tabset-fade}
## Introduction
### A Brief Introduction
The National Antimicrobial Resistance Monitoring System (NARMS) gathers surveillance data from human clinical samples, animal slaughter samples and retail meat samples. This approach to integrated surveillance provides information needed to assess the nature and magnitude of resistance in bacteria moving through the food supply and causing illnesses in humans. The meat industry does not prioritize sanitary environments for their products at the same rank as profit. It is common for these institutions to have less square feet per animal than the size of the animal itself, leading animals in these conditions to often be prone to diseases and illnesses. It is for this reason that many retail meat institutions have introduced a constant low dose of antibiotics into animal feed. However, over a period of time, this can cause animals to develop resistance to this form of medicine. In a similar manner, a human consuming antibiotic-treated meat consistently will also develop a resistance to antibiotics. This can cause extreme danger as the treatment toward meat-related illnesses is often in the form of an antibiotic, which would deem no longer functional.
## Image
```{r out.width = "80%", fig.align = "center"}
# Loading Data
knitr::include_graphics("image.png")
```
# Data Management {.tabset .tabset-fade}
## Data Management
### Data Cleaning and Prepartion
Due to the age of the data set and the nature of flagging growth cases, we will be looking at 2019 as the most current full year of cases recorded when performing our t-tests.
```{r}
# Loading Data
NARMS <- read_excel("NARMS.xlsx", col_names=TRUE, col_type="text")
retail_meats <- NARMS %>%
select(1:24) %>%
select(-SEROTYPE, -RECEIVED_DATE, -SELLBY_DATE, -ACQUISITION_DATE, -ISOLATE_ID, -SOURCE_SPECIES_INFO) %>%
filter(Year != 2020)
# Display raw datatable
renderDataTable(retail_meats)
```
# Descriptive Statistics {.tabset .tabset-fade}
## Summary Statistics
### Positive Cases by Year
```{r}
cases_by_year <- retail_meats %>%
select(Year, GROWTH, BRAND_NAME, SOURCE) %>%
filter(GROWTH == "YES") %>% filter(Year != 2020) %>%
group_by(Year) %>%
summarise(Count = n())
# table of yearly positive case totals
renderDataTable(cases_by_year)
```
### Summary Statistics
```{r}
# print the summary statistics
renderPrint(summary(cases_by_year$Count))
```
# Plots {.tabset .tabset-fade}
## Cases by Year
### Visualization of the trend of antimicrobial resistance cases over time.
```{r}
# plot total postive cases each year
renderPlot({ggplot(data = cases_by_year, aes(x = Year, y = Count)) +
geom_point() + geom_line() +
labs(x = "Year", y = "Number of Growth Cases", title = "Antimicrobial Resistance Cases Over Time")})
```
## Color by Brand
### Explore the distribution of cases by state.
```{r}
# filter to only positive cases
growth_cases <- retail_meats %>%
select(Year, GROWTH, BRAND_NAME, SOURCE, STATE) %>%
filter(GROWTH == "YES")
# plot number of cases each year by state
renderPlot({ggplot(growth_cases, aes(x = Year, fill = STATE)) +
geom_bar(stat = "count", color = "black") +
labs(x = "Year", y = "Number of Growth Cases", title = "Growth Cases per Year by State")})
```
## Color by Cut
### Explore the distribution of cases by source.
```{r}
# filter data by yearly totals for each meat type
growth_cut_count <- growth_cases %>%
group_by(Year, SOURCE) %>%
summarise(Count = n())
# plot density of meat types over the years
# peaks indicate that yearly # of cases is most common
renderPlot({ggplot(growth_cut_count, aes(x = Count, fill = SOURCE)) +
geom_density(adjust = 2, alpha = 0.5) +
labs(x = "Number of Growth Cases per Year", y = "Density", title = "Density of Growth Cases by Source")})
```
## Brand Responsibility
### Examine the responsibility of specific brands for antimicrobial resistance cases.
```{r}
# ask user to select a brand name
selectInput(inputId = 'brand',
label = 'Select a Product Brand:',
choices = unique(retail_meats$BRAND_NAME))
```
### Your selected brand:
```{r}
# ask user to select a brand name
selectInput(inputId = 'brand',
label = 'Select a Product Brand:',
choices = unique(retail_meats$BRAND_NAME))
# sort the data for just the chosen brand
filtered_data <- reactive({
filter(retail_meats, BRAND_NAME == input$brand)
})
# plot yes/no cases for the chosen brand
renderPlot({
req(input$brand)
ggplot(filtered_data(), aes(x = GROWTH)) +
geom_bar(stat = "count") +
labs(x = "False/Positive Growth", y = "Number of Cases", title = paste("Recorded Cases for", input$brand, "(2002-2019)")) + theme(plot.margin = margin(b = 1.5))
})
```
# Analysis {.tabset .tabset-fade}
## Significance Test
### Conduct a t-test to compare the number of cases in 2019, and five, ten, or fifteen years prior to the average over the span of 2002-2019.
```{r}
# select a year to be the null hypothesis in the t-test
selectInput(inputId = 't_test',
label = 'Choose a year:',
choices = c(2019, 2014, 2009, 2004))
```
### The Results
```{r}
# Perform t-test
# mu = count of user-chosen year
# if we reject the null -> the chosen year is higher than avg.
renderPrint({
chosen_year <- cases_by_year$Count[cases_by_year$Year == input$t_test]
t.test(cases_by_year$Count, mu = chosen_year, alternative = "less")
})
```
# Summary {.tabset .tabset-fade}
### Summary
Let's analyze our plots and t-test results. While there is not a strictly positive linear relationship between time and the number of positive growth cases, we do see that there are natural rises and falls in the yearly totals with a strong uptick at the year 2019. There is the same state origin distribution across most years in the span 2002-2019, which can be expected given the central locations of retail meat production/distribution. It was interesting to see that chicken had the highest number of yearly cases in comparison to other meat sources, generally around 1500, with pork chops having the yearly numbers less than 500. For the year 2019, there is an extremely small p-value, indicating that the true average number of cases over the range of data collection (2002-2019) is much less than the number of positive cases recorded in 2019. We see somewhat similar results in 2004 with a larger p-value, but still small enough to reject the null hypothesis. However, there was not enough evidence to reject the hypothesis that the true mean was less than the total number of positive cases in the years 2009 and 2014. In conclusion, we can have extreme confidence that the cases in 2019 were much higher than previous years. It would be helpful to see if this trend continues upwards into the year 2020-2024 once that data is available.
# Appendix {.tabset .tabset-fade}
## References
### References
“National Antimicrobial Resistance Monitoring System for Enteric Bacteria (NARMS).” Centers for Disease Control and Prevention, Centers for Disease Control and Prevention, 7 Aug. 2023, www.cdc.gov/narms/index.html.
Medicine, Center for Veterinary. “Integrated Reports/Summaries.” U.S. Food and Drug Administration, FDA, 2 Aug. 2023, www.fda.gov/animal-veterinary/national-antimicrobial-resistance-monitoring-system/integrated-reportssummaries.
## Info
### Personal Information
- **Name:** Miller Christen
- **Email:** echris5@g.clemson.edu
- **Course:** STAT 4020 - Spring 2024
- [LinkedIn Profile](https://www.linkedin.com/in/miller-christen-a55264218/)
### Miller Christen
```{r out.width = "50%", fig.align = "center"}
# Loading Data
knitr::include_graphics("me.png")
```