Video Game Sales
The video game industry has evolved into one of the world’s largest entertainment sectors, generating over $180 billion annually and surpassing both the movie and music industries combined. This market creates rich opportunities for data analysis, as gaming companies are constantly seeking to understand consumer preferences, market trends, and the factors that drive commercial success.
This dataset contains both numerical and categorical variables, making it ideal for developing data science skills by providing numerous cases for us to explore data grouping, analysis, and visualization.
There are 14 columns and 64016 rows of data for us to work with. These columns include:
-
title: official title of the video game -
console: video game console models by many different companies -
genre: category for video games based on the content’s theme -
critic_score: numerical rating assigned to each game on a scale of 1 to 10 reflecting the overall opinion of the game’s quality -
total_sales: approximate number of copies (millions) sold of each game across all locations
Google Play Store
The Google Play Store, released in 2008 as "Android Market", is the very popular marketplace for users of Android devices. It is used by over 2.5 billion users monthly to discover, download, and update a vast number of applications including games, movies, books, and more. There are millions of apps and games available. This store has over 150 billion items downloaded from it in the past year.
There are 13 columns and 10841 rows of data for us to work with. The main columns we will be working with are:
-
Rating: numerical decimal rating (1 - 5) showing average score of each app -
Reviews: count of reviews left per app, ranging from 0 to over 10 million -
Content.Rating: suggested target audience based on app’s theme
Import the Video Game Sales dataset from the file /anvil/projects/tdm/data/grouping/vgchartz-2024.csv into a dataframe called video_games.
One thing we might choose to examine is the critic scores. These are important because they create a standardized way to gauge the quality of a game before buying it. We could look at the average critic scores by genre using tapply() to determine which genre is usually the most trustworthy for a quality game.
The tapply() function has format tapply(X, INDEX, FUN, …), where
-
Xis a vector to apply a function to -
INDEXis a vector to group by -
FUNis the function to apply (mean, sum, …) -
…is any other additional arguments beyondX,INDEX, andFUNto pass to the function.
So, we could do tapply(video_games$critic_score, video_games$genre, mean) to find the average critic score within each video game genre. It all looks very simple - all one line, not too hard to think about - but is not the easiest to make sense of. In this case:
|
We didn’t have any additional arguments. Though once you run this code, you will soon see why we will need to add one. |
The output is not good. It shows us each of the genres, but each with a NA value, which is not insightful beyond showing us that the dataset is imperfect. Try adding na.rm=TRUE as an (optional) fourth argument in the tapply.
Let’s look at some new columns. total_sales shows us the number of copies of each video game and console pairing sold worldwide. console shows us the gaming system that each game is compatible with.
In a tapply() statement with the total_sales and console columns, use sum as the FUN argument. This will show the total number of game sales across each console type.
It is often helpful to sort the data when wanting to learn from the output. By default, this is sorted by the console names, alphabetically. In this case, it would be useful for us to sort by the values of the total sales.
|
Use |