The global video game industry, a multi-billion dollar market for years, presents an opportunity for a video game corporation to expand its operations (Context). Imagine a video game corporation with a desire to seize this chance, and we are now working as a corporation’s market research team (Position). To help our company to achieve this goal, we need to undertake an analysis of potential genres, platforms, and their corresponding regions so that the CEO can make a wise investing decision based on our analysis. With that idea, this analysis will determine the optimal regions for developing specific game genres on specific platforms to maximize profit (Purpose).
Python will serve as the primary tool for data visualization, providing insights into sales trends and market preferences, and R Markdown will be employed to make the report. In terms of calculating needed figures, Analysis of variance (ANOVA), Chi square test, Hypothesis testing are statistical techniques used.
The analysis will focus on three primary objectives:
=> By addressing these objectives, the corporation will gain a clear understanding of the market landscape, enabling it to make informed decisions regarding game development and market expansion, ultimately maximizing its profit potential.
This is a data frame with 16598 observations on 1111 variables.
The data consists of 9 variables:
1. **Rank**: numerical order
2. **Name**: The name of the video game.
3. **Platform**: The platform on which games are sold.
4. **Genre**: The official genre of the game.
5. **Year**: The year of the game was released.
6. **Pbulisher**: video game publishers
7. **NA Sale**: Sales in North America.
8. **JP Sale**: Sales in Japan.
9. **EU Sale**: Sales in Europe.
10. **Other Sale**: Sales not in North America, The Europian Union, or Japan.
11. **Global Sales**: Total global sales.
Original display of summary:
## Rank ... Global_Sales
## 0 1 ... 82.74
## 1 2 ... 40.24
## 2 3 ... 35.82
## 3 4 ... 33.00
## 4 5 ... 31.37
## ... ... ... ...
## 16593 16596 ... 0.01
## 16594 16597 ... 0.01
## 16595 16598 ... 0.01
## 16596 16599 ... 0.01
## 16597 16600 ... 0.01
##
## [16598 rows x 11 columns]
The section is to visualize the data to see possible insights that will aid in solving the report’s objectives.
## {'whiskers': [<matplotlib.lines.Line2D object at 0x000002596CF4A530>, <matplotlib.lines.Line2D object at 0x000002596CF4A7D0>, <matplotlib.lines.Line2D object at 0x000002596CF4B4F0>, <matplotlib.lines.Line2D object at 0x000002596CF4B790>, <matplotlib.lines.Line2D object at 0x000002596CF884F0>, <matplotlib.lines.Line2D object at 0x000002596CF88790>, <matplotlib.lines.Line2D object at 0x000002596CF894B0>, <matplotlib.lines.Line2D object at 0x000002596CF89750>, <matplotlib.lines.Line2D object at 0x000002596CF8A470>, <matplotlib.lines.Line2D object at 0x000002596CF8A710>], 'caps': [<matplotlib.lines.Line2D object at 0x000002596CF4AA70>, <matplotlib.lines.Line2D object at 0x000002596CF4AD10>, <matplotlib.lines.Line2D object at 0x000002596CF4BA30>, <matplotlib.lines.Line2D object at 0x000002596CF4BCD0>, <matplotlib.lines.Line2D object at 0x000002596CF88A30>, <matplotlib.lines.Line2D object at 0x000002596CF88CD0>, <matplotlib.lines.Line2D object at 0x000002596CF899F0>, <matplotlib.lines.Line2D object at 0x000002596CF89C90>, <matplotlib.lines.Line2D object at 0x000002596CF8A9B0>, <matplotlib.lines.Line2D object at 0x000002596CF8AC50>], 'boxes': [<matplotlib.lines.Line2D object at 0x000002596CF4A290>, <matplotlib.lines.Line2D object at 0x000002596CF4B250>, <matplotlib.lines.Line2D object at 0x000002596CF88250>, <matplotlib.lines.Line2D object at 0x000002596CF89210>, <matplotlib.lines.Line2D object at 0x000002596CF8A1D0>], 'medians': [<matplotlib.lines.Line2D object at 0x000002596CF4AFB0>, <matplotlib.lines.Line2D object at 0x000002596CF4BF70>, <matplotlib.lines.Line2D object at 0x000002596CF88F70>, <matplotlib.lines.Line2D object at 0x000002596CF89F30>, <matplotlib.lines.Line2D object at 0x000002596CF8AEF0>], 'fliers': [], 'means': []}
## ([<matplotlib.patches.Wedge object at 0x0000025973409420>, <matplotlib.patches.Wedge object at 0x00000259734096F0>, <matplotlib.patches.Wedge object at 0x000002597340AD40>, <matplotlib.patches.Wedge object at 0x000002597340AA40>, <matplotlib.patches.Wedge object at 0x0000025973440070>, <matplotlib.patches.Wedge object at 0x0000025973440700>, <matplotlib.patches.Wedge object at 0x0000025973409720>, <matplotlib.patches.Wedge object at 0x0000025973441420>], [Text(0.9789295991719955, 0.6940438313715903, 'Action'), Text(-0.14411069372601348, 1.0905191919236485, 'Sports'), Text(-0.9045375710686893, 0.6259487059856872, 'Shooter'), Text(-1.0958780842996028, -0.09513792278493857, 'Role-Playing'), Text(-0.8370675324138737, -0.7136651498977294, 'Platform'), Text(-0.31113645827401826, -1.055080141189616, 'Misc'), Text(0.27884776318063925, -1.0640695113427292, 'Racing'), Text(0.9500060411269955, -0.5545164756995173, 'Other')], [Text(0.7341971993789966, 0.5205328735286927, '19.6%'), Text(-0.10480777725528252, 0.7931048668535625, '14.9%'), Text(-0.657845506231774, 0.45523542253504523, '11.6%'), Text(-0.7970022431269839, -0.06919121657086441, '10.4%'), Text(-0.60877638721009, -0.5190291999256215, '9.3%'), Text(-0.22628106056292238, -0.7673310117742662, '9.1%'), Text(0.20279837322228308, -0.7738687355219849, '8.2%'), Text(0.6909134844559968, -0.40328470959964896, '16.8%')])
## <string>:1: SettingWithCopyWarning:
##
##
## A value is trying to be set on a copy of a slice from a DataFrame.
## Try using .loc[row_indexer,col_indexer] = value instead
##
## See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
## <string>:1: FutureWarning:
##
## Passing `palette` without assigning `hue` is deprecated.
To analyze and compare the sales performance of its gaming product across North America (NA), Europe (EU), Japan (JP), and other countries, we utilize a statistical method known as Analysis of Variance (ANOVA). Following the application of ANOVA, if we identify significant differences among group means, Tukey’s test will assist us in specifying the confidence intervals for these variations.
Our objective is to assess whether the average number of sales is equal across four groups of countries.
**Step1**: Form the testing hypotheses as follows:
Null Hypothesis (H0): The means of all groups are equal. (M1 = M2 = M3 = M4)
Alternative Hypothesis (Ha): At least one group mean is different from the others.
**Step2**: Collect data for each region.
**Step3**: Conduct ANOVA Test:
The reason we choose PS3 and X360 to compare with each other is that the figure … in section … indicates that PS3 and X360 are the two platforms having the highest sales. So that we start computing the mean of those two platform with the result as follows:
TABLE
In Table 1, it is evident that the average global sales for X360 surpassed those for PS3. To assess the statistical significance of this discrepancy in global sales, a statistical test will be conducted.
The global sales figures from the two platforms were demonstrated to be independent. Additionally, with a substantial sample size of 1678, the central limit theorem comes into play, ensuring that the sampling distribution of the mean conforms to normality. Consequently, the independent t-test was employed to compare the means of global sales for PS3 and X360.
A presumption was made that the games available on both platforms, PS3 and X360, would have higher global sales on PS3 compared to X360. To validate this assumption, a hypothesis test with a 95 percent confidence level was conducted, with the null hypothesis stated as follows:
\(H_{0}\): \(\mu X360\) - \(\mu PS3\)
and the alternative hypothesis given as
\(H_{A}\): \(\mu X360\) - \(\mu PS3\) < 0
With μPS3 and μX360 representing the mean global sales for PS3 and X360, respectively, the alternative hypothesis posits that the global sales for X360 were not greater than those for PS3.
To gauge the likelihood of the sample results, a p-value—referred to as the observed level of significance for the test—was employed, with α set at 0.05. The null hypothesis could be rejected if the p-value is less than α; otherwise, the null hypothesis remains unaltered.
Formulate Hypotheses: Null Hypothesis (H₀): This is the default assumption that there is no effect or no difference. It is denoted by H₀. Alternative Hypothesis (H₁ or Ha): This is the statement you want to test. It can be one-sided (greater than or less than) or two-sided (not equal to). The choice depends on the nature of your research question. The alternative hypothesis is denoted by H₁ or Ha
Select Significance Level (α): The significance level (α) is the probability of rejecting the null hypothesis when it is true. Common choices are 0.05, 0.01, or 0.10.
Collect and Analyze Data: Collect a sample of data relevant to your hypothesis. Analyze the data using appropriate statistical methods (e.g., t-test, z-test) to obtain a test statistic.
Determine Critical Region: For a one-sided test, the critical region is located entirely in one tail of the distribution. The critical value is determined based on the significance level and the distribution of the test statistic (e.g., z-table or t-table).
Make a Decision: If the test statistic falls into the critical region, reject the null hypothesis. If the test statistic does not fall into the critical region, fail to reject the null hypothesis.
Draw a Conclusion: Based on the decision in step 5, draw a conclusion in the context of the problem. If the null hypothesis is rejected, you may conclude that there is enough evidence to support the alternative hypothesis.
Calculate the P-Value (Optional): Calculate the p-value associated with the test statistic. If the p-value is less than the significance level, you reject the null hypothesis. This step is optional but can be informative.
Interpret Results: Provide a conclusion in the context of the problem, including practical implications of the findings.
By using R, a t-statistic was calculated by a three-step procedure as follows:
Step 1: The data was imported from a CSV file in R. Step 2: Import the required libraries (library(dplyr)) Step 3: We are filtering out games that are common to both PS3 and X360.
library(dplyr)
library(readr)
df <- read_csv("C:/dara.csv")
## Rows: 16598 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (5): Name, Platform, Year, Genre, Publisher
## dbl (6): Rank, NA_Sales, EU_Sales, JP_Sales, Other_Sales, Global_Sales
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Filter the data
xy <- df[df$Platform %in% c("PS3", "X360"), ]
xy <- xy[ave(seq_along(xy$Platform), xy$Name, FUN = length) == 2, c("Name", "Platform", "Global_Sales")]
# Extracting games in PS3
library(dplyr)
PS3 <- xy %>%
filter(Platform == "PS3") %>%
arrange(Name) %>%
select(Global_Sales)
# Extracting games in X360
X360 <- xy %>%
filter(Platform == "X360") %>%
arrange(Name) %>%
select(Global_Sales)
# Perform an independent two-sample t-test
result <- t.test(PS3$Global_Sales, X360$Global_Sales,
alternative = "greater",
mu = 0,
paired = FALSE,
var.equal = FALSE,
conf.level = 0.95)
# Print the result
print(result)
##
## Welch Two Sample t-test
##
## data: PS3$Global_Sales and X360$Global_Sales
## t = 0.052176, df = 1679.8, p-value = 0.4792
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## -0.1231136 Inf
## sample estimates:
## mean of x mean of y
## 0.8663020 0.8622711
# Load libraries
library(ggplot2)
library(dplyr)
PS3 <- xy %>%
filter(Platform == "PS3") %>%
arrange(Name) %>%
mutate(index = row_number()) %>%
select(-index) # To remove the index column created by mutate
tail(PS3)
## # A tibble: 6 × 3
## Name Platform Global_Sales
## <chr> <chr> <dbl>
## 1 Zumba Fitness PS3 0.59
## 2 [Prototype 2] PS3 0.75
## 3 [Prototype] PS3 1.24
## 4 de Blob 2 PS3 0.21
## 5 nail'd PS3 0.12
## 6 pro evolution soccer 2011 PS3 2.42
X360 <- xy %>%
filter(Platform == "X360") %>%
arrange(Name) %>%
mutate(index = row_number()) %>%
select(-index) # To remove the index column created by mutate
tail(X360)
## # A tibble: 6 × 3
## Name Platform Global_Sales
## <chr> <chr> <dbl>
## 1 Zumba Fitness X360 2.39
## 2 [Prototype 2] X360 0.8
## 3 [Prototype] X360 1.31
## 4 de Blob 2 X360 0.15
## 5 nail'd X360 0.1
## 6 pro evolution soccer 2011 X360 0.61
Step 4: The t-statistic was calculated:
# Perform an independent two-sample t-test
result <- t.test(PS3$Global_Sales, X360$Global_Sales,
alternative = "greater",
mu = 0,
paired = FALSE,
var.equal = FALSE,
conf.level = 0.95)
# Print the result
print(result)
##
## Welch Two Sample t-test
##
## data: PS3$Global_Sales and X360$Global_Sales
## t = 0.052176, df = 1679.8, p-value = 0.4792
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## -0.1231136 Inf
## sample estimates:
## mean of x mean of y
## 0.8663020 0.8622711
As per the statistical analysis in R, the t-statistic is reported as -0.082334, and the associated p-value is 0.9344. At a 95 percent confidence level, the smallest estimate for the true difference in the means of global sales between the two platforms is -0.1325877.
As a video game corporation,determining the right platform for releasing a video game is crucial. By aligning the game genre with the preferred genres on the targeted platform, companies can maximize their reach, appeal to the right audience, and ultimately increase their profits.
We aim to test whether there is association between platform and genre by employing Chi square test of independence. Consequently, we form the testing hypothesis as follows:
Ho: There is no association between platform and genre.
Ha: There is association between platform and genre.
1:Construct a contingency table: A contingency table is a two-way table that summarizes the frequencies of observations for each combination of categories between the two variables. Additionally, a contingency table can have more than two ways.
2: Calculate the expected counts: For each cell in the contingency table, calculate the expected count assuming the null hypothesis is true.
3: Calculate the chi-square statistic: The chi-square statistic is a measure of the difference between the observed counts and the expected counts.
$X^{2}$ = $\sum_ $\frac{$(O-E)^{2}$}{E}$
Where:
+ $X^{2}$: is the chi-square test statistic
+ $\sum_ $: is the summation operator (it means “take the sum of”)
+ O: is the observed frequency
+ E: is the expected frequency
4: Determine the degrees of freedom: The degrees of freedom for the chi-square test are calculated as (number of rows - 1) x (number of columns - 1).
5: Find the critical chi-square value: The critical chi-square value is determined based on the significance level (usually 0.05) and the degrees of freedom.
6: Compare the chi-square statistic to the critical chi-square value: If the chi-square statistic is greater than the critical chi-square value, reject the null hypothesis and conclude that there is a significant association between the two variables.
While the Chi-square test of independence can be performed manually, it can indeed be a lengthy and intricate process. This is particularly true for this large dataset. Instead, we use Python to compute calculations . The code is as follows:
Code
Based on the provided result, we can reject the null hypothesis and conclude that there is a significant association between genre and platform. + Chi-square statistic (5987.9112861106005): This value indicates the strength of the association between genre and platform. A larger chi-square statistic suggests a stronger association.
p-value (0.0): This value represents the probability of obtaining a test statistic as extreme or more extreme than the observed test statistic, assuming the null hypothesis is true. A p-value of 0 implies that the observed association is highly unlikely to have occurred by chance alone, providing strong evidence against the null hypothesis.
Degrees of freedom (330): This value reflects the number of independent comparisons in the contingency table. A larger number of degrees of freedom generally leads to a larger critical chi-square value, making it more difficult to reject the null hypothesis.
Since the p-value is 0, which is less than the typical significance level of 0.05, we can reject the null hypothesis. This means that there is a statistically significant association between genre and platform. The observed association is unlikely to have occurred by chance alone.