library(tidyverse)
health_dataset <- read_csv("health_dataset.csv")Final Project - Resistence to Insulin
Diabetes is an immune disease that effects thousands of people every year. It has affected many lives across the world, as well as my own. My sister was diagnosed with the disease when she was 4 years old, and since then has had to rely on the insulin provided by medical companies to survive. I discovered data that suggested people were becoming more resistant to insulin as time progressed. Insulin is a drug, and the human body is known to grow resistant to many number of substances. I reviewed the data and have been able to present the observation to reveal interesting facts.
First, I needed to narrow down the data collected to a few countries. I select 5 countries with high populations from across the globe to compare with one another. The countries I chose were the United States, China, Brazil, France, and India. As a start, I created a graph that would simply give the number of cases recorded that had diabetes in the given country.
health_dataset |>
filter(Diabetic == 1) |>
filter(Country %in% c("United States", "China", "Brazil", "France", "India")) |>
ggplot(mapping = aes(x = Country, fill = Country)) +
geom_bar() +
labs(title = "Recorded Diabetic Cases by Country",
x = "Country",
y = "Number of People with Diabetes")Next, I wanted to see if there was a trend of insulin resistance across the time period that the study collected data. Using the same countries, I created a line plot that would track the number of people that were documented as having immune resistance in the study. It is important to note that the graph does not display the total number of people with insulin resistance, but just the number recorded for that year.
health_dataset |>
filter(Insulin_Resistant == 1) |>
filter(Country %in% c("United States", "China", "Brazil", "France", "India")) |>
group_by(Year, Country) |>
summarize(Total_Resistant = n(), .groups = "drop") |>
ggplot(mapping = aes(x = Year, y = Total_Resistant,
color = Country)) +
geom_line(linewidth = .5) +
geom_point() +
labs(title = "Insulin Resistance Trends",
x = "Year",
y = "Number of People with Insulin Resistance")Finally, I wanted to test if the studies immune resistance designations were accurate. HOMA-IR is a blood test that the medical community believes accurately measures how resistant the your body is to insulin. The HOMA-IR is calculated by using the subjects fasting insulin and glucose levels to calculate a number. Typically, a number of less than 1.0 is ideal and indicates high insulin sensitivity. Anything from a 1.0 - 2.0 is considered normal, while anything higher than 2.0 is believed to show high insulin resistance. The graph below calculates the average HOMA for each of the subjects in the year recorded.
health_dataset |>
filter(Country %in% c("United States", "China", "Brazil", "France", "India")) |>
group_by(Year, Country) |>
summarize(Avg_HOMA = mean(HOMA_IR, na.rm = TRUE), .groups = "drop") |>
ggplot(mapping = aes(x = Year, y = Avg_HOMA, color = Country)) +
geom_line(linewidth = .5) +
geom_point() +
labs(title = "Average HOMA-IR Trends by Country",
x = "Year",
y = "Average HOMA-IR Score")Comparing the two graphs, we can see that there are similar trends between the insulin resistant grading and the HOMA-IR levels.