Introduction

The goal of this analysis is to understudy and compare user’s sentiments towards the two largest game consoles globally - Playstation 5 from SONY and the Xbox Series X from Microsoft and offer insights that could be helpful to various stakeholders especially in the context of product marketing and product development. A worthy third competitor, the Nintendo DS is excluded from this analysis as it focuses only on non hand-held consoles.

Methodology :

  • Tweets sourced using the twitter REST API and rtweet package [1]
  • Exploratory data analysis, data cleaning and data transformation
  • Sentiment analysis and statistical inferences
  • Development of ranking algorithms for most influential twitter users that talk about both products.

This analysis provides a replicable template for anaylzing twitter users’ sentiments towards any two competing products

Skills: Sentiment Analysis, Exploratory data analysis, data mining, ranking algorithms, data visualization, statistical inference

Why ‘PlayStation 5’ vs ‘Xbox Series X’?

Microsoft and SONY are two of the biggest players in the non hand-held console gaming market with their feature products ‘Xbox’ & ‘PlayStation’ being 2 of the most purchased gaming consoles globally in the last 2 decades.[2]. In November 2020, Microsoft released the “Xbox Series X”(Xbox) to rival SONY’s “Playstation 5”(Ps5) released in same month.[3]. These global sales figures up until 2021 are presented below.

Who needs to understand User Perception of these Products?

Some key stakeholders that could benefit from this analysis include:

  • International retailers who need to understand which product will improve their sales outcomes (Amazon, Walmart etc.)
  • Video game developers who need to understand what console to channel their game development efforts (Activision, Gameloft etc.)
  • The product manufacturers (Microsoft and SONY) who would like to know how their performing against the competition.

Data Gathering

The tweets used in this analysis were sourced Data sourced using the ‘rtweet’ package in R. [1]. 16470 tweets were downloaded for Xbox Series X and 34567 tweets downloaded for PlayStation 5. The Rtweet package limits tweet search to within 6-9 days leading up to the date of download which in this case was November 24th 2022. [1]. English speaking markets were the focus of analysis and this was specified for the tweet search. Retweets were excluded.

A Preliminary Study to understand how users mention these products in their tweets was used to structure the keyword search which included multiple keywords.

Data Structure

The data consists of 51037 rows/tweets and 91 columns/variables with several text, boolean and numeric variables. The key variables of the tweets used in this analysis include:

Data Cleaning and Transformation

Using the visdat package in R, I quickly analyzed the columns of interest to understand the consistency in datatypes and missing values in the data.

On analyzing the selected tweet features/variables the location related data (place_url,location), were most inconsistent with multiple empty entries, inconsistent formatting and weird values. I further analyzed the location related data to check for reliability and only 1% of tweets had geographical coordinates and 59% had user-specified locations. 40% of all tweets had no location data.

Analysis of location related variables in downloaded tweet data
Tweet Count % of Total Tweets
Tweets with geographical coordinates 561 1%
Tweets with user-specified Locations 30348 59%
Note:
This table considers a total of 51,037 tweets downloaded for both products in the analysis

Looking into user-specified locations I observed inconsistencies with the location formatting and lots of potentially misleading values like “NA”, worldwide” etc.

Top user-specified locations showing NAs, inconsistent formatting and strange values
Location Tweet Count
NA 20689
Pittsburgh, PA 1964
United States 1860
United Kingdom 352
Worldwide 336
Note:
This table considers a total of 51,037 tweets downloaded for both products in the analysis

From the preliminary analysis it is clear that analyzing metrics by location from this data will not be very reliable. Nonetheless, I attempted to manually map several of the readable user-specified location values to associated countries and combine with the more reliable geo_location data from place_url. The tweets successfully mapped only accounted for approximately 30% of the data and is distributed as below

Product Popularity Analysis

Is the ‘PlayStation 5’ more tweeted about than the ‘Xbox Series X’ from our data?

The popularity of a subject or product on Twitter can be quantified by how much a Product is talked about. This can be measured specifically in tweet frequency over time which forms the basis of of features like “Trends” on Twitter.Due to more frequent tweeting related to the ps5 during the period considered, twice as many tweets were downloaded about the ps5 than the xbox and within a much shorter time frame.

For a more direct comparison of tweet frequencies I computed the average tweet frequency in tweets per minute (TPM) for the tweets related to each product be creating a new column called minute_created (by reducing the datetime value in the created_at column to the nearest minute and aggregating the number of tweets in each minute as the tweet_per_minute

## # A tibble: 6 × 3
## # Groups:   subject [2]
##   subject minute_created      tweet_per_minute
##   <chr>   <dttm>                         <int>
## 1 ps5     2022-11-21 02:58:00                7
## 2 ps5     2022-11-21 02:59:00                4
## 3 ps5     2022-11-21 03:00:00               18
## 4 xbox    2022-11-15 14:34:00                2
## 5 xbox    2022-11-15 14:41:00                2
## 6 xbox    2022-11-15 14:45:00                1

The summary statistics showed a higher mean TPM for the Ps5 versus the Xbox but the standard deviation is pretty high showing a wide dispersion of values. For context, in a normal distribution, 99% of the values occur within a range of 3 times the standard deviation. The max value is well above this threshold, hence, it is very likely that there are outliers in our TPM distribution and a boxplot will highlight this effectively. I removed these outliers to have a more representative distribution of the tweets per minute on each product.

## # A tibble: 2 × 6
##   Product `Mean Tweet Frequency` `Standard Deviation` Median   Max   Min
##   <chr>                    <dbl>                <dbl>  <dbl> <dbl> <dbl>
## 1 ps5                       8.32                 4.76      7    38     1
## 2 xbox                      2.06                 1.41      2    19     1

After removing outliers these are the updated summary statistics:

## # A tibble: 2 × 6
##   Product Mean_Tweet_Frequency Standard_Deviation Median   Max   Min
##   <chr>                  <dbl>              <dbl>  <dbl> <dbl> <dbl>
## 1 ps5                     7.89               4.02      7    19     1
## 2 xbox                    1.93               1.11      2     5     1

The density plot below shows the difference in the distribution of TPM for both products. TPM for ps5 tweets tend to be much higher and vary over a wider range than the tweet frequency for the Xbox

Word Analysis and Text Mining

As a preliminary step to the lexicon sentiment analysis approach taken in this study, I carried out a word analysis. This included the following steps:

  1. Breaking down the tweet text into a list of words
  2. Removing spaces, filler words, stop words/less descriptive words and characters (numbers, symbols, urls)
  3. Checking for the most frequently used words in the tweets

Unnesting an cleaning tweet text

## # A tibble: 6 × 3
##   subject tweetnumber word        
##   <chr>         <int> <chr>       
## 1 xbox              1 dungeonsgame
## 2 xbox              1 bringing    
## 3 xbox              1 cross       
## 4 xbox              1 progression 
## 5 xbox              1 game        
## 6 xbox              1 pc

Analyzing word frequency

I created a wordcloud of the words used in the tweets to highlight the words that were most recurring in tweets related to each product. - For the Xbox, negative words like hacking and hacked most frequent which indicated a possible negative sentiment towards the product. - For the ps5 we observed frequent mentions of the Playstation4(Ps4), a previous version of the ps5 and on reviewing a sample of tweets, I observed a lot of comparison by users between the ps5 and it’s predecessor.

Word frequency in related tweetsWord frequency in related tweets

Word frequency in related tweets

Sentiment Analysis

Is the Twitter User Sentiment better toward the ‘PlayStation 5’ than the ‘Xbox Series X’ from our data set?

The sentiment analysis was carried out as follows:

  1. I imported the Bing Lexicon, a preset list of words and their associated sentiments (negative or positive)
  2. Assigned the words from the tweets their sentiments from the lexicon. See below:
# A tibble: 5 × 3
  `Tweet Number` Word    Sentiment
           <int> <chr>   <chr>    
1              2 lost    negative 
2              2 recover positive 
3              2 recover positive 
4              2 discord negative 
5              3 loved   positive 
  1. Calculated the number of positive and negative words per tweet
  2. Found the sentiment score per tweet as the difference between the positive word count and negative word count for that tweet. A tweet with more positive words will have a more positive sentiment score and vice versa.
# A tibble: 5 × 4
  `Tweet Number` negative positive score
           <int>    <dbl>    <dbl> <dbl>
1          10001        0        1     1
2          10002        1        0    -1
3          10004        0        1     1
4          10007        1        0    -1
5          10008        0        6     6

The distribution of sentiment scores of the tweets tended towards a normal distribution. The mean sentiment score for the ps5 was higher(more positive) than the Xbox Series X as expected from our word analysis. Nonetheless both mean sentiment scores tended towards 0 a neutral sentiment.

## # A tibble: 2 × 6
##   subject mean_score    sd Median   Max   Min
##   <chr>        <dbl> <dbl>  <dbl> <dbl> <dbl>
## 1 ps5         0.116   1.47      1     7    -6
## 2 xbox       -0.0570  1.26      0     6    -6

Is the Twitter User Sentiment better toward the ‘PlayStation 5’ than the ‘Xbox Series X’ for the wider population of twitter users?

Considering the sentiment scores are normally distributed from our data, it follows that some simple statistical inferences can be made about the sentiments of the wider twitter population.(Some knowledge of standard statistical testing will be required to fully understand the steps below)

Taking 10,000 Randomly sampled tweets for each product and considering the unequal Variances of Sentiment Scores for Tweets of both products, two statistical tests can be carried out:

  1. A two-tailed welch t-test to confirm a difference between the mean sentiment scores for both products.
  2. A one-tailed welch t-test to assert that the sentiment score for the ps5 is indeed higher than the Xbox.

Two tailed-Welch T-test formulation:

\[ \begin{aligned} H_0:& \mu_{Ps5} = \mu_{xbox} \quad \text{: } \mu_{Ps5}\text{ sentiment mean is equal to } \mu_{xbox} \\ H_1:& \mu_{Ps5} \neq \mu_{xbox} \quad \text{: } \mu_{Ps5} \text{ sentiment mean is not equal to } \mu_{xbox} \\ \end{aligned} \] One tailed-Welch T-test formulation:

\[ \begin{aligned} H_0:& \mu_{Ps5} \leq \mu_{xbox} \quad \text{: } \mu_{Ps5}\text{ sentiment mean is less than or equal to } \mu_{xbox} \\ H_1:& \mu_{Ps5} > \mu_{xbox} \quad \text{: } \mu_{Ps5} \text{ sentiment mean is greater than } \mu_{xbox} \\ \end{aligned} \]

Results:

Results of statistical test of the sentiment means of both products (Null Hypothesis rejected)
Test Description p-value
Two-tailed Welch’s test 4.353735e-10
One-tailed Welch’s test 2.176867e-10

From the results of both tests the p-value is less than 0.05. This means:

  1. The two-tailed t-test disproves the null hypothesis that there is no difference between the mean sentiment scores for both products and allows us to conclude with some certainty that the sentiment scores for both products are not the same for the wider twitter population

  2. The one-tailed t-test disproves the null hypothesis that there the mean sentiment score for the ps5 is less than that of the Xbox. This allows us to conclude with some certainty that the sentiment scores for the ps5 is higher (more positive) than for the Xbox

User engagement and Influencer Analysis

Are Twitter Users engaging more with with ‘Xbox Series X’ or ‘Playstation 5 Tweets’?

By simply trying to answer this question using the mean values of tweet engagement metrics (retweet_count, favorites_count) we find similar mean favorites_per_tweet and retweets_per_tweet for both products.

Nonetheless, A more detailed look at the median, range and skew of the data tells a very different story that’s closer to reality. The majority of tweets on twitter do not average ten favorites or 2 retweets as the previous chart suggests.In reality most tweets actually get 0 retweets and likes, and there are several factors that cause tweets to garner more engagement. Considering a median retweet_per_tweet and favorite_per_tweet of 0 and high skew, the mean is not reflective of the data. A deeper analysis will be required to understand the factors that drive higher user engagement with these tweets. This is outside the scope of this study.

##                    n  mean     sd median trimmed mad min   max range   skew
## retweet_count  51037  1.70  54.87      0    0.05   0   0  7866  7866  86.69
## favorite_count 51037 10.43 416.74      0    0.50   0   0 70320 70320 125.91

Who is driving the engagements with these products on Twitter?

To answer this final question, I developed an algorithm to rank the top twitter accounts (Influencers) driving user engagement around these products which could be of marketing interest. The algorithm considers factors such as tweet frequency, user engagement and author sentiment to rank the top influencers in discussion about these products. The influence rank algorithm also gives more weight to user engagement with the author’s tweets than to metrics controlled by the author like tweet frequency.

Influencer Rank for tweets related to Xbox Series X
User Rank Followers Tweet count Mean Retweets per tweet Mean favorite per tweet Mean Sentiment Score
Atlus_West 2907 421736 3 281 2136 0.33
Wario64 2903 1155165 3 29 319 0.33
JamieMoranUK 2897 23558 26 6 94 0.54
IGNDeals 2893 287215 3 17 178 1.00
gundamevolution 2891 35672 3 253 1257 0.67
Influencer Rank for tweets related to PlayStation 5
User Rank Followers Tweet count Mean Retweets per tweet Mean favorite per tweet Mean Sentiment Score
NextGenPlayer 9639 66869 6 114 899 0.17
GermanStrands 9630 36592 10 81 956 0.70
videogamedeals 9599 475742 10 7 42 0.30
LimitedRunGames 9568 237760 6 6 31 0.17
TCMF2 9550 11917 4 65 558 0.50

Limitations of the analysis

Twitter API Limitations

  • Variables such as reply_count and quote_count were not available to us to improve the analysis of consumer engagement and reach.
  • Twitter location data is not reliable.

Limitations of the Statistical tests

  • Social media data is not representative of the actual product consumer population.
  • Sentiment scores can be skewed by singular events/incidents e.g a likely hacking incident related to Xbox Series X in this case.
  • A more effective deployment of this analysis will be to a continuous stream of twitter data instead of tweets for a brief period.

Limitations of Lexicon-based approach

  • Studies show that the lexicon based approach not as accurate as supervised-learning approach. ([4]).
  • Lexicon-based methods are restricted by their preset lexicons, and static sentiment values of words regardless of the context.This sentiment analysis cannot account for context, sarcasm and other nuances of written communication ([4]).
  • In the context of twitter where non-traditional language is largely used with different colloquialisms generated each day, it’s even more difficult for lexicon based approaches to be manually updated to account for new words. ([4]).

Key Insights & Strategic Suggestions


References

[1]
M. W. Kearney, L. Revilla Sancho, and H. Wickham, Rtweet: Collecting twitter data. 2023. Available: https://CRAN.R-project.org/package=rtweet
[2]
Statista, “Current generation video game console unit sales worldwide from 2017 to 2021.” https://www.statista.com/statistics/276768/global-unit-sales-of-video-game-consoles/, 2022.
[3]
The Economist, “PlayStation 5 v xbox series x.” https://www.economist.com/business/2020/11/07/playstation-5-v-xbox-series-x, 2020.
[4]
V. A. Kharde and S. S.Sonawane, “Sentiment analysis of twitter data:a survey of techniques,” International Journal of Computer Applications, vol. 139, no. 11, pp. 1–15, 2016.
[5]
H. Wickham, R. François, L. Henry, K. Müller, and D. Vaughan, Dplyr: A grammar of data manipulation. 2023. Available: https://CRAN.R-project.org/package=dplyr
[6]
K. Ren and K. Russell, Formattable: Create formattable data structures. 2021. Available: https://CRAN.R-project.org/package=formattable
[7]
H. Wickham et al., ggplot2: Create elegant data visualisations using the grammar of graphics. 2023. Available: https://CRAN.R-project.org/package=ggplot2
[8]
H. Zhu, kableExtra: Construct complex table with kable and pipe syntax. 2021. Available: https://CRAN.R-project.org/package=kableExtra
[9]
S. Meschiari, latex2exp: Use LaTeX expressions in plots. 2022. Available: https://CRAN.R-project.org/package=latex2exp
[10]
V. Spinu, G. Grolemund, and H. Wickham, Lubridate: Make dealing with dates a little easier. 2023. Available: https://CRAN.R-project.org/package=lubridate
[11]
W. Revelle, Psych: Procedures for psychological, psychometric, and personality research. 2023. Available: https://personality-project.org/r/psych/ https://personality-project.org/r/psych-manual.pdf
[12]
H. Wickham, J. Hester, and J. Bryan, Readr: Read rectangular text data. 2023. Available: https://CRAN.R-project.org/package=readr
[13]
J. Allaire et al., Rmarkdown: Dynamic documents for r. 2023. Available: https://CRAN.R-project.org/package=rmarkdown
[14]
H. Wickham and D. Seidel, Scales: Scale functions for visualization. 2022. Available: https://CRAN.R-project.org/package=scales
[15]
H. Wickham, Stringr: Simple, consistent wrappers for common string operations. 2022. Available: https://CRAN.R-project.org/package=stringr
[16]
H. Wickham, D. Vaughan, and M. Girlich, Tidyr: Tidy messy data. 2023. Available: https://CRAN.R-project.org/package=tidyr
[17]
D. Robinson and J. Silge, Tidytext: Text mining using dplyr, ggplot2, and other tidy tools. 2023. Available: https://github.com/juliasilge/tidytext
[18]
I. Fellows, Wordcloud: Word clouds. 2018. Available: https://CRAN.R-project.org/package=wordcloud
[19]
H. Wickham, ggplot2: Elegant graphics for data analysis. Springer-Verlag New York, 2016. Available: https://ggplot2.tidyverse.org
[20]
G. Grolemund and H. Wickham, “Dates and times made easy with lubridate,” Journal of Statistical Software, vol. 40, no. 3, pp. 1–25, 2011, Available: https://www.jstatsoft.org/v40/i03/
[21]
Y. Xie, J. J. Allaire, and G. Grolemund, R markdown: The definitive guide. Boca Raton, Florida: Chapman; Hall/CRC, 2018. Available: https://bookdown.org/yihui/rmarkdown
[22]
Y. Xie, C. Dervieux, and E. Riederer, R markdown cookbook. Boca Raton, Florida: Chapman; Hall/CRC, 2020. Available: https://bookdown.org/yihui/rmarkdown-cookbook
[23]
J. Silge and D. Robinson, “Tidytext: Text mining and analysis using tidy data principles in r,” JOSS, vol. 1, no. 3, 2016, doi: 10.21105/joss.00037. Available: http://dx.doi.org/10.21105/joss.00037