Data Analysis And Prediction Of Starbucks Store Per Capita
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
Starbucks is the largest coffeehouse company in the world, with 27,339 retail locations in 5,469 cities across 73 countries.
The map shows the data of countries with Starbucks locations. Darker shade means more stores. United States has the most locations with 13,608 stores. It is followed by China with 2,734 stores and Canada with 1,468 stores.
We are going to analyze Starbucks locations around the world and create a model to predict a store per capita for countries that doesn't have Starbucks stores. I used R to write the code and shiny dashboard for the visualization. Data from kaggle and world bank were merged for the analysis.
Please check the shiny dashboard here.
We will begin by exploring some countries with Starbucks and what city has the most locations. The type of ownership is important in Starbucks international expansion. Joint venture strategy helps them start a business in a new country with the help of local partners that know the market well.
United States - 13,608 stores - 3,239 cities - 41 stores per 1 million people
Japan - 1,2377 stores - 366 cities - 10 stores per 1 million people
United Kingdom - 901 stores - 348 cities - 13 stores per 1 million people
Countries with Starbucks locations have higher GDP per capita, higher population, median age of 32 and scored well on business performance index. These are the variables we are going to use to predict the number of stores per capita for each country.
Since some observations have extreme values, we decided to use log transformation for the values used. Most of the distributions are nearly normal.
We will see if there is a linear relationship between our target variable and predictor variables.
Population and ease of doing business scores are highly correlated with number of stores.
GDP per capita and median income have low correlation with number of stores.
We will use a pairwise graph to check the correlation among predictor variables. Ideally, we would like to have low-to-no multicollinearity. Population and median age have high correlation. We will monitor these variables as we select our model.
We check the model using backward elimination and forward selection using adjusted r-squared. By removing the median age and business scores, it give us the highest adjusted r-squared of 67%
Model: log(num_store) = -24.7 + 0.89*log(pop) + 1.26*log(gdp)
Using plots, we will check whether our model violates the following: linearity, constant variance, independence and normality. The plots show no major abnormalities with the residuals so it doesn't violate these assumptions.
We will use data from countries that don't have Starbucks stores. An exponential function will be used to adjust the log transformation used with the variables.
Italy - GDP per capita : $42,412.66 - Population: 60,479,424 - Prediction: 6 stores per 1 million people
Israel - GDP per capita : $40,161.92 - Population: 8,627,444 - Prediction: 4 stores per 1 million people
Myanmar - GDP per capita : $5142.15 - Population: 54,335,948 - Prediction: 2 stores per 1 million people
For simplicity I used adjusted r-squared to choose the feature of the model. In the future, I would like to use either Akaike Information Criterion(AIC) or Bayesian Information Criterion (BIC) to maximize the likelihood of the outcome. I would also like to explore other types of transformation such as Box-Cox transformation.