Assignment_7

Assignment 7

Introduction

  • This document compares the reviews of a Wendy’s restaurant to a McDonald’s one.
  • The sentiment of the comments will provide the evidence of which restaurant offer better service/ food for their customers

Hypothesis Questions

  • How do customer sentiments differ over time between McDonald’s and Wendy’s?

  • Which brand evokes stronger emotions (e.g., joy, anger, sadness) according to the NRC emotive lexicon?

  • Does the day of the week vary the sentiments of the customer toward the restaurant?

Setting up

Warning: package 'tidytext' was built under R version 4.4.2
Warning: package 'textdata' was built under R version 4.4.2
Warning: package 'widyr' was built under R version 4.4.2
Warning: package 'igraph' was built under R version 4.4.2
Warning: package 'ggraph' was built under R version 4.4.2

Combine the review data of McDonald’s and Wendy’s

# A tibble: 6 × 6
     ID reviewer_name review_content               review_date restaurant months
  <int> <chr>         <chr>                        <date>      <chr>       <dbl>
1     1 Paul W.       "This Wendy's should say \"… 2022-07-24  wendy's        28
2     2 Eric Y.       "This is the most Vile plac… 2024-12-02  wendy's         0
3     3 Klynn M.      "I DoorDash a combo with ch… 2024-10-31  wendy's         1
4     4 Ava B.        "If I could rate this 0 sta… 2024-08-22  wendy's         3
5     5 Aren M.       "Can't read apparently or m… 2024-05-18  wendy's         6
6     6 Lia A.        "waited INSIDE the restaura… 2024-10-04  wendy's         2

Un-nest tokens/ Separate the reviews word by words

# A tibble: 6 × 6
     ID reviewer_name review_date restaurant months word   
  <int> <chr>         <date>      <chr>       <dbl> <chr>  
1     1 Paul W.       2022-07-24  wendy's        28 wendy's
2     1 Paul W.       2022-07-24  wendy's        28 expect 
3     1 Paul W.       2022-07-24  wendy's        28 fast   
4     1 Paul W.       2022-07-24  wendy's        28 food   
5     1 Paul W.       2022-07-24  wendy's        28 biggie 
6     1 Paul W.       2022-07-24  wendy's        28 bag    

Analysis

Which brand evokes stronger emotions (e.g., joy, anger, sadness) according to the NRC emotive lexicon?

The above graph provides an overall insight of how the customers think about the 2 chain restaurants McDonald’s and Wendy’s. According to this graph, the use of positive words is more frequent in McDonald’s page on Yelp than Wendy’s.

According to the above visualization, McDonald’s has received better online feedback than Wendy’s since the customers seem to use more positive or joyful words toward McDonald’s than Wendy’s. In the online feedback of Wendy’s, there are more words that refer anger, disgust and negativity.

How do customer sentiments differ over time between McDonald’s and Wendy’s?

The visualization above indicate the frequency of the appearing positive words in the feedback of McDonald’s and Wendy’s based on the recency of the comments, if the comments were added one year away from 12/05/2024, then it would be categorized as “1 year away”, and so on. Noted that for the best analysis, the data was trimmed to have only comments that less than 92 months old( ~7 or 8 years). The x-axis has the the timeline of comments with more than 5 years, 5 years away, 4, 3, 2, and 1 year away. The y-axis only reflexes the appearance of positive words, I did not take away the negative words frequency since the 2 graphs provides the same information but this graph is more easy to understand.

Overall, we can see the common trend in both McDonald’s and Wendy’s customer feed back which is that the positive words were used less and less throughout the year. Even though Mcdonald’s still have more positive feedback, the graph shows that their customers’ satisfaction seems to fade away over the year.

Does the day of the week vary the sentiments of the customer toward the restaurant?

The visualization above indicate the frequency of the appearing positive words in the feedback of McDonald’s and Wendy’s on days of the week. The y-axis only reflexes the appearance of positive words, I did not take away the negative words frequency since the 2 graphs provides the same information but this graph is more easy to understand.

Overall, the sentiments of the customers’ feedback varies by the day of the week, however the general trend between McDonald’s and Wendy’s is the same. According to the graph, most of the time McDonald’s receives more positive words than Wendy’s. However, on Saturday, Wendy’s customers’ positive sentiment increases almost double to their average measurement.