A McDonald’s vs Taco Bell Simulation: finding the healthier choice
By: Vishnu Nair
Tags: Food, Exploratory Data Analysis, Simulation, Hypothesis Testing, Fast Food

Photo by Shaafi Ali on Unsplash

Imagine this. You finished a long day of work and decide to pick up some groceries on the way home. After running some errands, you look at your watch: 9:00pm. To give yourself some rest, you decide to grab dinner at a fast-food joint. Sound familiar? I bet.

We all live incredibly busy lives. Although we all know that fast food is not necessarily the most healthiest option, a lot of people still utilize these facilities due to their immense convenience. We tend to bundle all of these chain restaurants as being equally unhealthy as the next. However, looking into the specific nutritional facts is key to distinguishing them and making the right choice for a healthier meal. In this case study, I focus on two very popular fast-food restaurants, McDonald’s and Taco Bell, and answer the age-old question:

Eating from which restaurant would be the healthier choice in the long-run?

Simulating the System

I first grabbed the menu’s from both restaurants and labelled each item as either an entree, drink, side, dessert, sauce, or dressing. For McDonalds information, I pulled from a dataset on Kaggle and for Taco Bell, I created the dataset myself based on a nutrition facts website I found. I kept drinks that were unique to each restaurant and discarded the rest from the analysis. In other words, drinks such as Coke, Sprite, etc. were removed from both datasets as I only consider food items that are trademark to the restaurant. The scope of this analysis encompasses lunch and dinner menu items only.

I then created four distinct simulations in which a customer would purchase meals from each restaurant, the key difference being the definition of the word “meal”.

Simulation 1: A customer purchasing one entree alone

Simulation 2: A customer purchasing one entree and a drink

Simulation 3: A customer purchasing one entree, a drink, and a side

Simulation 4: A customer purchasing one entree, a drink, a side, and a dessert

To make the analysis even more realistic, I created stipulations within certain menu items for both restaurants. If a salad were to be randomly picked as a side item, the script randomly picks a salad dressing to go along with the meal. If chicken nuggets or chicken strips were picked as an entree item, then the script randomly selects a sauce to go with it as well. For Taco Bell entrees, I made sure each simulation randomly selects two sauces to go along with each entree item.

For each simulation, meals following these combinations were sampled 10,000 times. From this, clear distinctions were able to be made between between the facilities. Let us first consider the simplest case in which a customer orders one entree alone. From simulation 1, I created the following plot:

Simulation 1 results indicating similar nutritional distributions for entrees alone. Image by author.

Note that the average calories, calories from fat, cholesterol, and sodium are quite similar between the two facilities. I was curious if this trend carries over for all simulations, leading me to compare the averages for these features for all simulations run. The short answer is no. I created this plot which shows us the results.

Averages for all simulations (n=10,000). Image by author.

We see that stark differences can be made in nutritional features across trials. Simulation 1 is in fact the only trial that resulted in seemingly similar results for both restaurants. This means that the drinks, sides, and desserts in the restaurants exhibit higher variance in nutritional qualities. The previously mentioned features are quite higher for McDonald’s than for Taco Bell. To assess if these differences are mathematically significant, I ran a non-parametric test (a Mann-Whitney U Test) for all simulations. Predictably, I obtained very low p-values for all trials, indicating a significant difference between the nutritional features displayed above for the two restaurants. I did not expect a significant difference for Simulation 1, however.

Let’s take a closer look at Simulation 4, which encompasses a full-course meal. In my opinion, this should be the trial that we place the most emphasis on. If we take a snapshot of how the nutritional features compare from one meal to another for the first 500 samples, we would see the following: