The dataset provided offers a comprehensive overview of the McDonald’s menu, featuring a diverse array of fast-food options across multiple categories. From classic favorites like the Big Mac and Chicken McNuggets to breakfast staples like the Sausage McMuffin and Hotcakes, the dataset covers an extensive range of menu items. Each entry includes detailed nutritional information per serving, including metrics such as calories, protein, total fat, saturated fat, trans fat, cholesterol, carbohydrates, sugars, added sugars, and sodium content. Additionally, the dataset encompasses a variety of beverages from the McCafe menu, including coffee, tea, and specialty drinks, as well as condiments such as ketchup and mustard packets. With its comprehensive coverage and detailed nutritional breakdown, this McDonald’s dataset provides valuable insights for analyzing fast-food choices and their nutritional impact. I decided to analyze the McDonald’s menu dataset, particularly focusing on the Gourmet Menu , stems from a desire to comprehend the nutritional impact of fast food in a country as vast and populous as India. With its enormous population, understanding the dietary habits and calorie intake associated with McDonald’s meals can offer valuable insights into nutritional patterns and potential health effects. By examining the calorie content of popular menu items consumed during, this analysis aims to shed light on how McDonald’s and similar fast-food chains contribute to overall nutrition in India.
Load the libraries, setup the work direction , and read the csv
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.3.3
Warning: package 'ggplot2' was built under R version 4.3.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.0 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
I will begin by selecting the portion of the dataset that pertains to the regular menu, focusing specifically on meals that customers typically purchase for lunch each day. To ensure a fair comparison, I will exclusively include columns representing quantities measured in grams.
make a graph that show us the relationship between the total fat and the cholesterols
library(ggplot2)firstplot <-ggplot(Mcdo_india3, aes(x= Total.fat..g., y= Cholesterols..mg.)) +geom_point(size=6, color="pink") +scale_y_continuous(limits=c(0,100))+labs(title ="quantity of cholesterols based on total amount of fat that Mcdo india present", caption ="Source : Kaggle,Mcdonald India" , x="Total amount of fat", y="Quantity of Cholesterols") +theme_minimal(base_size =10)firstplot
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).
Comments :
The visualization underscores the correlation between cholesterol intake and fat consumption from McDonald’s meals in India. As cholesterol levels rise, so does the amount of fat consumed, indicating a direct relationship between the two. This implies that managing daily cholesterol could be key to reducing fat consumption effectively. To proove it , let see tha correlation between these two .
linear regression :
firstplot <-ggplot(Mcdo_india3, aes(x= Total.fat..g., y= Cholesterols..mg.)) +geom_point(size=6, color="pink") +labs(title ="quantity of cholesterols based on total amount of fat that Mcdo india present", caption ="Source : Kaggle,Mcdonald India" , x="Total amount of fat", y="Quantity of Cholesterols") +theme_minimal(base_size =12 ) +geom_smooth(method ="lm", formula = y~x)firstplot
Comments :
It appears that there is a positive correlation between the variables under consideration. This suggests that as one variable increases, the other tends to increase as well. In our case, as the amount of fat consumed from McDonald’s meals in India increases, there is also a corresponding increase in cholesterol .
correlation between the total amount of fat that the food had and the chlolesterols
lm_model <-lm(Total.fat..g.~Cholesterols..mg. , data = Mcdo_india3)summary(lm_model)
Call:
lm(formula = Total.fat..g. ~ Cholesterols..mg., data = Mcdo_india3)
Residuals:
Min 1Q Median 3Q Max
-12.402 -5.606 -2.427 4.881 17.512
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 24.67030 4.06841 6.064 0.000187 ***
Cholesterols..mg. 0.04100 0.03816 1.074 0.310583
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.81 on 9 degrees of freedom
Multiple R-squared: 0.1137, Adjusted R-squared: 0.01521
F-statistic: 1.154 on 1 and 9 DF, p-value: 0.3106
the equation will be :
Cholesterols..mg. = 0.04100 (Totalfat)+24.67030
Analyze the model based on p-values,adjusted r^2 values, and diagnostic plots .
The anal1ysis of the provided model summary indicates that the predictor variable Cholesterols..mg. lacks statistical significance in predicting the response variable Total.fat..g., as evidenced by its p-value of 0.3106, which exceeds the typical significance level of 0.05. Additionally, the adjusted R-squared value of 0.01521 suggests that only approximately 1.52% of the variability in Total.fat..g. is explained by Cholesterols..mg., indicating a poor fit of the model to the data. Diagnostic plots, crucial for assessing the model’s assumptions, are notably absent from the analysis, making it challenging to thoroughly evaluate the model’s validity. Overall, considering the lack of significance of Cholesterols..mg., the low explanatory power of the model, and the absence of diagnostic plots, it appears that the model does not adequately capture the relationship between cholesterol and total fat content in the given dataset.
final visualisation
library(highcharter)
Warning: package 'highcharter' was built under R version 4.3.3
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
Highcharts (www.highcharts.com) is a Highsoft software product which is
not free for commercial and Governmental use
library(plotly)
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
menu_data <-data.frame(Menu.Items =c("American Triple Cheese Chicken", "American Triple Cheese Veg", "Cheese Lava Burger", "Chicken Cheese Lava Burger", "Chunky Chipotle American Burger Chicken", "McSpicy Premium Chicken Burger", "McSpicy Premium Veg Burger", "Piri piri Mc Spicy Chicken Burger", "Piri piri Mc Spicy Veg Burger", "Cheesy Veg Nuggets (6pc)", "Cheesy Veg Nuggets (9pc)"),Cholesterols..mg. =c(71.23, 48.74, 33.21, 73.11, 110.37, 302.61, 43.68, 64.19, 8.10, 20.03, 30.05),Total.fat..g. =c(22.65, 23.16, 33.48, 45.18, 31.51, 34.65, 39.21, 17.30, 24.53, 13.09, 19.63),Total.Sugars..g. =c(7.64, 7.90, 16.27, 16.75, 9.16, 6.07, 7.57, 9.29, 12.87, 1.31, 1.96))highchart() %>%hc_chart(type ="column") %>%hc_title(text ="Mcdonald menu in India") %>%hc_xAxis(categories = menu_data$Menu.Items) %>%hc_yAxis(title =list(text ="Value")) %>%hc_plotOptions(column =list(stacking ="normal",borderWidth =0 ) ) %>%hc_series(list(name ="Cholesterol", data = menu_data$Cholesterols..mg., color ="purple"),list(name ="Total Fat", data = menu_data$Total.fat..g., color ="blue"),list(name ="Total Sugar", data = menu_data$Total.Sugars..g., color ="red") )
Comments:
In the visualization, each of the 13 food items on the menu is represented, showcasing the quantities of cholesterol, sugar, and total fat they provide. A glance at the graph immediately highlights that the McSpicy Premium Chicken Burger offers the highest quantity of cholesterol. Moreover, the Chicken Cheese Lava Burger stands out with a substantial total fat content of 45.18, along with a notable quantity of sugar.
Essay :
The journey with the McDonald’s dataset from Kaggle was initially met with skepticism, as the subject matter appeared simplistic. However, as I delved deeper, I uncovered layers of insights that piqued my curiosity. The dataset offers a window into the nutritional composition of McDonald’s offerings, focusing on key metrics like cholesterol, sugar, and total fat content. This exploration is crucial given the ongoing public discourse surrounding fast food and its potential health implications, particularly in countries with large consumer bases like India.
As I embarked on this analysis, I recognized the opportunity to gain valuable insights not only into McDonald’s menu but also into broader societal and economic trends. My approach began with the mundane task of loading requisite libraries and filtering the dataset to extract pertinent information. However, as I delved deeper, each data point became a piece of a larger puzzle, offering glimpses into consumption patterns, dietary preferences, and cultural influences.
The decision to focus on India as the focal point of analysis was strategic, considering its burgeoning population and the growing influence of global fast-food chains. McDonald’s, with its iconic brand and ubiquitous presence, serves as a microcosm of broader trends in food consumption and lifestyle choices. By dissecting the nutritional content of McDonald’s menu items, I aimed to shed light on the complex interplay between dietary habits, public health, and economic development.
The visualization journey began with a simple question: how does the cholesterol content of McDonald’s menu items correlate with their total fat content? This initial exploration laid the foundation for more nuanced analyses, including correlation studies and regression modeling. Each graph, chart, and statistical test unveiled new layers of understanding, challenging preconceived notions and prompting deeper inquiry.
The final visualization, which compared the cholesterol, sugar, and total fat content across different menu items, served as the culmination of weeks of exploration and analysis. It wasn’t just a snapshot of McDonald’s menu; it was a reflection of broader societal trends, economic dynamics, and individual choices. Through this project, I gained not only technical proficiency but also a deeper appreciation for the intricate interplay between food and health.
As I reflect on this journey, I am reminded of the words of the renowned food journalist Michael Pollan: “Eat food, not too much, mostly plants.” In an era of fast-paced lifestyles and convenience-driven consumption, understanding the nutritional landscape of fast-food chains like McDonald’s is more critical than ever. It is not merely about analyzing data; it is about unraveling the complex tapestry of human behavior, societal norms, and global economics that shape our food choices.
WORK Cited :
Rai, Saritha. “World Business Briefing Asia: India: Mcdonald’s Is Expanding.” New York Times, 7 Nov. 2006, p. C8(L). Gale In Context: Opposing Viewpoints, link.gale.com/apps/doc/A153969734/OVIC?u=rock77357&sid=bookmark-OVIC&xid=0907b1d6. Accessed 15 Apr. 2024.
Comments :
The visualization underscores the correlation between cholesterol intake and fat consumption from McDonald’s meals in India. As cholesterol levels rise, so does the amount of fat consumed, indicating a direct relationship between the two. This implies that managing daily cholesterol could be key to reducing fat consumption effectively. To proove it , let see tha correlation between these two .