OSTA
BIKE SALES ANALYSIS



Instructor: Dr.Do Duc Tan

Group Members

1. Nguyen My Nhi - 10322018 (Leader)

2. Nguyen Ngoc Thien Ngan - 10621053

3. Vo Ngoc Tam Nhu - 10621057

4. Le Canh Loc - 10622022


I. Introduction

Given we are the finance department of an international bike sales company, with a business mainly focusing on the North America and Oceania market and a little on Europe, the C-suite requires a holistic analysis about current trends in the bike sales market in the period from 2017 to 2022 to gain more understanding about it, as well as provide suitable suggestions and strategies to the company.

To accomplish such demand from the board of directors, a dataset of bike sales in six countries from 2017 to 2022 was analyzed to provide statistical-based information about the market in the period of time. This report will go through various statistics techniques to investigate several suppositions that were raised either from experience or from the dataset.

The report will start with a brief overview of the information provided by the dataset, followed by three hypothesis tests, which will reveal the fact hidden under the numbers, and finalized with a brief summary of what has been extracted from the dataset and the analyses.

II. Data Exploration

1. Data Summary

The analyzed dataset was retrieved from Kaggle, containing various customer and order information of 113036 customers worldwide from 2017 to 2022. Regarding customer information, the dataset recorded the age and sex of the customer, while for order information, it collected a wide variety of data, including time (date of each order), location (country and state where each order was executed), product categorization (name of the product, quantity of product, unit cost, unit price, product category and subcategory), and financial aspect (cost, profit, and revenue of the order). With a fair amount of delivered information, as well as a sufficient number of objects, the dataset suggests numerous interesting suppositions that can further benefit the business. These suppositions can further be put under statistical analyses, providing statistical evidence to either adopt or discard them.

2. General Analysis

Prior to sketching graphs and further analyses, the .csv data file of the bike sales and several library packages have to be included.

Sale<-read.csv("D:\\VGU\\1ST YEAR\\WS2023\\OSTA\\Project\\Main\\Sales_22.csv")
Season<-read.csv("D:\\VGU\\1ST YEAR\\WS2023\\OSTA\\Project\\Main\\Season.csv")
library(ggplot2)
library(ggthemes)
library(extrafont)
library(dplyr)
library(plotly)
library(extrafontdb)
library(knitr)
library(gt)
library(gtExtras)
library(reshape2)

With the imported dataset, it is time to create graphical demonstrations to have the first impressions of the dataset.

a. Profit of The Shop

Figure 1: Total Customers in The Period Of 6 Years

Figure 2: Total Profit in 6 Countries

Looking at Figure 1 and Figure 2, it can be seen that there is a likelihood that the number of customers affects the profit in six countries. The United States always outperformed the other countries, while the total profit earned by France was the lowest.

b. Sales By Three Product Categories


Figure 3: Which Bike Product is Bought The Most by Customers ?

Among the three categories, Accessories were the most purchased products for bikers of all ages, according to Figure 3, with more than 60% of the customer population going for it.

III. Data Analysis and Further Analysis

After the brief summary of the dataset in the previous sections, this part focuses on three statistics techniques to evaluate the authenticity of the supposition that will be stated in the beginning of each analysis. For the sake of coherence, each procedure will start with a graphical exhibition of the concerned data, followed by the hypothesis test, as well as the interpretation of the result and suggestions for business improvements and notices.

1. Choice of significance level \(\alpha\)

Before conducting any statistical analysis, it is important to introduce the significance level that will be used for the tests.

Significance level plays a key role in hypothesis testing. Besides being the cornerstone for the acceptance or rejection of the null hypothesis, significance level controls the critical value and power of the test, thus having a consequential impact on the inferential outcome, as well as represents the degree of risk that the researcher is willing to take for Type I error. Despite having a substantial influence on hypothesis testing, there is hardly any in-depth information on how to choose a sufficient significance level in statistics textbooks.

According to Kim (2015), a low significance level should be adopted for large sample sizes, while a higher significance level should be used for smaller sample sizes. In the scope of this report, although the dataset contains over 100.000 objects, further manipulation to create data that is suitable for analysis results in datasets with only around 10 observations. As a result, a significance level of 0.1 is adopted to increase the sensitivity of the hypothesis test (higher chance to reject the null hypothesis).

2. Total Profit By Season in Six Countries

In the countries considered in this study, the weather is cold all year round, except for summer, when it becomes much more comfortable to go outside. As a result, summer is the ideal time of the year to enjoy outdoor activities, including biking. Furthermore, summer is followed by the back-to-school season, which might raise a temporary need for bicycles.

a. Visualization of Concerned Data

Figure 4: Seasonal Profit of Six Analyzed Countries in Six Years

Figure 4 demonstrates the total profit in each season of a year in six countries considered in the dataset, throughout the recorded years. Except for Australia, where summer falls in the fourth quarter of the year, the second quarter is where summer occurs in all other countries. As shown in Figure 4, the profit made in summer in Australia is noticeably higher than that made in other seasons. Such index is also of the two highest indices in the five other countries. Therefore, it is worthwhile conducting a detailed statistical analysis to discover whether it is statistically evident that the profit made in summer is higher than that of the other seasons of the year.

b. Further Analysis

b.1. ANOVA

Based on the mentioned seasonal events, a supposition is raised, whether the bike sale in summer is statistically higher than that in the remaining seasons of a year. Based on the statistical results, we can consider adjusting business and marketing strategies, including promotion and marketing campaigns, as well as increasing procurement, to maximize the profit for the business.

The four seasons in the United Kingdom (UK), France, Germany, the United States, Canada, and Australia may have slight variations due to the different geographical locations of each country. Here is a general overview:

Country Spring Summer Fall Winter
USA March - May June - August September - November December - February
Canada March - May June - August September - November December - February
France March - May June - August September - November December - February
Germany March - May June - August September - November December - February
UK March - May June - August September - November December - February
Australia September - November December - February March - May June - August

Table 1 - Four Seasons in Six Analyzed Countries

Note that this information is a general overview and may vary depending on the specific location within each country.

Let \(\mu_i\) be the expected profit of the season \(\ i\) (with i being either summer, winter, autumn, or spring). A one-way ANOVA (Analysis of Variance) test with the following hypotheses is used to analyze whether there is a statistical evidence to conclude that the bike selling profit of summer is higher than that of other seasons:

\(\scriptsize \ \text{H}_O\): \(\scriptsize \ \mu_{\text{summer}}\) = \(\scriptsize \ \mu_{\text{fall}}\)= \(\scriptsize \ \mu_{\text{winter}}\) = \(\scriptsize \ \mu_{\text{spring}}\) versus \(\scriptsize \ \text{H}_A\): \(\scriptsize \ \mu_i\) \(\scriptsize \ \neq\) \(\scriptsize \ \mu_j\) for some \(\scriptsize \ \ i\), \(\scriptsize \ \ j\) \(\scriptsize \ \in\) {summer, fall, winter, spring}
Where \(\scriptsize \ \mu_i\) is the expected profit of selling bikes in the season \(\scriptsize \ \ i\) of a year.

A rejection of the null hypothesis will be followed by a Tukey multiple comparisons procedure between the mean profit made in summer and that made in other seasons to confirm that the mean profit made in summer is statistically higher.


ANOVA Result of the United States
X Df Sum.Sq Mean.Sq F.value PR( >F)
Season 3 7.68e+11 2.56e+11 2.186 0.125
Residuals 18 2.11e+12 1.17e+11 NA NA

Table 2: ANOVA Result of the United States


ANOVA Result of Australia
X Df Sum.Sq Mean.Sq F.value PR( >F)
Season 3 4.71e+11 1.57e+11 10.01 0.000308
Residuals 20 3.14e+11 1.57e+10 NA NA

Table 3: ANOVA Result of Australia


ANOVA Result of Canada
X Df Sum.Sq Mean.Sq F.value PR( >F)
Season 3 9.56e+10 3.19e+10 2.277 0.114
Residuals 18 2.52e+11 1.40e+10 NA NA

Table 4: ANOVA Result of Canada


ANOVA Result of France
X Df Sum.Sq Mean.Sq F.value PR( >F)
Season 3 5.11e+10 1.71e+10 2.643 0.0806
Residuals 18 1.16e+11 6.45e+09 NA NA

Table 5: ANOVA Result of France


ANOVA Result of Germany
X Df Sum.Sq Mean.Sq F.value PR( >F)
Season 3 6.70e+10 2.23e+10 1.865 0.172
Residuals 18 2.16e+11 1.20e+10 NA NA

Table 6: ANOVA Result of Germany


ANOVA Result of the United Kingdom
X Df Sum.Sq Mean.Sq F.value PR( >F)
Season 3 1.49e+11 4.95e+10 2.172 0.127
Residuals 18 4.10e+11 2.28e+10 NA NA

Table 7: ANOVA Result of the United Kingdom


With the choice of significance level of 0.1 made in section 2, the p-values of the hypothesis test reject the null hypothesis in Australia and France, while accept the null hypothesis in the four other countries. For the four countries where the p-values accept the null hypothesis, there is not sufficient evidence to conclude that there is a significant difference between the profit made by other seasons and summer. Therefore, the Tukey honestly significant difference (HSD) test is skipped.

The rejection of the supposition by the hypothesis test provides a valuable insight to our business: despite the noticeable difference between the profit made in summer compared to those made in other seasons, statistical analysis does not support the assumption. This in-depth information helps us further consider whether to invest more into stocking and marketing in summer, thereby, helps prevent the risk of inefficient investment.

However, for Australia and France, where the p-value rejects the null hypothesis, it is evident that there is at least one pair of seasonal profit that shows significant differences. As a result, the hypothesis test is followed by a Tukey HSD test to determine where the differences occur, furthermore, whether the mean profit made in summer is actually higher than that made in other seasons.

b.2. Tukey HSD Test
b.2.1. Australia

The Tukey HSD test conducted on the dataset of Australia with the confidence level of 0.9 returns the following result:

Tukey multiple comparisons of means
90% family-wise confidence level
X diff lwr upr p.adj
Spring-Fall -215926.50 -392869.8172 -38983.18 0.0338503
Summer-Fall 176420.67 -522.6505 353363.98 0.1013788
Winter-Fall -53801.17 -230744.4838 123142.15 0.8780143
Summer-Spring 392347.17 215403.8495 569290.48 0.0001417
Winter-Spring 162125.33 -14817.9838 339068.65 0.1459057
Winter-Summer -230221.83 -407165.1505 -53278.52 0.0222070

Table 8: 90% family-wise confidence level of Australia


##   Tukey multiple comparisons of means
##     90% family-wise confidence level
## 
## Fit: aov(formula = df_Australia$totalProfit ~ df_Australia$Season, data = df_Australia)
## 
## $`df_Australia$Season`
##                     diff          lwr       upr     p adj
## Spring-Fall   -215926.50 -392869.8172 -38983.18 0.0338503
## Summer-Fall    176420.67    -522.6505 353363.98 0.1013788
## Winter-Fall    -53801.17 -230744.4838 123142.15 0.8780143
## Summer-Spring  392347.17  215403.8495 569290.48 0.0001417
## Winter-Spring  162125.33  -14817.9838 339068.65 0.1459057
## Winter-Summer -230221.83 -407165.1505 -53278.52 0.0222070

Figure 5: 90% family-wise confidence level of Australia

It can be observed that for all 3 pairs of comparisons between the mean profit made in summer and that made in other seasons, when comparing the mean profit made in summer with those made in winter and in spring, the confidence intervals exclude the value 0 and simultaneously imply that the mean profit made in summer is statistically proven to be higher than that made in those seasons. However, there is not a significant difference between the mean profit made in summer and that made in fall. As a result, it can be confidently concluded that summer is among the two most profitable seasons of Australia. This finding provides crucial information for retailers to adjust their stocking and marketing strategies (i.e. purchase more bikes in summer or start promotion and marketing campaigns) to make the most out of the market.

b.2.2. France

Meanwhile, the Tukey HSD test conducted on the dataset of France with the confidence level of 0.9 returns the following result:

Tukey multiple comparisons of means
90% family-wise confidence level
X diff lwr upr p.adj
Spring-Fall 81133.92 -46703.66 208971.49 0.4220487
Summer-Fall 57703.08 -70134.49 185540.66 0.6863655
Winter-Fall 141674.58 13837.01 269512.16 0.0601105
Summer-Spring -23430.83 -137772.24 90910.57 0.9567656
Winter-Spring 60540.67 -53800.74 174882.07 0.5712314
Winter-Summer 83971.50 -30369.90 198312.90 0.3005502

Table 9: 90% family-wise confidence level of France


##   Tukey multiple comparisons of means
##     90% family-wise confidence level
## 
## Fit: aov(formula = df_FR$totalProfit ~ df_FR$Season, data = df_FR)
## 
## $`df_FR$Season`
##                    diff        lwr       upr     p adj
## Spring-Fall    81133.92  -46703.66 208971.49 0.4220487
## Summer-Fall    57703.08  -70134.49 185540.66 0.6863655
## Winter-Fall   141674.58   13837.01 269512.16 0.0601105
## Summer-Spring -23430.83 -137772.24  90910.57 0.9567656
## Winter-Spring  60540.67  -53800.74 174882.07 0.5712314
## Winter-Summer  83971.50  -30369.90 198312.90 0.3005502

Figure 6: 90% family-wise confidence level of France

It can be observed from the table above that the only significant difference occurs between the mean profit made in winter and that made in fall, while no significant difference can be observed when comparing the mean profit made in summer and that made in other seasons. Therefore, despite rejecting the null hypothesis, there is no statistical evidence that summer is more profitable than other seasons in France. Thus, further consideration is necessary if a retailer still wants to run promotional campaigns or stock more in summer.

c. Conclusion

By separating the dataset into different countries, then re-organizing the separated subsets to data points in each season, the inputs for the ANOVA tests (further Tukey HSD tests) were constructed. With the p-values returned by the tests, there is sufficient statistical evidence to conclude that, for Australia summer is among the two most profitable season for the selling of bikes, biking accessories, and biking clothing; whereas in other countries, there is no significant difference between the mean profit made by the four seasons of a year. Although the initial supposition that summer being the most profitable season is not fully accepted, with this in-depth analysis, retailers in Australia can consider adjusting their business strategies to adapt to the trend and achieve better success.

3. Dependency of Customers’ Preference on Topography

Beside the impact of season, topographical properties of a country can be a significant influencer on bike consumption of a country. Different topography requires different biking skills, as well as bike properties. As a result, bike preferences may vary from place to place.

In the scope of the report, Australia was chosen to analyze the impact of the topography of this country on the consumers’ preference of bike.

a. Visualization of Concerned Data

Figure 7: Type of Bike Bought by Customers in 5 States in Australia.

Figure 7 demonstrates the preference of bikes of the consumers in five Australian states. It can be observed that while the total consumption of bikes varies heavily with different states, Road Bikes was the most preferred type of bike in every state. However, the preference of other types of bike tends to be different from state to state, demonstrated by the varying proportion of consumed Mountain Bikes and Touring Bikes.

b. Further Analysis - Chi-Square Two-Way Contingency Test

With the observation of the concerned data in section 2.a., it is worthwhile testing the supposition stated in the beginning of section two. The stated supposition is evaluated by conducting a statistical analysis on the preference of bike according to geographical location provides a statistics-based conclusion of the correlation between a country’s topography and the choice of bike, therefore, helps us develop suitable business strategy, including a shift of purchasing to the preferred choice of bike, to make the most out of the market.

The data recorded in five out of six states of Australia throughout six years is processed through a two-way contingency table chi-squared test. The result of the hypothesis test provides statistics to determine whether the topography of Australia notably impacts on the consumers’ bike choice.

Our criteria for assumming each type of bike for each topography:

  • Mountainous, steep area: Mountain bikes
  • Small, full of valley, flat area: Road bikes
  • Large, full of valley, flat area: Touring bikes

Here is a table of summary for the research of the topography of 5 states of Australia and the last column is the most suitable type of bike for each state.

States Description of Five States in Australia
States Size Topography Bike Type
New South Wales 801,150 km^2 Numerous forests, plateaus and valleys, and arid western regions Touring Bikes
Queensland 1,729,742 km^2 Tropical rainforests, rivers, coral reefs, mountain ranges and sandy beaches Touring Bikes
South Australia 983.482 km^2 Arid and semi-arid rangelands, with several low mountain ranges Touring Bikes
Tasmania 68,401 km^2 Mostly mountainous region, with large national parks Mountain Bikes
Victoria 227.416 km^2 Diverse landscapes, and extensive coastlines Touring Bikes

Table 10: States Description of Five States in Australia

Observed Cell Frequency of Three Types of Bikes in Five States in Australia
States Mountain Bikes Road Bikes Touring Bikes
New South Wales 1337 2588 427
Queensland 694 1313 236
South Australia 207 453 68
Tasmania 82 184 19
Victoria 757 1520 271

Table 11: Observed Cell Frequency of Three Types of Bikes in Five States in Australia

Expected Cell Frequency of Three Types of Bikes in Five States in Australia
States Mountain Bikes Road Bikes Touring Bikes
New South Wales 1318.54116 2595.9449 437.51398
Queensland 679.56981 1337.9376 225.49262
South Australia 220.56479 434.2481 73.18708
Tasmania 86.34748 170.0010 28.65154
Victoria 771.97676 1519.8685 256.15479

Table 12: Expected Cell Frequency of Three Types of Bikes in Five States in Australia

The set of hypotheses for the two-way chi-squared test is stated as follows:
\(\scriptsize \ \text{H}_O\): The sales of each type of bike does not vary according to where that type of bike was sold
versus
\(\scriptsize \ \text{H}_A\): The sales of each type of bike does vary according to where that bike was sold

## 
##  Pearson's Chi-squared test
## 
## data:  sub
## X-squared = 9.5816, df = 8, p-value = 0.2956


Using the 0.1 significance level determined in section 2, the p-value of 0.2956 returned by the two-way contingency table chi-square test accepts the null hypothesis, which implies that the customers’ preference of bike types does not vary according to where the bike was sold, or more specifically, to the topography of the state of the country.

The rejection of the supposition appears to be counter-intuitive, since the topography of the states should influence the preference of customers to a certain extent. As a result, it can be interesting to have a closer look at the distribution of population in each state to discover a rational explanation for the hypothesis test’s result.

And here is another summary table:

States Population Topography Bike Type
New South Wales Live in the Greater Sydney area This area is flat Road Bikes
Queensland Mainly lives in Brisbane city A hilly area, but kind of flat Road Bikes
South Australia Mainly lives in Adelaide city Hilly and flat area Road Bikes
Tasmania Mainly lives in Hobart city A flat area Road Bikes
Victoria Mainly lives in Melbourne city Containing hills, valleys and flat areas Road Bikes

Table 13: Population Distribution in 5 states in Australia

According to the topography summary in table 13, despite having a diverse topography across the states, further population analysis of Australia tends to colonize in flatter terrain of the states. More specifically, just under two thirds of the population of New South Wales lives in the city of Greater Sydney, while in Queensland, South Australia, Tasmania, and Victoria, the people mainly live in Brisbane, Adelaide, Hobart, and Melbourne respectively. Although some of them can be hilly, it is reported that these cities mostly consist of flat areas.

Therefore, it is reasonable that mountain bikes are not more preferred even in states with mountainous terrain. However, if one would like to conclude that Road Bikes is the most preferred type of bike across Australia, he or she may consider conducting a one-way ANOVA test to determine the reliability of this hypothesis. If the ANOVA test supports the supposition, retailers could benefit a lot from it by adjusting sales and marketing strategies.

c. Conclusion

By using the Chi-squared test on a two-way contingency table, an inference of the dependence of the customers’ choices on the topography of a country was proven to be statistically inevident. Future research may consider analyzing the population distribution of each state to better understand the preference of the customers, therefore, better serve the customers’ taste.

4. Histogram about Customers’ Age in 6 countries

Besides typographical and seasonal influence on the sales of bikes, the age of consumers also provides valuable information for the business. If there exists an age group that occupies a dominating proportion in the consumer population, further analyses on behaviors and preferences of that age group can help retailers build their own business strategies by both conducting promotion campaigns towards that age group, as well as adjust their stockings accordingly.

a. Visualization of Concerned Data

Figure 8: Histogram about The Customers’ Age Group in 6 Countries

Figure 8 displays the age distribution of the sample of customers collected worldwide. It can be observed that the amount of customers with the age ranging from around 25 to 40 dominates the sample. In this age range, there exists a predefined age group called the “young adults” with the age ranging from 25 to 34 years old. Suddenly, there emerges an interesting consideration, whether this age group occupies the highest proportion among the customer population.

b. Further Analysis - Two Sample T-Test

It is worthwhile noting that when there exists 2 or more groups in a population, if one group holds over 50 percent of the total population, it automatically becomes the one with the highest proportion of the total population. With this primitive inference, it is now useful to conduct a hypothesis test to determine whether there is sufficient evidence to conclude that the young adults group is the most populated age group among the customers buying bikes.

The hypothesis test used to determine whether there is sufficient evidence to conclude that the young adults group is the most populated age group among the customers buying bikes is stated as follows:

\(\scriptsize \ \text{H}_O\): \(\scriptsize \ \text{P}_{\text{young adults}}\) < 0.5
versus
\(\scriptsize \ \text{H}_A\): \(\scriptsize \ \text{P}_{\text{young adults}}\) ≥ 0.5

## 
##  1-sample proportions test with continuity correction
## 
## data:  16148 out of 25982, null probability 0.5
## X-squared = 1533.9, df = 1, p-value < 2.2e-16
## alternative hypothesis: true p is not equal to 0.5
## 95 percent confidence interval:
##  0.6155729 0.6274055
## sample estimates:
##         p 
## 0.6215072

Where \(\scriptsize \ \text{P}_{\text{young adults}}\) is the proportion of the age group “young adults” (25 - 34 years old) of the population and significance level \(\scriptsize \ \alpha\) = 0.1. The rejection of the hypothesis test means that there is sufficient evidence to conclude that the young adults group is the most populated age group among the customers buying bikes, while the acceptance of the null hypothesis implies that there is not enough evidence to conclude that the proportion of the young adults age group is the highest among the others.

With the significance level of 0.1, the value of the p-value being 0.000 strongly rejects the null hypothesis, providing strong statistical evidence for the young adults age group being the most populated group of the customer population. It is worthwhile noting that, for this specific test, even with a much lower choice of significance level of 0.01 due to large sample size, the p-value still rejects the null hypothesis. Furthermore, an interesting insight into the proportion of this age group is that, the confidence interval for the value of the proportion with the confidence level of 95% is (0.615577, 0.627410), which mean that one is 95% sure that the proportion of the young adults age group is between 0.615577 and 0.627410.

With this in-depth information, bike retailers can decide to launch promotion and marketing campaigns to further attract this customer group; furthermore, one can also decide to adjust the stocking composition towards the preference of this particular group.


IV. Conclusion

Provided a dataset containing detailed information from the bikes and bike-related products purchasing behavior of customers worldwide in a number of years, the report delivered three statistical analysis techniques to verify assumptions and suppositions that can significantly impact on the business.

Starting with the one-way ANOVA test, the supposition of summer being the most profitable season of the year was proven to be statistically implausible for the five countries United Kingdom, Canada, the United States, Germany, and France, while such supposition was partly correct for Australia, where summer was among the two most profitable seasons of the year. The test decided that it would be rational for Australian sellers to believe in such supposition, while alerting retailers in the five countries to be careful when choosing to believe in the supposition to adjust their business.

Following the one-way ANOVA test, a chi-square test for the two-way contingency table was conducted to verify whether there is a dependency of the preference of customers on the topography of Australia. The test denied the hypothesis of such dependency; however, further analysis on population distribution showed that Australians preferred to settle down in relatively flat areas. A suggestion for further research on the customers’ taste of bikes was also provided by the end of the section.

Finally, a one population proportion test was conducted to verify whether the young adults age group dominated the population, as well as provide a 95% confidence

Reference

Kim, Jae (2015): How to Choose the Level of Significance: A Pedagogical Note.