According to the Centers for Disease Control and Prevention (CDC), “Chronic diseases are defined broadly as conditions that last 1 year or more and require ongoing medical attention or limit activities of daily living or both.” Chronic diseases include a wide range of conditions such as diabetes, cancer, cardiovascular disease, and mental health conditions.
Chronic diseases are extremely prevalent. Surprisingly, the CDC has found that “among adults ages 65 and older, more than 90% have at least one chronic condition.” Putting that into perspective, that is over 58 million people in the U.S. alone. In order to reduce this number and help people live healthier lives, this project explores patterns between different health indicators and how they are associated with chronic diseases. Identifying patterns within the data can be the first step to help solve this problem. As a biomedical engineer and data scientist, I hope that by analyzing these patterns and creating data visualizations, I can help bring awareness to chronic disease and encourage people think about it in a different light.
The dataset I used in my analysis is U.S. Chronic Disease Indicators, which was sourced from the CDC. This dataset includes many different variable that are helpful in identifying trends within chronic disease indicators. For example, it has questions based on specific chronic disease topics that are answered in terms of numeric values, crude or age-adjused prevalence, or mean values. I plan to compare these variables to one another throughout this report as I try to find predictions for patterns. Ultimately, I hope to learn practical applications for the analysis of data and building predictive models for the medical field. By understanding how variables relate to one another and how different modeling techniques behave, I can develop more reliable and accurate models. These models can help save and extend human lives. Furthermore, it can alter how people live on a day-to-day basis, making it greatly relevant and important to understand. I will do this by creating specific reseach questions to guide by project.
What does the frequency distribution look like for the 5 most common health topics (relating to chronic disease) over the course of time?
How much do diabetes crude prevalence rates vary across different racial and ethnic groups?
How does Cardiovascular (Heart) Health compare between men and women?
What is the distribution of the average recent physically unhealthy days among adults?
#Renaming the Data Values column to Answer, to better understand the context of the values according to Questions column
names(disease)[11] <- "Answer"
#Removing Rows
#rows with no data is available (NA entries)
disease <- disease[disease$DataValueFootnoteSymbol != "*", ]
#rows with too few responses
disease <- disease[disease$DataValueFootnoteSymbol != "~", ]
#rows with data suppressed (denominator < 50 or relative standard error > 30%, stated in dataset)
disease <- disease[disease$DataValueFootnoteSymbol != "****", ]
#Removing columns without data
#footnotes columns
disease <- disease[ , -c(13, 14)]
#columns with 100% NA values
disease<- disease[, colSums(is.na(disease)) < nrow(disease)]
# Creating New Variables
disease <- disease %>%
mutate(time_period = YearEnd - YearStart)
#Summary of Cleaning
col_names <- colnames(disease)
cat("After data cleaning, the number of total rows is now:", sum(row(disease)), "\n")
cat("The names of the columns in this dataset are:", colnames(disease), "\n")
After data cleaning, the number of total rows is now: 896779680125
The names of the columns in this dataset are: YearStart YearEnd LocationAbbr LocationDesc DataSource Topic Question DataValueUnit DataValueType Answer DataValueAlt LowConfidenceLimit HighConfidenceLimit StratificationCategory1 Stratification1 Geolocation LocationID TopicID QuestionID DataValueTypeID StratificationCategoryID1 StratificationID1 time_period
# Q: Is there a correlation between age and chronic binge drinking among adults?
alcohol_age <- disease %>%
filter (
Topic == "Alcohol",
Question == "Binge drinking frequency among adults who binge drink",
StratificationCategory1 == "Age") %>%
group_by(Stratification1) %>%
summarise(
frequency_of_binge_drinking = median(as.numeric(Answer), na.rm = TRUE))
alcohol_age
print("Interpretation: There is no direct correlation between age and frequency of chronic binge drinking in adults. The number of drinks consumed within 1 hour was 3.0 to 3.35 across all age groups. The median values were within a similar range, the age group with the highest frequency was age 45-64 and the age group with the lowest frequency was 65 and older.")
[1] "Interpretation: There is no direct correlation between age and frequency of chronic binge drinking in adults. The number of drinks consumed within 1 hour was 3.0 to 3.35 across all age groups. The median values were within a similar range, the age group with the highest frequency was age 45-64 and the age group with the lowest frequency was 65 and older."
# Q: What is the relationship between the number of females vs males with Cancer?
#Females:
cancer_females <- disease %>%
filter(
Topic == "Cancer",
StratificationCategory1 == "Sex",
Stratification1 == "Female")
#Males:
cancer_males <- disease %>%
filter(
Topic == "Cancer",
StratificationCategory1 == "Sex",
Stratification1 == "Male")
# Print the total count of rows
nrow(cancer_females)
nrow(cancer_males)
print("Interpretation: This dataset has the exact same amount of males with cancer and females with cancer. This must be because the sample of these surveys wanted to directly compare both groups. This makes it easier to accurately compare the two groups.")
[1] 2099
[1] 2099
[1] "Interpretation: This dataset has the exact same amount of males with cancer and females with cancer. This must be because the sample of these surveys wanted to directly compare both groups. This makes it easier to accurately compare the two groups."
#Q: How has the Diabetic ketoacidosis mortality number among people changed over time?
disease %>%
filter(
Question == "Diabetic ketoacidosis mortality among all people, underlying or contributing cause",
DataValueType == "Number",
DataValueUnit == "Number") %>%
group_by(YearStart) %>%
summarise(
avg_mortality_by_year = mean(as.numeric(Answer), na.rm = TRUE))
print("Interpretation: From 2019 to 2022, the average number of people who have passed away due to Diabetic ketoacidosis (whether it was a underlying or contributing cause) was relatively consistent. The values range from 80 to 108, but it is important to note that the value from 2019, which is 80, seems to be an outlier in this group.")
[1] "Interpretation: From 2019 to 2022, the average number of people who have passed away due to Diabetic ketoacidosis (whether it was a underlying or contributing cause) was relatively consistent. The values range from 80 to 108, but it is important to note that the value from 2019, which is 80, seems to be an outlier in this group."
# Q: Rank the most common Chronic Disease Topics in the dataset and display how many data entries do they each account for.
ranked_topics <- disease %>%
count(Topic, sort = TRUE)
ranked_topics
print("Interpretation: This table showcases the topics in descending order of appreance in this specific dataset. Because these topics have the most data on them, I will use these to help me answer my research questions because they are better for generalization as compared to topics that only have a few entries.")
[1] "Interpretation: This table showcases the topics in descending order of appreance in this specific dataset. Because these topics have the most data on them, I will use these to help me answer my research questions because they are better for generalization as compared to topics that only have a few entries."
Steps I took to create the plot (Breaking down the logic):
I found the 5 most common topics in the dataset by counting the frequency of each topic. Then, I organized this table into decreasing order so the top 5 entries have are the most common topics in this chronic disease dataset.
Next, I filtered the data so that we only look at the rows that have the 5 most common topics. I then took this filtered data and grouped it based on the Year Start and Topic, this is put into a new column n, and counted the resulting rows in n.
Then, I plotted the variables using ggplot2. I organized it so the x axis= Time, y axis= Count (based on the number of rows in the newly created column n), fill= Topic.
Lastly, I made it interactive using R’s plotly package. When you hover over each line, you are able to see the exact values for year start (x) and count(y), as well as which health topic you are looking at.
Analysis of Line Graph: This line plot shows the 5 most common health topics throughout the entire dataset that indicate chronic disease in the U.S. and their counts over time. Surprisingly, the amount of cancer has significantly decreased from 2015 to 2022. Specifically, this shows there are more records/data points collected on the topic of cancer during 2017 as compared to 2020. Additionally, a similar analysis can be done for in the chronic obstructive pulmonary disease. The number of data points were relatively consistent from 2019 to 2022, and then the value significantly dropped in 2023. I believe this could be because the dataset was not updated with the chronic obstructive pulmonary disease question from 2023. The topic of health status has remained relatively consistent from 2019-2023. Looking at the trend lines from Cardiovascular disease and Nutrition, Physical Activity, and Weight Status shows us that these topics are variable. The data points fluctuate up and down each year.
Steps I took to create the plot (Breaking down the logic):
I filtered the data using the dplyr package. In order to answer the research question posed, it was best to keep rows that address Diabetes, are statified based on race or ethnicity, and have answers represented in terms of crude prevalence.
I once again used the dplyr package, this time to clean the filtered data. I used mutate() to convert the values from the filtered data into numbers. This is because the values in the dataset sometimes start as strings, so I need to convert so that I am able to graph it.
Then, I created a box plot and plotted the variables using ggplot2. I organized it so the x axis= Race/Ethnicity and y axis= Crude Prevalence as a percentage.
Lastly, I made it interactive using R’s plotly package. When you hover over box, you are able to see a summary that includes data such as the min, quartile 1, median, quartile 3, and max values.
Analysis of Graph: This box plot shows the crude prevalence of Diabetes by the Race/Ethnicity. Crude prevalence is the percentage of a specific group that has a condition or risk factor, and it is calculated as the number of people with diabetes/total number of people in the group x 100. This graph shows systemic health disparities. Namely, communities like American Indian/Alaska Native and Native Hawaiian/Pacific Islander experience higher median prevalence rates and wider variability compared to their White counterparts, who have the lowest prevalence median out of all the groups.
Now, lets do a deep dive into one specific chronic disease indicator and compare different groups!
Steps I took to create the plot (Breaking down the logic):
I filtered the data using the dplyr package. Since we are specifically looking at the cardiac data between males and females, I used those categories as a filter. The crude prevalence will be plotted in order to compare the two groups, so I added that as another filter.
I once again used the dplyr package, this time to clean the filtered data. I used mutate() to convert the values from the filtered data into numbers. This is because the values in the dataset sometimes start as strings, so I need to convert so that I am able to graph it.
Then, I created a bar chart and plotted the variables using ggplot2. I organized it so the x axis= Question and y axis= Crude Prevalence as a percentage.
Lastly, I made it interactive using R’s plotly package. When you hover over box, you are able to see a the question, the crude value (percentage of group that answered “yes”), and the group (male or female).
Analysis of Graph: The bar chart shows that the crude prevalence values are similar between males and females in the categories of high BP, high cholesterol, and medicine for high cholesterol. However, there is a notable difference between males and females who take medicine for high blood pressure. Noticeably, females who take medicine for high blood pressure is at a value of 74.8%, while their male counter parts are at 54.9%, which is almost a 20% difference between the 2 groups, showing a significant difference.
Now, let’s take a look at preventative measures! Specifically how many people do not participate in activities that are beneficial for their health.
Steps I took to create the plot (Breaking down the logic):
I filtered the data using the dplyr package. The research question that we are asking focuses on the average number of days people have been physically unhealthy. As a result, I will filter the data for this question.
I once again used the dplyr package, this time to clean the filtered data. I used mutate() to convert the values from the filtered data into numbers. This is because the values in the dataset sometimes start as strings, so I need to convert so that I am able to graph it.
Then, I created a bar chart and plotted the variables using ggplot2. I organized it so the x axis= Average Number of Unhealthy Days and y axis= Count.
Lastly, I made it interactive using R’s plotly package. When you hover over each bar, you are able to see the count in a bin of size 20 and the average number of days.
Analysis of the Graph: This histogram, which shows the average number of unhealthy days experienced by people, roughly follows a normal distribution curve. This is represented by the somewhat symmetric bell-shaped curve, in which most values cluster around a central average, showing that the data near the mean are more frequent in occurrence than data far from the mean. The mean value is the center bar, which in this case would be close to 3.97. This represents the average number of recently physically unhealthy days that people with chronic diseases exhibit.
Steps I took to create the plot (Breaking down the logic):
I filtered the data using the dplyr package. The research question that we are asking focuses on the frequency of mental distress among adults across age groups. As a result, I will filter the data for this question as well as the specific stratification category.
I used the dplyr package, this time to clean the filtered data. I used mutate() to convert the values from the filtered data into numbers. This is because the values in the dataset sometimes represented as strings, so I need to convert so that I am able to graph it in my bar chart.
Then, I created a bar chart and plotted the variables using ggplot2. I organized it so the x axis= Age Groups and y axis= Crude Prevalence.
Lastly, I made it interactive using R’s plotly package. When you hover over each bar, you are able to see the category and the crude prevalence value.
Analysis of Graph: This bar graph shows that as the age increases, there is a lower frequency of mental distress. Notably, the Age group that acounts for ages 18-44 has the highest crude prevalence of mental distress (27.1%) and the age group for adults 65 and older has the lowest crude prevalence (12.7%). There is a 14.4% difference between these two groups. More research needs to be conducted as to why this may be the case. However, stress is a factor that connects to chronic disease. _____________________________________________________________________________________________________________