Analysis of Online Reviews

Author

Emma Simkova

#Setup#
library(tidyverse)
library(tidytext)
library(kableExtra)
library(patchwork)
library(textdata)
library(topicmodels)
library(wordcloud)
library(SnowballC)
library(RColorBrewer)
library(reshape2)

#Built-in stop-words from tidy-text#
data(stop_words)

#Loading data#
mcd <- read_csv("mcdonalds_reviews.csv")
gamestop <- read_csv("gamestop_product_reviews.csv")

#Standardize column names (id + review)#
mcd <- mcd %>%
  rename(review_id = id, review_text = review) %>%
  mutate(review_id = as.integer(review_id))

gamestop <- gamestop %>%
  rename(doc_id = id, review_text = review) %>%
  mutate(doc_id = as.integer(doc_id))

1 Introduction

In this report I use R, RStudio, Quarto and tidyverse-based tools to analyse two datasets of online reviews. The first dataset, mcdonalds_reviews.csv, contains customer reviews of McDonald’s restaurants. The second dataset, gamestop_product_reviews.csv, contains customer reviews of products sold by GameStop, such as games and consoles.

The aim of Question 1 is to carry out text analytics and sentiment analysis on the McDonald’s reviews, following the same tidytext approach used in class. I explore word frequencies, sentiment using the bing and nrc dictionaries, n-grams (bigrams and trigrams), and specific phrases related to the customer experience. The aim of Question 2 is to apply topic modelling using the LDA algorithm to the GameStop reviews in order to discover common themes and suggest practical actions for digital marketing and product management.

1.0.1 Throughout the report, I use:

  • tidyverse for data manipulation and plotting,

  • tidytext for tokenising and sentiment analysis,

  • kableExtra to format tables,

  • topicmodels for LDA topic modelling,

  • wordcloud to visualise frequent positive and negative words.

2 Part 1 - McDonald’s reviews

2.1 1.1 Top 20 frequent words

mcd_words <- mcd %>%
  unnest_tokens(word, review_text, token = "words") %>%
  anti_join(stop_words, by = "word")

mcd_word_counts <- mcd_words %>%
  count(word, sort = TRUE)

top20_words <- mcd_word_counts %>%
  slice_max(n, n = 20)

top20_words
# A tibble: 20 × 2
   word           n
   <chr>      <int>
 1 food         866
 2 mcdonald's   812
 3 drive        691
 4 mcdonalds    575
 5 time         522
 6 service      519
 7 location     381
 8 people       346
 9 fries        307
10 minutes      259
11 coffee       258
12 window       247
13 fast         232
14 line         225
15 2            218
16 manager      218
17 worst        215
18 staff        210
19 times        201
20 customer     186
#Bar chart of top 20 words#
ggplot(top20_words, aes(x = reorder(word, n), y = n)) +
  geom_col(fill = "darkseagreen3") +
  coord_flip() +
  labs(title = "Top 20 Most Frequent Words in McDonald's Reviews", x = "Word", y = "Count")

The table and bar chart show the 20 most frequent words used in the McDonald’s reviews after removing stop words. Most of the words relate to food, service and time, which confirms that customers mainly talk about the quality of their meals and how they are treated or how long they have to wait.

2.2 1.2 Bing sentiment (positive & negative words)

#Bing sentiment join#
bing <- get_sentiments("bing")

mcd_bing <- mcd_words %>%
  inner_join(bing, by = "word")

bing_counts <- mcd_bing %>%
  count(sentiment, word, sort = TRUE)

top_pos <- bing_counts %>%
  filter(sentiment == "positive") %>%
  slice_max(n, n = 10)

top_neg <- bing_counts %>%
  filter(sentiment == "negative") %>%
  slice_max(n, n = 10)

top_pos
# A tibble: 10 × 3
   sentiment word         n
   <chr>     <chr>    <int>
 1 positive  fast       232
 2 positive  pretty     146
 3 positive  hot        132
 4 positive  nice       132
 5 positive  clean      110
 6 positive  friendly    99
 7 positive  sweet       86
 8 positive  love        71
 9 positive  fresh       69
10 positive  free        64
top_neg
# A tibble: 10 × 3
   sentiment word         n
   <chr>     <chr>    <int>
 1 negative  worst      215
 2 negative  bad        185
 3 negative  wrong      179
 4 negative  slow       137
 5 negative  rude       120
 6 negative  cold       113
 7 negative  horrible    81
 8 negative  dirty       71
 9 negative  hard        66
10 negative  terrible    60
#Positive / negative word bar charts#
p_pos <- ggplot(top_pos, aes(x = reorder(word, n), y = n)) +
  geom_col(fill = "darkseagreen1") +
  coord_flip() +
  labs(title = "Top 10 Positive Words (bing)", x = "Word", y = "Count")

p_neg <- ggplot(top_neg, aes(x = reorder(word, n), y = n)) +
  geom_col(fill = "dodgerblue") +
  coord_flip() +
  labs(title = "Top 10 Negative Words (bing)", x = "Word", y = "Count")

p_pos + p_neg

These two charts highlight which words are most strongly associated with positive and negative sentiment. Positive words such as “good”, “friendly” and “love” reflect satisfied customers, while negative words like “bad”, “rude” or “cold” show the main complaints. This makes it easy to see the language customers use when they are happy versus when they are disappointed.

2.3 1.3 Positive & negative sentiment over blocks of 150 reviews

Here I follow the style from class where we group reviews into blocks to approximate sentiment changes over time.

#Sentiment counts per block of 150 reviews#
mcd_sent_blocks <- mcd %>%
  unnest_tokens(word, review_text, token = "words") %>%
  anti_join(stop_words, by = "word") %>%
  inner_join(bing, by = "word") %>%
  mutate(block = (review_id - 1) %/% 150 + 1) %>%
  count(block, sentiment)

mcd_sent_blocks
# A tibble: 22 × 3
   block sentiment     n
   <dbl> <chr>     <int>
 1     1 negative    449
 2     1 positive    276
 3     2 negative    527
 4     2 positive    316
 5     3 negative    411
 6     3 positive    318
 7     4 negative    420
 8     4 positive    285
 9     5 negative    407
10     5 positive    288
# ℹ 12 more rows
#Plot sentiment over blocks#
ggplot(mcd_sent_blocks, aes(x = block, y = n, fill = sentiment)) +
  geom_col(show.legend = TRUE) +
  facet_wrap(~ sentiment, nrow = 1) +
  labs(title = "Positive and Negative Sentiment Over Blocks of 150 Reviews", x = "Block index", y = "Count of sentiment words")

The block chart shows how the number of positive and negative words changes across groups of 150 reviews. Both types of sentiment appear in every block, and although the counts rise and fall slightly, there are no extreme spikes. This suggests that customer satisfaction is mixed but fairly stable across the whole set of reviews

2.4 1.4 NRC sentiment categories

#NRC dictionary#
nrc <- get_sentiments("nrc")

mcd_nrc <- mcd_words %>%
  inner_join(nrc, by = "word")

sentiment_freq <- mcd_nrc %>%
  count(sentiment, sort = TRUE)

sentiment_freq
# A tibble: 10 × 2
   sentiment        n
   <chr>        <int>
 1 positive      5896
 2 negative      4245
 3 trust         3526
 4 anticipation  2978
 5 joy           2820
 6 fear          1910
 7 anger         1902
 8 sadness       1760
 9 disgust       1672
10 surprise      1126
#Bar chart of NRC sentiments
ggplot(sentiment_freq, aes(x = reorder(sentiment, n), y = n)) +
  geom_col(fill = "darkslategray3") +
  coord_flip() +
  labs(title = "NRC Sentiments in McDonald's Reviews", x = "Sentiment", y = "Count")

The NRC bar chart breaks the reviews into 10 different emotions such as joy, trust, anger and disgust. Emotions like joy and trust tend to be more common, but there are still noticeable levels of anger and disgust, which come from strongly negative experiences. Overall, this confirms that McDonald’s reviews contain a blend of positive and negative feelings rather than being one-sided.

2.4.1 Top 10 words for each NRC sentiment

#Top 10 words for each NRC sentiment#
nrc_word_counts <- mcd_nrc %>%
  count(sentiment, word, sort = TRUE)

top10_nrc <- nrc_word_counts %>%
  group_by(sentiment) %>%
  slice_max(n, n = 10) %>%
  ungroup()

top10_nrc
# A tibble: 101 × 3
   sentiment word           n
   <chr>     <chr>      <int>
 1 anger     bad          185
 2 anger     hot          132
 3 anger     money         82
 4 anger     horrible      81
 5 anger     homeless      64
 6 anger     terrible      60
 7 anger     grab          54
 8 anger     cash          53
 9 anger     hate          50
10 anger     disgusting    37
# ℹ 91 more rows
ggplot(top10_nrc, aes(x = reorder_within(word, n, sentiment), y = n, fill = sentiment)) +
  geom_col(show.legend = FALSE) +
  coord_flip() +
  scale_x_reordered() +
  facet_wrap(~ sentiment, scales = "free_y") +
  labs(title = "Top 10 Words for Each NRC Sentiment", x = "Word", y = "Count")

The plot of the top 10 words per NRC sentiment shows which specific terms drive each emotion. For example, positive emotions like joy and trust are linked to words about tasty food or friendly staff, while anger and disgust are associated with words describing poor service or bad food quality. This helps connect abstract emotions to concrete aspects of the customer experience

2.5 1.5 Top 20 bigrams

#Biagrams#
mcd_bigrams <- mcd %>%
  unnest_tokens(bigram, review_text, token = "ngrams", n = 2)

bigrams_sep <- mcd_bigrams %>%
  separate(bigram, into = c("word1", "word2"), sep = " ")

bigrams_filtered <- bigrams_sep %>%
  filter(!word1 %in% stop_words$word, !word2 %in% stop_words$word)

top20_bigrams <- bigrams_filtered %>%
  count(word1, word2, sort = TRUE) %>%
  unite(bigram, word1, word2, sep = " ") %>%
  slice_max(n, n = 20)

top20_bigrams
# A tibble: 20 × 2
   bigram               n
   <chr>            <int>
 1 fast food          153
 2 customer service   116
 3 ice cream           61
 4 worst mcdonalds     52
 5 10 minutes          49
 6 parking lot         43
 7 worst mcdonald's    42
 8 15 minutes          39
 9 chicken nuggets     38
10 french fries        34
11 mickey d's          33
12 20 minutes          32
13 5 minutes           29
14 iced coffee         29
15 dollar menu         28
16 late night          28
17 sweet tea           27
18 24 hours            25
19 chicken sandwich    23
20 quarter pounder     23
#Bigram bar chart#
ggplot(top20_bigrams, aes(x = reorder(bigram, n), y = n)) +
  geom_col(fill = "lightseagreen") +
  coord_flip() +
  labs(title = "Top 20 Bigrams in McDonald's Reviews", x = "Bigram", y = "Count")

The bigram chart displays the most frequent two-word combinations in the reviews. These phrases give more context than single words, for example combining menu items with adjectives or linking service words with time or quality. This helps identify recurring patterns such as particular items that are often praised or complaints that appear together.

2.6 1.6 Top 20 trigrams

#Trigrams#
mcd_trigrams <- mcd %>%
  unnest_tokens(trigram, review_text, token = "ngrams", n = 3)

trigrams_sep <- mcd_trigrams %>%
  separate(trigram, into = c("word1", "word2", "word3"), sep = " ")

trigrams_filtered <- trigrams_sep %>%
  filter(!word1 %in% stop_words$word, !word2 %in% stop_words$word, !word3 %in% stop_words$word)

top20_trigrams <- trigrams_filtered %>%
  count(word1, word2, word3, sort = TRUE) %>%
  unite(trigram, word1, word2, word3, sep = " ") %>%
  slice_max(n, n = 20)

top20_trigrams
# A tibble: 26 × 2
   trigram                       n
   <chr>                     <int>
 1 ice cream machine            10
 2 worst customer service       10
 3 24 hour drive                 9
 4 eat fast food                 8
 5 fast food restaurants         8
 6 ice cream cone                8
 7 10 piece chicken              7
 8 fast food restaurant          7
 9 sausage egg mcmuffin          7
10 terrible customer service     7
# ℹ 16 more rows
#Trigram bar chart#
ggplot(top20_trigrams, aes(x = reorder(trigram, n), y = n)) +
  geom_col(fill = "seagreen3") +
  coord_flip() +
  labs(title = "Top 20 Trigrams in McDonald's Reviews", x = "Trigram", y = "Count")

The trigram chart shows common three-word phrases that appear in the reviews. These longer phrases capture more detailed expressions used by customers, such as how they describe specific problems or very positive experiences. They provide richer insight into how customers talk about McDonald’s in their own words.

2.7 1.7 Reviews containing specific phrases

2.7.1 Reviews mentioning “waiting”

#Reviews mentioning "waiting"#
waiting_reviews <- mcd %>%
  filter(str_detect(review_text, regex("waiting", ignore_case = TRUE)))

write_csv(waiting_reviews, "waiting_reviews.csv")

head(waiting_reviews$review_text, 10)
 [1] "Terrible customer service. I came in at 9:30pm and stood in front of the register and no one bothered to say anything or help me for 5 minutes. There was no one else waiting for their food inside either, just outside at the window.  I left and went to Chickfila next door and was greeted before I was all the way inside. This McDonalds is also dirty, the floor was covered with dropped food. Obviously filled with surly and unhappy workers."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
 [2] "First they \"lost\" my order, actually they gave it to someone one else than took 20 minutes to figure out why I was still waiting for my order.They after I was asked what I needed I replied, \"my order\".They asked for my ticket and the asst mgr looked at the ticket then incompletely filled it.I had to ask her to check to see if she filled it correctly.She acted as if she couldn't be bothered with that so I asked her again.She begrudgingly checked to she did in fact miss something on the ticket.So after 22 minutes I finally had my breakfast biscuit platter.As I left an woman approached and identified herself as the manager, she was dressed as if she had just awoken in an old t-shirt and sweat pants.She said she had heard what happened and said she'd take care of it.Well why didn't she intervene when she saw I was growing annoyed with the incompetence?"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
 [3] "One Star and I'm beng kind. I blame management. last day of free coffee so \"we\" decide to stop and order breakfast and coffees thru drive-thru. She charged us for coffee and when asked why she said she needed to confirm there were two of us in the car. Now she has to clear the order and that took retraining. Ask next time at tthe speaker.Oh it gets better....We get to next window where Einstein is waiting, pours the coffees with different creams/sugars added. \"Which one is which?\" I asked... and he smiled and said \"One has 2 cream 2 sugar and the other has 3 cream 1 sugar\".. didnt maek the cups... but at least he made sure we had straws for our coffees.... Hello? management? Where are You?"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
 [4] "Never been upset about any fast food drive thru service till I came to this McDonalds.After a long trip from California my wife and I went to McDonalds for a quick bite to eat before our drive back home. We pull up to the drive thru but there are a lot of cars waiting to order. We were guessing there must be a lot demand for McDonalds at this late hour. So we wait about 5 - 10 minutes for our turn to order. We order the specials they were having at that time (20 pcs chicken nuggets for $5) and asked for a cup of water because we didn't want to drink any sodas at that late hour. They take our order but tells us they don't serve cups of water there. So we are a little annoyed but ok we shrug it off and wait our turn to pay and receive our order. However, we wait for almost another 10 min to finally pay at the first window - then another 5 more min to finally receive our food. By far the worst McDonalds in the world. Unfriendly and slow."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 [5] "GHETTO!! went in yesterday just to get a soda and could not even park in handicap parking spot because their delivery truck was blocking all spaces. Finally made it inside and it was about 5 customers to one cashier. The shift manager made the comment that the car that was waiting needed to be pulled up because they are holding up her line. Now how is that when they are waiting on their order...hell I was thinking you are holding up the customer and the others waiting.! Anyway finally placed order and was told $1.07, which I paid exact price. Here is where its sad...the cashier did not ring up the soda so therefore I did not get a receipt. I know that she planned to pocket the money, which is sad and bad because eventually that cost will get passed off to customers through price increases. I will not return here because I don't like to feel like I am in someone's \"hood\" and I HATE A THIEF!!! maybe I will call to tell them but then again they probably don't care or maybe even steal themselves. plus I do not eat fast food anyway so no need to waste precious minutes"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 [6] "It had been a while since I had stopped at this particular one. They have done a total remodel and it looks fairly fresh. Stopped by about 10-11pm and went through drive thru. I thought I'd try a new McWrap. Got a fry and a spicy chick along with that.  I was asked to pull up after sitting at the window for a few minutes and they would bring me my order. That is fine, except about 15 minutes later I'm still waiting. So I go to check what is going on and end up waiting another 5 minutes.  It appeared I wasn't the only one that had a long wait in drive thru as well.  McWrap - I was disappointed. Looked like a wrap that had grilled chicken sprinkle with some mixed greens, then had sweet and sour sauce dumped in it."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 [7] "TOXIC DUMP! In food quality and employee humanity/work effortTypically, I do NOT eat McDonalds food; yet similar to the experience of others \"trapped\" at Northside Hospital there is no other option if you are hungry outside of the hospital cafeteria hours of operation. Due to a relatives stay and my visits/overnights for 11 weeks~ I too found myself \"trapped\" and therefore forced to buy at McDonalds. Mostly my visits were for coffee or ice cream sundaes. However, last night, for the first time I ordered food (grilled chicken salad) I returned it ~ the meat smelled BADLY. This did not surprise me and only enforced my resolve to avoid chain food restaurants.What did surprise me and absolutely SHOCKED me was the customer service offered by employees ~ HOW in the world can you BE an employee here and NOT for ONE MINUTE or even a second acknowledge the obvious FACT that you work inside a HOSPITAL; then consider what that means for each and every person that approaches your counter to order. HOW you do not SEE them, in FACT that you easily DISMISS them, is beyond my comprehension to understand! HOW you lost your sense of humanity, in all honestly should cause you to pause and contemplate this ~ Are you not aware that you are reflecting how YOU measure within YOU your own sense of dignity?Within my and family/friends of patient at Northside Hospital for the past 11 weeks: each and every time I/they had to place an order I /they was/were subjected to McDonalds toxic business model (in food) which now has transferred (we learned) into their employees. NOT once was I thanked for giving my order; NOT ONCE was I thanked when delivered my order. Yet, at EVERY visit I WAITED and witnessed employee behaviors that were readily displayed and relayed in body language, effort toward actual work, and obvious attitude not only toward me, but guests in front of me. God forbid I happened to have question in reference to the menu (employee response: blank stare, shrug, looking behind them at menu only to turn back around with a blank stare and/or shrug again). God forbid, on separate occasions I happened to ask for a spoon/napkin/straw. Last night, I happened to ask for my drink please (after receiving my salad and waiting for longer than normal) YIKES, you think I had asked him to draw blood!***One more detail regardless if I arrive at 2am, 4am or between 7:30 pm ~ 11 pm this McDonalds is ALWAYS consistently FILTHY! Not just dirty, but FILTHY!Can anyone lift a broom to sweep up the garbage in the service/cooking area; also in the dining room?Can anyone clean the crud surrounding the plastic display case for cookies ALREADY? It's been 11 weeks and that crud is STILL smeared dried; just gross.Wash/disinfect the countertops, payment pads, straw holders, everywhere spills occur; including areas customers touch. EVERY HOUR! Get it? Every single hour! GET a cleaning ONLY employee! This employee will do NOTHING but be THE OCD employee you NEED! Just stop this ATROCIOUSLY DIRTY & DISGUSTING feeding trough you call a restaurant. You should be ashamed.**************************************************\xce_**************************************Northside Hospital ~ YOU are responsible for allowing this restaurant to wallow within your walls! How many more years will you ignore not only the unhealthy food options McDonalds supplies~ but to continue to ALLOW a daily dose of DELIBERATE and DILIGENT unhealthy, negative, and \"put upon\" attitudes from employees, to be delivered to family, friends and employees that are there only because they CARE and are there for YOUR patients! HOW this does NOT cause you to react and ACT is beyond me.In my world, with SO MANY options available, this place would be GONE ~ like TODAY; certainly NOT any longer than tomorrow!This toxic waste site is dumping daily doses of negativity, inhumanity~ its seeping and reverberating within the walls of this hospital. I know you FEEL IT!"
 [8] "Sometimes, you just need a Mickey D's fix. Usually, for me anyway, that \"sometime\" is very late at night - er, early in the morning, depending on how you want to slice it.24-hour drive thru - check. Fries still made fresh at all hours - check, check. A double cheeseburger for a steal ($1) and a Coke to go with. CHECK! Yep, all your drive-thru goody/bad-ness waiting for you.Yum."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
 [9] "On my way to Curry Honda for my scheduled maintenance appointment, I went to the drive-thru of this McDonald's since it was so conveniently located almost adjacent to the Honda dealership. It was around 1:45 pm on a Saturday afternoon, and there were probably only two cars in front of me, so I thought I'd be in and out of there quickly. What I thought would be a \"quick\" drive-thru took over ten minutes. I'm not sure what the hold up was, but perhaps one (or both) of the cars in front of me got a large order. All I ordered was a Spicy McChicken Sandwich, small fries, and a cup of ice water.Again, Curry Honda is located super close to the McDonald's, so the food should have still been hot (or at least warm) when I got there. However, when I sat down to eat my food in the waiting room, I noticed the sandwich and fries were barely warm, and the ice in my water was almost completely melted. I guess the food had been cooked and sitting out for a while, and they must keep cups of ice water ready to hand out to customers. Boo. It was my first time trying the Spicy McChicken Sandwich, and I thought it was decent. It has a very slight kick of spice and is at least a little more interesting than the plain ol' McChicken Sandwich.Overall, this McDonald's gets 3 stars for being \"OK.\" Yes, service could have been quicker, and the food should have been served hotter, but this is a McDonald's and at least the employees were friendly. I may return to this McDonald's if I'm on my way to Curry Honda and didn't have time to grab food elsewhere, but it wouldn't be my top choice for fast food in the area.[Review 324 of 366]"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
[10] "I purchased a specialty coffee in the drive through, but soon after I pulled out and away I realized I had been given a black coffee for the price of $3. Mistakes happen so I kept my receipt and went back exactly a week later within the hour, since I was making the same trip. I went inside, out of respect to show my face that I wasn't trying to scam them, and the manager was working the register. I told him what happened and that I'd like the specialty coffee I originally ordered. He pointed that it had been a week since the original purchase and that he needed proof I wasn't lying about my incorrect order. Mind you, at 6:30am 6 people were all waiting around for their order, which shows slow and poor service. I didn't argue and I walked away leaving my receipt on the counter. I was simply asking for a coffee, not even an entire meal. I don't post about these sort of things, but this time was different. The manager could have easily offered a variety of resolutions, but all he said was \"no I'm sorry\". Well, I'm sorry, but I've never been so dissatisfied with customer service and let alone management of a restaurant! Please stay away from this location for the sake of your pockets and your sanity."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

The extracted “waiting” reviews mostly describe long delays for food, slow service at the counter or drive-thru, and frustration about having to wait even when the restaurant is not busy. This suggests that waiting time is a key pain point for some customers and can strongly affect their overall impression of the visit.

2.7.2 Reviews mentioning “shamrock shake”

#Reviews mentioning "shamrock shake"#
shamrock_reviews <- mcd %>%
  filter(str_detect(review_text, regex("shamrock shake", ignore_case = TRUE)))

write_csv(shamrock_reviews, "shamrock_shake_reviews.csv")

head(shamrock_reviews$review_text, 10)
 [1] "I left the Hilton late last night and I was really thirsty. This was an easy in/out option for me from Sahara. I did the drive through and was on my way with a Diet Coke in about 2 minutes.This is one of the remaining early style McDonald's outlets and there's a classic Chevrolet parallel to the drive through where you can take photos.Looking through the windows, I could see the interior is also the classic design. I'll have to go back and sit inside. Do I see a Shamrock shake in my near future?"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
 [2] "I stop here now and then as it's the closest to where I live. Customer service used to be awful, but ti seems like they've gotten a bit better. Today I got a side salad and a shamrock shake. Everything was A-OK!"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 [3] "I have to tell you it's been 2 years since I've been at a McDonalds and all I got was a Coffee Frap, it was gross, felt greasy in my mouth...like their food. Which I haven't eaten in probably 4 years and regretted it then. It's so gross!Haven't had a Shamrock Shake in years...it's that time of year and wanted to give it a shot. Used the drive thru, there was hardly a wait. Staff was pleasant but the stench of moth balls was unbearable when they opened the drive up window. Yuk! Thankfully the shake didn't taste like the smell of the store. Not really minty, it was okay, nothing special. I'm over the Shamrock shake. Lets see how long it'll be this time till I make it to another McDonalds."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
 [4] "Worst shamrock shake ever. The new shakes are brutal. They didn't even do a good job of mixing in the mint stuff with the regular shake. The result was a chalky mix with only small pockets of mint. Ended up tossing it out after a few sips. No comment on the rest of the food here - in the past it has been average. Have to agree that this location has turned into a homeless-hangout meets tourist pits-stop. If you are neither homeless or from outside of Cook County, then you should find another spot."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 [5] "This is probably the worst McDonald's ever. It doesn't matter what time of day I go, how many people are waiting in line, or how little I order, I ALWAYS end up spending at least 10 to 15 minutes waiting for my order. This is \"not so fast\" fast food! Some of my favorite visits include: - One person at the registers while the entire lobby started filling up with people. It's been about 25 years since I worked in fast food, but if memory serves me, when you have that many people you're supposed to open another register! Finally a worker who was just standing at the fry station doing nothing asked the manager if he can open another register. - Waiting 25 minutes for an iced coffee during a non-rush time. (Similarly, waiting 25 minutes for an ice cream cone on another occasion.) - Asking for a Shamrock shake and being told they ran out, only to see two be made and delivered to the customers right in front of me. I hate that this is the closest McDonald's to me and I have no choice but to go here. Get your shit together, Logan Square McDonald's, or the scary clown might get you!"                                                                                                                                                                                                                                                                                                                                           
 [6] "THIS REVIEW IS FOR THE SHAMROCK SHAKE ONLYIt's brighter green than I remember. An extremely unnatural shade of green that doesn't occur normally in nature. For as unnatural the color is, the flavor is just as fake. I don't think there is any actual mint or dairy in these things. I think they are petroluem-based.Does it taste different than it used to? Definitely. A few years ago, McD's did the unthinkable. They ditched their old shake recipes for a new faster/cheaper/easier shake \"system\". Basically, a neutral vanilla shake comes out and different flavored syrups are mixed in at the last minute. The result is a sub-par product. Syrupy and too sweet. It's not even mixed when it comes out. It's like those thousand-flavor ice cream joints that do the flavor syrups. YUKIs the Shamrock Shake disgusting? YESDo I kind of love it? YESThe shakes don't taste TOO horribly different. They are similar enough to the old recipe to still be OK in my book. Do I feel dirty for eating one? YESDo I now want to vomit? YESWould I recommend the Shamrock Shake to the casual observer? TOTALLY"                                                                                                                                                                                                                                                                                                                                                 
 [7] "Went here on March 10th, and there NO Shamrock Shakes. They weren't sold out. The employees just had NO idea what I was talking about. SHAMROCK SHAKES! A St. Paddy's Day institution, and I receive a silent voice on the other end of the intercom.I already never go to McDonald's but considering they could not satisfy my ONE craving for a SINGLE Mickey D's item = Absolute FAIL."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
 [8] "What is a Shamrock Shake? It's a seasonal shake (milk?) by McDonald's with green food coloring thrown in designed to exploit another made up holiday, St. Patty's day. You can tell it's fake as crap because the food coloring they throw in doesn't blend well. Parts of the shake will be a deep shade of green and then rivers of white will intertwine with lighter shades of green. This is your first warning : there is nothing natural about this drink, proceed at your own risk. In the name of Yelp, I purchased a shamrock shake to review. What does it taste like? At first... not bad actually. Like a melted down Andes Mint, cooled and thrown into a shake. It doesn't quite taste like a milkshake, it just tastes like a chocolate mint melted down.This is good for awhile... until you reach the halfway point and you're disgusted and want no part of the shake. Not sure if it was just overkill for me, or if its the shake in general. Worth a try, bu nothing to call home about."                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
 [9] "I can't comment on the food because when I went to grab a Shamrock Shake for a little late night treat, they were closed. An hour before the posted sign on the door said they were supposed to be closed. Not impressed."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
[10] "I don't really eat fast food, let alone Yelp about it. I haven't eaten at McDonald's in years. I should've known that agreeing to indulge in a friend's Quarter Pounder craving would end badly. But visions of Chicken McNuggets and that elusive Shamrock Shake started dancing in my head, and I relented.On our way there, we keep hearing ads for the new Chipotle BBQ Angus burger, and since that almost sounds kinda good, I decided to give it a shot. My friend gets the Quarter Pounder. We decide to share a little thing of McNuggets. All's well when we place our order.Then we pull up to the drive-thru, and they're doing something to the awning. Like tearing it off, which involves 2 people, a ladder, and complete blockage of access to the drive-thru window. So now the ladder-assist woman is our intermediary for the drive through window. Weird, but it worked, I guess. A quick check of the bag reveals that they didn't outright forget to put anything in our bag.Back at the abode, I'm ready to dive into my burger. I open the box. Hmm...looks a little thin for a burger. I open the bun. Oh, that's why. They didn't put the burger on my burger!! Just the cheese, pickles, bacon, onions and BBQ sauce. Are you frickin' kidding me?! No excuses, McDonald's. No excuses.And the fries were undercooked and soggy. And they didn't have the Shamrock Shake. If I ever find myself back at this McDonald's it will be against my will."

Reviews that mention “shamrock shake” often focus on the taste and availability of this item. Some customers are very positive and treat it as a favourite seasonal product, while others complain when it is unavailable or not made correctly. This shows that special menu items can generate both enthusiasm and disappointment.

2.7.3 Reviews mentioning “ice cream machine”

#Reviews mentioning "ice cream machine"#
icecream_reviews <- mcd %>%
  filter(str_detect(review_text, regex("ice cream machine", ignore_case = TRUE)))

write_csv(icecream_reviews, "ice_cream_machine_reviews.csv")

head(icecream_reviews$review_text, 10)
[1] "The ice cream machine is always \"down\" after 11 p.m. If you want a hot fudge sundae, don't even bother."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
[2] "Ice cream machine is always down, staff is rude and ghetto, food is always old. Hate this McDonalds. I always try to avoid it and go to a different one."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
[3] "This is the worst McDonald's I have ever been to.Yes, there ARE better McD's out there. Like the one on Boulder Highway by Joker's Wild, right before you hit Warm Springs.I have visited the last two nights here....Because I was picking up a friend of mine who got off from work, and we had a sweet tooth.....along with my family members at the house.Yesterday, we pull up and ask for hot fudge sundaes. Ice cream machine is out.Instead, we get two large sweet teas.....Which were overly sweet. Almost...gave off a syrup feel after I swallowed.Tonight, the ice cream machine IS working, so I get two sundaes, and of course, two large sweet teas.Sundaes look sad, because they are not in their proper clear plastic cup...they are instead in mini McFlurry cups....(not even filled completely, might I add.)My friend and I take one sip of our sweet teas....and they taste like dirty water.It's almost like they were trying to trick us.....Like, they didn't have enough tea, so they filled 3/4 of the cup with water.... Seriously, if I wanted the taste of unfiltered water, I would just pick up a hose out of someone's back yard. The women who work here, hate their lives. I mean, they are just wretched.One of the cars parked by the drive thru was.....vandalized with shaving cream, and what appeared to be eggs... Can't say I blame the perpitrator when these ladies can't even pour a glass of tea. .....I don't condone it, but hey, some people are crazy about their food."                                                                                                                                                                                                                                                                                                                                
[4] "Every time I go their ice cream machine is down. It's a hang out for all the kids in the neighborhood. This establishment including terribles chevron connected to it, does not seem to care what goes on in or around their business. Low class for the area they are in."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
[5] "This place is a joke! It's disgusting enough of a fact that the only thing to eat at Excalibur between the hours of 0200 and 0600 is McDonald's, Starbucks, and Krispy Kreme. But then, to be forced to go to McDonald's and find this pitiful excuse of an establishment instead.... for shame. The first night they ran out of Butterfinger topping for a McFlurry. The second night, they claimed their ice cream machine was \"locked.\" Not broken.... but locked. WTF is that?!?! If you are the only late night eatery available, you better have all your menu items available because I have a bit of a sweet tooth. This place is a joke... do yourself a favor and walk across the footbridge to New York New York and eat at America, their late night cafe."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
[6] "This is probably the worst McDonald's ever.. They don't know what they're doing at all! Ice cream machine is always \"broken\", customers always waiting, food always takes forever even with 3+ people in the kitchen... I don't understand why they're still open."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
[7] "Couldn't get a chocolate-dipped cone because they shut off the ice cream machine at midnight. WTF?!"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
[8] "This is the McDonald's that my friends and I always go to since it's the closest to our apartment but at the same time, it's definitely the WORST one I've ever been to.One plus is that their drive-thru is open 24 hours but sadly, the later at night you go, the more often your choices are limited. For example, one day we were craving their vanilla cone but they said that their ice cream machine was off already so they couldn't make it! Okay. What's the point of staying open 24 hours if you can't even give the customers the food they want?!The other day, I had a pretty bad dine-in experience. The lady behind the counter charged extra for big mac sauce on the McDouble which I have NEVER experienced before. Usually going through drive-thru, they never charge extra for a McDouble w/o the ketchup, w/ big mac sauce and shredded lettuce (a.k.a a Big Mac, but cheaper!). My boyfriend and I were pretty shocked when she told us we had to pay extra for the sauce and she claimed that they always do this which they really NEVER DO!!Then, this same lady proceeded to close the cash register before giving me my change! She told me to wait on the side so she can give it to me after she opens it for the next customer. So I patiently waited... and then she closed the cash register AGAIN after the next customer and totally forgot to give me my change!!!! So I had to remind her again to which she just laughed and semi-apologized and then finally gave me my change after like a decade of waiting! ARGH! Worst McDonalds worker ever!! Completely rude and horrible customer service skills! I totally agree with my boyfriend who said this McDonalds is very poorly managed. He even wrote a complaint to them a while back but they never responded. \"We love to see you smile?\" I beg to differ."
[9] "I have never in my life wrote a corporation to complain about the business until this McDonalds. I am there everyday with the same coffee order and everyday they get it wrong. You would think after going there everyday for months you would think they would know the order by now but apparently they are stoned or something. Also, more than once I have attempted to order ice cream after nine at night and they tell me the 'ice cream machine is broken' because they are too lazy to fill it up. It is a credit to the McDonald's corporation that they actually responded to the complaint letter and said they would fix it-the next day still the wrong coffee order."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

The “ice cream machine” reviews frequently mention that the machine is broken or out of order. Customers express frustration when they cannot buy ice cream or related desserts, especially if this happens repeatedly. This indicates a recurring operational issue that can damage customer satisfaction and trust.

2.8 1.8 Positive and negative word clouds

#Counts of positive/negative words#
bing_word_counts <- mcd_bing %>%
  count(sentiment, word, sort = TRUE)

positive_wc <- bing_word_counts %>%
  filter(sentiment == "positive", n >= 50)

negative_wc <- bing_word_counts %>%
  filter(sentiment == "negative", n >= 50)

#Positive word cloud#
set.seed(1234)
wordcloud(words = positive_wc$word, freq = positive_wc$n, min.freq = 1, random.order = FALSE, colors = brewer.pal(8, "Greens"))

#Negative word cloud#
set.seed(1234)
wordcloud(words = negative_wc$word, freq = negative_wc$n, min.freq = 1, random.order = FALSE, colors = brewer.pal(8, "Reds"))

The positive word cloud highlights the most frequently used positive words, emphasising what customers like most about McDonald’s. The negative word cloud shows the most common negative terms, drawing attention to recurring problems. Together, they provide a quick visual summary of the main strengths and weaknesses mentioned in the reviews.

3 Part 2 - GameStop Topic Modelling

3.1 2.1 Data preparation and Document-Term Matrix

gs_words <- gamestop %>%
  unnest_tokens(word, review_text, token = "words") %>%
  anti_join(stop_words, by = "word")

#Word counts per review#
gs_word_counts <- gs_words %>%
  count(doc_id, word, sort = TRUE)

gs_word_counts
# A tibble: 67,672 × 3
   doc_id word        n
    <int> <chr>   <int>
 1   3009 game       18
 2    208 game       15
 3   2076 pokemon    15
 4   2106 pokemon    14
 5   4611 game       14
 6   2976 doom       13
 7   4462 game       13
 8   4645 game       13
 9   2097 game       12
10   2167 pokemon    12
# ℹ 67,662 more rows
#Document-Term Matrix#
gs_dtm <- gs_word_counts %>%
  cast_dtm(document = doc_id, term = word, value = n)

gs_dtm
<<DocumentTermMatrix (documents: 4682, terms: 9604)>>
Non-/sparse entries: 67672/44898256
Sparsity           : 100%
Maximal term length: 27
Weighting          : term frequency (tf)

The tokenised word counts and the document–term matrix prepare the GameStop reviews for topic modelling. Each review is converted into a bag-of-words representation that records how many times each word appears. This step is essential because the LDA algorithm works on this matrix rather than on raw text.

3.2 2.2 Fit LDA model (k = 10, Gibbs, seed 1234)

set.seed(1234)
k <- 10

lda_model <- LDA(gs_dtm, k = k, method = "Gibbs", control = list(seed = 1234))

lda_model
A LDA_Gibbs topic model with 10 topics.

The LDA model with 10 topics splits the GameStop reviews into underlying themes based on how words co-occur. Each topic represents a cluster of words that tend to appear together in similar reviews. This allows us to summarise thousands of reviews using a small number of interpretable topics.

3.3 2.3 Top 10 terms per topic

#Tidy LDA output (beta)#
lda_beta <- tidy(lda_model, matrix = "beta")

top_terms <- lda_beta %>%
  group_by(topic) %>%
  slice_max(beta, n = 10) %>%
  ungroup() %>%
  arrange(topic, desc(beta))

top_terms
# A tibble: 100 × 3
   topic term        beta
   <int> <chr>      <dbl>
 1     1 monitor   0.0507
 2     1 gaming    0.0382
 3     1 love      0.0269
 4     1 quality   0.0250
 5     1 perfect   0.0241
 6     1 amazing   0.0211
 7     1 screen    0.0189
 8     1 watch     0.0183
 9     1 easy      0.0150
10     1 beautiful 0.0120
# ℹ 90 more rows
#Plot top terms per topic#
ggplot(top_terms, aes(x = reorder_within(term, beta, topic), y = beta, fill = factor(topic))) +
  geom_col(show.legend = FALSE) +
  coord_flip() +
  scale_x_reordered() +
  facet_wrap(~ topic, scales = "free_y") +
  labs(title = "Top 10 Terms for Each Topic (GameStop Reviews)", x = "Term", y = "Beta (topic-term probability)")

The facetted bar chart of top terms per topic shows the most important words for each of the 10 topics. By reading these word lists, we can interpret each topic as a particular theme, such as product quality, delivery issues, pricing, customer service or technical performance. This helps translate abstract topics into concrete business areas.

3.4 2.4 Simple topic quality summary

#Document-topic probabilities (gamma)#
lda_gamma <- tidy(lda_model, matrix = "gamma")

topic_size <- lda_gamma %>%
  group_by(topic) %>%
  summarise(topic_size = sum(gamma))

#Mean token length (weighted by beta)#
token_stats <- lda_beta %>%
  mutate(term_length = nchar(term)) %>%
  group_by(topic) %>%
  summarise(mean_token_length = sum(beta * term_length))

#Exclusivity#
term_totals <- lda_beta %>%
  group_by(term) %>%
  summarise(beta_sum = sum(beta))

lda_excl <- lda_beta %>%
  left_join(term_totals, by = "term") %>%
  mutate(exclusivity = beta / beta_sum)

topic_excl <- lda_excl %>%
  group_by(topic) %>%
  summarise(mean_exclusivity = mean(exclusivity))

#Simple coherence#
topic_coh <- lda_beta %>%
  group_by(topic) %>%
  summarise(coherence = sum(beta * log(beta + 1e-12)))

topic_quality <- topic_size %>%
  left_join(token_stats, by = "topic") %>%
  left_join(topic_excl, by = "topic") %>%
  left_join(topic_coh, by = "topic") %>%
  arrange(desc(topic_size))

topic_quality
# A tibble: 10 × 5
   topic topic_size mean_token_length mean_exclusivity coherence
   <int>      <dbl>             <dbl>            <dbl>     <dbl>
 1     3       481.              6.54           0.0859     -5.85
 2     5       471.              6.03           0.0924     -6.00
 3     1       470.              6.31           0.102      -6.43
 4     9       469.              5.72           0.103      -6.24
 5     4       467.              5.99           0.0990     -6.52
 6     7       466.              5.71           0.105      -6.65
 7     6       466.              6.07           0.0987     -6.31
 8     8       465.              5.98           0.102      -6.28
 9    10       464.              5.57           0.101      -6.30
10     2       463.              6.06           0.111      -6.84
#Topic quality table#
knitr::kable(topic_quality, format = "html", digits = 3, col.names = c("Topic", "Topic Size", "Mean Token Length", "Mean Exclusivity", "Coherence"), caption = "Summary Statistics for Each Topic", table.attr = 'data-quarto-disable-processing = "true"') %>%
  kable_styling(full_width = FALSE)
Summary Statistics for Each Topic
Topic Topic Size Mean Token Length Mean Exclusivity Coherence
3 480.959 6.537 0.086 -5.853
5 471.160 6.028 0.092 -6.001
1 470.075 6.306 0.102 -6.430
9 468.860 5.724 0.103 -6.241
4 467.462 5.990 0.099 -6.518
7 466.156 5.714 0.105 -6.651
6 465.946 6.066 0.099 -6.306
8 464.544 5.976 0.102 -6.282
10 464.002 5.575 0.101 -6.305
2 462.835 6.059 0.111 -6.841

The topic quality table compares topics using size, mean token length, exclusivity and a simple coherence measure. Topics with larger size and higher exclusivity tend to represent clearer, more focused themes, while very small or low-exclusivity topics may be less informative. This helps identify which topics are most useful for understanding customer feedback and which might be noisy or overlapping.

3.5 Business recommendations

Based on the topics, we can suggest actions for GameStop such as improving delivery and packaging, tightening product quality control, strengthening customer service and clarifying product descriptions. Topics that contain mostly positive language can guide marketing and promotions, while topics dominated by complaints highlight where operational improvements are most needed.