top of page

The Fast Food Industry: What are the Consumers Saying?

  • Writer: Anamika Singh
    Anamika Singh
  • Mar 11, 2022
  • 3 min read

Updated: Jul 26, 2023

Topics: Sentiment Analysis, R, Bag of Words, Market Intelligence




While there is a global macro-economic trend towards healthy foods, the fast food industry is still sizeable in terms of revenue and growth. Fast food restaurants are expected to grow by 7.1% in 2022 in the US leading to a market size of $317.5 billion dollars. While there are multiple big players that dominate the industry in terms of sales, which one dominates customer sentiments?

Using R, I followed a simple bag-of-words approach to look at the sentiment score distribution of 5 top fast food brands and subsequently draw conclusions about customer's attitudes towards each brand. Twitter is often the best platform for conducting sentiment analysis and also where I extracted my data from in this experiment.


The Process: 5 Steps

1. The first step was to set up a score sentiment function which would take as arguments the twitter tweet texts and the list of positive and negative words that we would use to categorize the tweet texts. The function would then clean the twitter text in terms of removing punctuations, extra characters (eg. tab, new line) and numbers. Once we had the clean words, we match these words with the list of positive and negative words initially provided, with each word receiving a score of 1 for every match. If a tweet had more positive matches than negative matches, it would have an overall score greater than zero, indicating positive sentiment, whereas if a tweet had more negative matches it would have an overall score lesser than zero indicating negative sentiment. The overall sentiment score of each tweet would then be returned by the function.

2. Once I had my function set up, I set up the twitter connection between R and my twitter developer account. More on that here: https://developer.twitter.com/en/support/twitter-api/developer-account

3. The next step was to actually extract the tweet data for each of the 5 brands. The brands that I chose were: McDonald's (@McDonalds), Burger King (@BurgerKing), Taco Bell (@tacobell), Wendy's (@Wendys) and Chipotle (@ChipotleTweets). Once I had the extracted twitter data, I cleaned it to only have the text of the tweet and remove other details like the username of the customer, how many times it was retweeted, how many times it was marked as a favorite, etc.

4. After simplifying my twitter data for each of the brands, I had my first argument for the function ready but still needed the other two arguments, i.e., the list of positive words and negative words. This can be pulled out from R itself as it has built in English dictionaries for positive and negative words.

5. The last step of course, was to pass the 3 arguments to my sentiment score function, get the distribution of the sentiment scores and plot them in a histogram.



The Outcomes:

1. McDonald's:


2. Burger King:


3. Taco Bell:

4. Wendy's:


5. Chipotle:

Comparing the 5 graphs, we can see that:

a. Taco Bell and Chipotle seem to be doing the best in terms of customer sentiment having significantly more positive scores than negative.

b. McDonald's seems to be slightly positive while Wendy's seems to be almost equally balanced between the negatives and the positives.

c. Burger King seems to have the highest negative range of scores, meaning there are some customers which have strong negative opinions about Burger King/it's products/it's facilities or staff. It also leans more towards negative as compared to the other brands in the experiment.

The entire code can be found below:


Long Story Short:

Sentiment analysis using a bag of words approach is one of the simplest forms of analysis to understand customer sentiment. The logic is straightforward - the more negative the score, the more negative the sentiment (the same applies to positives). As we look at the distribution of sentiment scores of the tweets of each of the 5 fast food brands we considered, Burger King seems to be the least liked by customers while Chipotle and Taco Bell seem to be liked the most. McDonalds and Wendy likely fall in the middle with a somewhat balanced distribution.

Comments


© 2023 by Analytics Abound. Created with Wix.com

bottom of page