Avinash Juttiga (s4033296)
Last Updated on 30th October 2024
## Warning: package 'ggplot2' was built under R version 4.3.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## Warning: package 'tidyr' was built under R version 4.3.3
library(readxl)
obesity_data <- read_excel("D:/RMIT CLASSES/3 semester/Data Visualization and Communications/ASSIGNMNET 3/Obesity_Dataset.xlsx")## Warning: Coercing text to numeric in M1188 / R1188C13: '1'
## Warning: Coercing text to numeric in M1190 / R1190C13: '3'
## Warning: Coercing text to numeric in M1200 / R1200C13: '2'
## Warning: Coercing text to numeric in J1201 / R1201C10: '3'
## Warning: Coercing text to numeric in M1202 / R1202C13: '3'
## Warning: Coercing text to numeric in J1211 / R1211C10: '3'
## Warning: Coercing text to numeric in M1215 / R1215C13: '2'
## Warning: Coercing text to numeric in M1216 / R1216C13: '1'
## Warning: Coercing text to numeric in J1225 / R1225C10: '1'
## Warning: Coercing text to numeric in M1226 / R1226C13: '1'
## Warning: Coercing text to numeric in M1227 / R1227C13: '1'
## Warning: Coercing text to numeric in J1229 / R1229C10: '3'
## Warning: Coercing text to numeric in M1231 / R1231C13: '1'
## Warning: Coercing text to numeric in J1233 / R1233C10: '3'
## Warning: Coercing text to numeric in M1234 / R1234C13: '1'
## Warning: Coercing text to numeric in M1235 / R1235C13: '3'
## Warning: Coercing text to numeric in M1251 / R1251C13: '1'
## Warning: Coercing text to numeric in M1256 / R1256C13: '3'
## Warning: Coercing text to numeric in M1259 / R1259C13: '1'
## Warning: Coercing text to numeric in M1265 / R1265C13: '3'
## Warning: Coercing text to numeric in J1269 / R1269C10: '1'
## Warning: Coercing text to numeric in M1272 / R1272C13: '2'
## Warning: Coercing text to numeric in M1274 / R1274C13: '2'
## Warning: Coercing text to numeric in M1279 / R1279C13: '1'
## Warning: Coercing text to numeric in M1283 / R1283C13: '1'
## Warning: Coercing text to numeric in M1284 / R1284C13: '1'
## Warning: Coercing text to numeric in M1291 / R1291C13: '1'
## Warning: Coercing text to numeric in M1294 / R1294C13: '3'
## Warning: Coercing text to numeric in M1297 / R1297C13: '2'
## Warning: Coercing text to numeric in M1301 / R1301C13: '3'
## Warning: Coercing text to numeric in M1304 / R1304C13: '2'
## Warning: Coercing text to numeric in M1307 / R1307C13: '2'
## Warning: Coercing text to numeric in M1308 / R1308C13: '3'
## Warning: Coercing text to numeric in M1311 / R1311C13: '3'
## Warning: Coercing text to numeric in M1318 / R1318C13: '1'
## Warning: Coercing text to numeric in M1325 / R1325C13: '1'
## Warning: Coercing text to numeric in M1335 / R1335C13: '1'
## Warning: Coercing text to numeric in M1341 / R1341C13: '3'
## Warning: Coercing text to numeric in M1346 / R1346C13: '2'
## Warning: Coercing text to numeric in M1351 / R1351C13: '3'
## Warning: Coercing text to numeric in M1356 / R1356C13: '1'
## Warning: Coercing text to numeric in M1360 / R1360C13: '1'
## Warning: Coercing text to numeric in J1361 / R1361C10: '3'
## Warning: Coercing text to numeric in M1361 / R1361C13: '1'
## Warning: Coercing text to numeric in M1362 / R1362C13: '3'
## Warning: Coercing text to numeric in M1371 / R1371C13: '2'
## Warning: Coercing text to numeric in M1376 / R1376C13: '3'
## Warning: Coercing text to numeric in M1378 / R1378C13: '3'
## Warning: Coercing text to numeric in M1379 / R1379C13: '2'
## Warning: Coercing text to numeric in J1381 / R1381C10: '3'
## Warning: Coercing text to numeric in M1385 / R1385C13: '3'
## Warning: Coercing text to numeric in M1393 / R1393C13: '3'
## Warning: Coercing text to numeric in J1403 / R1403C10: '3'
## Warning: Coercing text to numeric in M1412 / R1412C13: '2'
## Warning: Coercing text to numeric in J1417 / R1417C10: '1'
## Warning: Coercing text to numeric in M1418 / R1418C13: '2'
## Warning: Coercing text to numeric in J1421 / R1421C10: '1'
## Warning: Coercing text to numeric in M1425 / R1425C13: '3'
## Warning: Coercing text to numeric in M1430 / R1430C13: '3'
## Warning: Coercing text to numeric in M1432 / R1432C13: '1'
## Warning: Coercing text to numeric in M1435 / R1435C13: '3'
## Warning: Coercing text to numeric in M1436 / R1436C13: '3'
## Warning: Coercing text to numeric in M1444 / R1444C13: '3'
## Warning: Coercing text to numeric in M1445 / R1445C13: '1'
obesity_data <- obesity_data %>%
mutate(across(everything(), as.numeric))
comparison_summary <- obesity_data %>%
group_by(Sex) %>%
summarise(across(everything(), list(mean = ~mean(. , na.rm = TRUE), sd = ~sd(. , na.rm = TRUE))))
# Box plot of Age by Sex
plot1<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), y = Age, fill = factor(Sex))) +
geom_boxplot() +
labs(x = "Sex", y = "Age", title = "Comparison of Age between Males and Females") +
scale_fill_discrete(name = "Sex", labels = c("Male", "Female")) +
theme_minimal()
# Box plot of Height by Sex
plot2<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), y = Height, fill = factor(Sex))) +
geom_boxplot() +
labs(x = "Sex", y = "Height", title = "Comparison of Height between Males and Females") +
scale_fill_discrete(name = "Sex", labels = c("Male", "Female")) +
theme_minimal()
# Bar plot for Overweight_Obese_Family by Sex
plot3<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Overweight_Obese_Family))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Overweight/Obese Family", title = "Comparison of Overweight/Obese Family History by Sex") +
scale_fill_discrete(labels = c("Yes", "No")) +
theme_minimal()
# Bar plot for Consumption_of_Fast_Food by Sex
plot4<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Consumption_of_Fast_Food))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Consumption of Fast Food", title = "Comparison of Fast Food Consumption by Sex") +
scale_fill_discrete(labels = c("Yes", "No")) +
theme_minimal()
# Bar plot for Frequency_of_Consuming_Vegetables by Sex
plot5<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Frequency_of_Consuming_Vegetables))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Frequency of Consuming Vegetables", title = "Comparison of Vegetable Consumption Frequency by Sex") +
scale_fill_discrete(labels = c("Rarely", "Sometimes", "Always")) +
theme_minimal()
plot6<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Number_of_Main_Meals_Daily))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Number of Main Meals Daily", title = "Comparison of Main Meals Frequency by Sex") +
scale_fill_discrete(labels = c("1-2", "3", "3+")) +
theme_minimal()
# Bar plot for Food_Intake_Between_Meals by Sex
plot7<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Food_Intake_Between_Meals))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Food Intake Between Meals", title = "Comparison of Food Intake Between Meals by Sex") +
scale_fill_discrete(labels = c("Rarely", "Sometimes", "Usually", "Always")) +
theme_minimal()
# Bar plot for Smoking by Sex
plot8<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Smoking))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Smoking", title = "Comparison of Smoking Habits by Sex") +
scale_fill_discrete(labels = c("Yes", "No")) +
theme_minimal()
# Bar plot for Liquid Intake Daily by Sex
plot9<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Liquid_Intake_Daily))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Liquid Intake Daily", title = "Comparison of Liquid Intake by Sex") +
scale_fill_discrete(labels = c("Less than 1 liter", "1-2 liters", "More than 2 liters")) +
theme_minimal()
# Bar plot for Calculation of Calorie Intake by Sex
plot10<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Calculation_of_Calorie_Intake))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Calorie Intake Calculation", title = "Comparison of Calorie Intake Calculation by Sex") +
scale_fill_discrete(labels = c("Yes", "No")) +
theme_minimal()
# Bar plot for Physical Exercise by Sex
plot11<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Physical_Excercise))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Physical Exercise", title = "Comparison of Physical Exercise by Sex") +
scale_fill_discrete(labels = c("No activity", "1-2 days", "3-4 days", "5-6 days", "6+ days")) +
theme_minimal()
# Bar plot for Schedule Dedicated to Technology by Sex
plot12<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Schedule_Dedicated_to_Technology))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Technology Use Schedule", title = "Comparison of Technology Use Schedule by Sex") +
scale_fill_discrete(labels = c("0-2 hours", "3-5 hours", "More than 5 hours")) +
theme_minimal()
# Bar plot for Type of Transportation Used by Sex
plot13<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Type_of_Transportation_Used))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Type of Transportation", title = "Comparison of Transportation Type by Sex") +
scale_fill_discrete(labels = c("Automobile", "Motorbike", "Bike", "Public transport", "Walking")) +
theme_minimal()
# Bar plot for Class by Sex
plot14<-ggplot(obesity_data, aes(x = factor(Sex, labels = c("Male", "Female")), fill = factor(Class))) +
geom_bar(position = "dodge") +
labs(x = "Sex", fill = "Class", title = "Comparison of Weight Class by Sex") +
scale_fill_discrete(labels = c("Underweight", "Normal", "Overweight", "Obesity")) +
theme_minimal()Obesity is a serious and chronic disease with genetic interactions. It is defined as an excessive amount of fat tissue in the body that is harmful to health. The main risk factors for obesity include social, psychological, and eating habits. Obesity is a significant health problem for all age groups in the world. This data-set includes lifestyle factors , boi-metric data, dietary habits and transportation choices of nearly 1610 individuals.Some of the factors used in this data are as follows: Overweight/Obese Families
-Consumption of Fast Food -Frequency of Consuming Vegetables -Number of Main Meals Daily -Food Intake Between Meals -Smoking -Liquid Intake Daily -Calculation Of Calorie Intake -Physical Exercise -Schedule Dedicated to Technology -Type of Transportation Used -Class
The above two box plots gives us a comparison analysis of age and height between the males and females among the 1610 individuals.Both males and females have similar age distribution with a median age of mid 30’s. whereas the height distribution shows a notable difference , with males taller than females.
The above plot illustrates that for both sexes, individuals with no
family history of overweight or obesity are more dominant than those
with such a family history, with a larger number of females in each
category than males.
The visualization provides that a significant portion of both sexes do
not consume fast food, with females in particular having a higher count
in the “No” category.
In the above visualization highlights that while both genders have
similar patterns, females tend to report a slightly higher frequency of
always consuming vegetables.
Both sexes generally have three main meals a day. Females show a
marginally higher tendency towards frequent snacking. This combined
pattern shows us the gender-based differences in eating habits, with a
consistent eating meals across genders, but snacking behavior is
slightly higher .
The above plot implies that smoking is more uniformly distributed among
males, while females are mostly non-smokers.
Both genders tend to take more than 2 liters of liquids daily, calorie
intake tracking is less used, with most individuals from both sexes not
engaging in this practice.The above plot shows us sufficient hydration
and low engagement with calorie monitoring across genders.
Both genders tend to exercise regularly and use technology moderately,
with slight variations. Females have a slightly higher interest in both
frequent physical activity and moderate use of technology.
Both genders mostly depend on automobiles and public transport,while
males show preference for motorbikes and females are more favorable for
biking and walking.
-Increasing Physical Activity also integrating various types like aerobic and strength training.
-Improve Dietary Choices by limiting fast food and more intake of balanced meals rich in vegetables and proteins.
-Staying hydrated by drinking at-least 2 liters of water daily to support metabolism.
-Reducing screen time by taking regular breaks from screens and integrating a short physical activities.
-Educate on portion sizes and caloric content to help manage intake with strict calorie counting.
-BY quitting smoking to improve overall health and energy levels. -Promote walking and add physical activity into daily routines by setting Health Goals
The visualizations provide a comprehensive overview of lifestyle factors contributing to obesity across genders. Key observations include differences in exercise frequency, dietary habits, hydration, smoking, technology use, and transportation preferences. Both males and females show similar patterns in primary habits like meal frequency and hydration, though females tend to engage slightly more in regular physical activity and consume vegetables more frequently. However, both genders show high screen time, limited calorie tracking, and a reliance on automobiles, which are potential risk factors for sedentary lifestyles.
These insights suggest that while both genders have areas where they are taking positive steps, there are several lifestyle modifications that could help prevent and manage obesity more effectively. By focusing on increasing physical activity, improving dietary awareness, reducing sedentary behaviors, and promoting community support, tailored interventions can support healthier lifestyles and reduce obesity risk across both genders.
References: Koklu, N., & Sulak, S. A. (2024). Using artificial intelligence techniques for the analysis of obesity status according to the individuals’ social and physical activities. Sinop Üniversitesi Fen Bilimleri Dergisi, 9(1), 217–239. https://doi.org/10.33484/sinopfbd.1445215