The Building Blocks of Business Strategy
By: Raymond Willey
Tags: Strategy, Data Science, Business Intelligence, Business, Statistics

The Building Blocks of Business Strategy

A data scientist’s approach to making better business decisions.

To say that Steve Jobs was one of the greatest innovators of our time would be an understatement. Walter Isaacson, Jobs’ biographer, said it best:

“His saga is the entrepreneurial creation myth writ large: Steve Jobs cofounded Apple in his parents’ garage in 1976, was ousted in 1985, returned to rescue it from near bankruptcy in 1997, and by the time he died, in October 2011, had built it into the world’s most valuable company. Along the way he helped to transform seven industries: personal computing, animated movies, music, phones, tablet computing, retail stores, and digital publishing. He thus belongs in the pantheon of America’s great innovators, along with Thomas Edison, Henry Ford, and Walt Disney.”

The thing about Jobs is that he didn’t just innovate products and gadgets, but management and business. Even through finance and MBA courses at school, one is hard-pressed to escape more than a few case studies involving Apple and Pixar. And I’m sure we’ve all had a manager at some point or another that wanted to be like him. Everyone is looking for the right formula: the keys to success in business through innovation. Unfortunately, efforts to innovate often look like short-sighted attempts to throw ideas at the wall to see what sticks. That would be fine if those activities were limited to brainstorming sessions. But if all such managers heard just one quote from Jobs himself, it might cause them to rethink their approach:

“People think focus means saying yes to the thing you’ve got to focus on. But that’s not what it means at all. It means saying no to the hundred other good ideas that there are. You have to pick carefully. I’m actually as proud of the things we haven’t done as the things I have done. Innovation is saying no to 1,000 things.”

Jobs here is not unlike Curly, an old cowboy in the 1991 movie City Slickers, giving life advice to a much younger Billy Crystal. “You know what the secret of life is? …one thing. Just one thing.” The dumbfounded Crystal wants to know what that one thing is, but is left feeling confused and disappointed when he hears, “That’s what you’ve got to figure out.”

Jack Palance & Billy Crystal: City Slickers, 1991

So, how do businesses figure out where to strategically focus their resources? Data!

Scenario & Objective

The best way to explore the idea of using data to drive business decisions and strategy is to use a concrete example. In this case, we will be working with the Northwind database. Northwind Traders is a fictional, specialty-foods company that distributes its products worldwide; the database itself was developed by Microsoft as a way of demonstrating features for its SQL Server and Access products. Before looking at the database structure, let’s quickly define a business problem.

As an established organization that operates in highly competitive markets, Northwind is looking to boost sales volumes on a per-transaction basis. In the past, the firm has attempted to use discounts, but the results have been mixed. Management has also received other suggestions to boost volume, which include the following:

Develop and implement a training plan for low-performing sales staff. Increase advertising in regions where customers tend to purchase higher quantities already, thus luring them away from competitors. Increase advertising for products that tend to sell at greater volumes.

These are all viable options, so which direction does management go? Do they implement all strategies and see what works? Do they select just one strategy, or a mix of strategies? Can any of these strategies be combined in some way? How do these strategies get implemented? The answer is clear: 42.

Wait, what was that?

Those who have read Hitchhiker’s Guide to the Galaxy will understand the reference, but it effectively boils down to this: even if you have the right answer, it won’t make any sense unless you are asking the right question. So, let’s see how a data-driven approach can guide us to the right questions, as well as the right answers.

There are four areas where strategy options exist: discounts, sales training, regional campaigns, and product campaigns. In addition, there is one target output that needs to be maximized: sales volume. This results in four simple questions that need to be answered:

Do discounts have a statistically significant impact on sales volume? Do certain employees produce results that are significantly greater than others? Do certain regions buy products at significantly greater volumes than the rest of the world? Do any product categories sell at significantly higher volumes than the rest?

Notice, the questions are not immediately aimed at deciding what to do, but at understanding the nature of the relationships between the things that can be controlled directly (independent variables) and the objective (target variable), which can only be manipulated indirectly. The expectation is that, once greater levels of understanding are attained, the appropriate strategy will reveal itself. What’s more, the questions themselves are stated in a way that make easy to figure out what information is required to answer them. Now it’s time to grab the data.

Understanding the Database

Par for the course for any modern business is the maintenance of a historical database containing customer, supplier, product, inventory, and order information. This information can be stored for a variety of reasons outside of analysis and strategic development, which means there is likely to be a lot of extraneous information that is irrelevant for this purpose. So the goal is to get to the information that’s needed, while ignoring the rest.

Below is a copy of the Entity Relationship Diagram (ERD) for Northwind’s data. And ERD is essentially a map of data: it shows what information exists within the database, as well as how to get from point A to point B if you want to extract specific elements. It looks a bit overwhelming at first, but it is possible to develop an intuition behind the navigation.

Let’s put this into more real terms: the objective is to maximize sales volume on a per-transaction basis. So, it makes sense that the first piece of information required will be a list of orders and quantity of products sold per order. Looking around, we can see an Order Details table, which includes ProductID, Discount, and Quantity. Quantity is going to be our target variable (the thing we want to maximize). You will also notice the ProductID has a key icon located just to the left of it, which indicates more information can be obtained about the product, and the line sticking out from the left of the table leads to a Products table in the upper-left corner. This is great, since we are also going to want the product category to figure out if that impacts quantity, and the CategoryID leads to a separate Categories table.

This same method can be used to link Orders, which can then be traced to Employees, Customers and Region.

With this visual representation of where the required data exists within the database, it is now possible to extract it to a single table or dataframe. There are a number of tools to do this, but in this instance, we will look at how this is executed using SQL queries from within Python.

Extracting the Data

This section is going to be very technical, so if you are looking for a more conceptual overview, feel free to skip ahead to the next section.

Python and R are typically the languages of choice when it comes to data analysis, but they store information in a different manner and for different purposes than larger databases, like SQLite. Since the Northwind database is stored as an SQLite database, an Object Relational Mapper (ORM) will be required. In this case, since we are working with Python, SQLAlchemy will be the ORM of choice to not only connect to the database, but to run the appropriate SQL queries from within the program. The first part will be to instantiate a session object (which establishes all the relevant connections that allow for communication with the database) and create an engine (which simply sends requests to the session object for information). In addition, an inspector object can be created, which can provide information about the database architecture. This will be used to display the table names to ensure the connection has been properly established, as well as to verify that the table names match the ERD. In many cases, there are slight variations that can create bugs in your code, so this is always something to be mindful of.

OUTPUT:

['Category', 'Customer', 'CustomerCustomerDemo', 'CustomerDemographic', 'Employee', 'EmployeeTerritory', 'Order', 'OrderDetail', 'Product', 'Region', 'Shipper', 'Supplier', 'Territory']

If these table names are checked against the table names in the diagram, some variation will be observed, so all queries should be adjusted accordingly. One other option is to display the column names and data types for each table for quick double checking later on. The following code will print the results, but it would also be possible to modify the code to save it to a dataframe for a different view.

OUTPUT (FIRST TABLE ONLY): Table Name: Category



Name: Id

Type: INTEGER



Name: CategoryName

Type: VARCHAR(8000)



Name: Description

Type: VARCHAR(8000)

--------------------------

So, with this in place, the syntax for running the proper SQL query and saving it to a dataframe is incredibly simple:

df = pd.read_sql_query('''SQL QUERY HERE''', engine)

However, the query itself my be as simple or complex as you choose. While it would be possible to run individual queries for each piece of information, then concatenate dataframes, we are just going to run the whole thing in one shot.

From here, it can be observed that for each order, the associated product quantities, employee, region, category, and discount level has been included. With a little inspection and cleanup by combining the employee name/id, as well as getting rid of a few extraneous columns, we end up with the following:

Hypothesis Testing Overview

So, we have four questions that inquire as to how significant discounts, salesperson, region, and category are on quantity purchased. The default assumption (null hypothesis) for each independent variable is no relationship exists between it and the target variable, and we calculate the probability that no relationship exists between the two, given the data. If the probability is sufficiently low, it can be said that we are sufficiently confident that a relationship does exist. A general rule of thumb is to use a 95% confidence level, and that should be sufficient for purposes of this analysis. Keep in mind that different scenarios may warrant different confidence levels, such as in medical device testing, where 5% fail rate would be unacceptable.

There are two general types of tests that will be performed:

Analysis of the Variance (ANOVA): This will be used to inform us if any variables can be eliminated right at the outset. Student’s T-Test: For each variable that passes the ANOVA test, this test will be performed to determine if any subset of variables has a significantly different level of impact on quantity than others. (I.e. Does a 5% discount have a greater impact on quantity than other levels of discount?)

Because we are concerned with deviation from the norm either way (higher and lower performance are both important), all tests will be 2-tail tests.

ANOVA

An ANOVA test will allow us to check the significance level of all variables at once, and it will spit out a few numbers for each of those variables. The most important one for this purpose will be the p-value. If we want to be 95% confident that our variables have a statistically significant impact on quantity, then the sum of the p-values needs to be less than 5% (100% – 95%), and no p-value can be greater than 1.25% (5% ÷ 4).

Statsmodels is a Python library that will run this test for us, and the p-values can be found in the right-most column of the results. The final row for residuals can also be ignored.

OUTPUT: variable_name sum_sq df F PR(>F)

C(Employee) 8259.303411 8.0 3.010143 2.313174e-03

C(Region) 40031.874384 8.0 14.589809 6.642581e-21

C(CategoryName) 959.751343 7.0 0.399755 9.028854e-01

Discount 6925.520310 1.0 20.192314 7.392950e-06

Residual 704133.930739 2053.0 NaN NaN

Looking at the resulting p-values in the far right column, it can be observed that with the exception of product category (CategoryName), all variables are statistically significant. This is to say that for Employee, Region, and Discount level, the null hypothesis (default assumption), that no significant relationship exists with quantity, is rejected. The only remaining question is which levels of discount, which employees, and which regions significantly differ from the rest.

T-Test

Using a 2-tail t-test to compare the difference between population means is a fairly and easy to do. As with the ANOVA test, the null hypothesis is that there is no difference. By examining the differences in mean, and comparing it to the variance of data, we can determine how likely it is that the difference is due to random chance. This can be accomplished quite easily.

scipy.stats.ttest_ind(group1, group2)

However, this has to be performed many times over. For each region (for example), we want to know if the difference in quantity between the region and the rest of the world is statistically significant, and p-values of less than 5% indicate a confidence level of 95%. In addition, we want to look for the top performing and lowest performing regions. This can be accomplished with some functional iteration:

This could, of course, be combined with additional code to display graphs and track results, but this is the essence of the process.

When comparing employees, the same approach is taken, but with discount levels, each discount level is compared to the scenario when no discount is offered at all. Regional and employee quantities are compared to the remaining population, while discount levels are compared against a control group.

Results

In all cases, results were looked at from the perspective of mean and variance changes, adapting traditional risk methodologies to gauge performance. Specifically, the desire is not simply to increase quantity, but to do so at consistent levels. The best opportunities exist where mean quantities increase, but variance of quantity levels remain consistent with the rest of the population. This will make more sense when looking at a specific example.

The chart on the left compares the average quantity at the 10% discount level to the no discount level, and the chart on the right shows the same comparison at the 20%. No discount is represented in red. The increase in mean quantity is significant in both cases, but it is also observed that the shape of the blue curve on the left is shorter and wider. This is an indication that, while effective, the results are not as consistent at the 10% level as at the 20% level. Ideally, we would like to find results where the blue chart maintains the same shape as the red, getting shifted to the right without getting wider. Variance stays about the same, but the mean quantity increases. In this case discounts at the 20% level prove most effective.

Let’s have a look at best and worst regions in terms of quantity:

Western Europe consistently makes purchases in greater quantities at slightly more varied rates than the global average. On the other hand, Eastern Europe consistently buys very little. Consistency isn’t necessarily a good thing when results are consistently bad. This looks like an area where there is room to grow, and discounts might give a nice boost.

Finally, let’s look at the highest and lowest performing salespeople.

While the employee with ID King7 is the highest performer, Suyama6 is the lowest. However, the deviations from the mean are quite slight, considering these individuals represent the extremes. It is difficult to conclude that sales training will result in greater performance, unless it can be demonstrated that the team, in its entirety, is underperforming.

Building a Strategy

So, what is the right strategy? Before, we had a number of questions, and going off of intuition might have had you shooting around in the dark. Management indicated that discounts had mixed results, and we can see why: it depends on the level of discount. But, let’s look at each proposal and use this research to make a decision.

Employee Training: It might help, but compared to opportunities in the above areas, results are likely to be lackluster. If the firm is significantly underperforming against competitors, bring in outside talent to diagnose the problem and demonstrate potential areas for focused training. Regional Focus: Most room for opportunity is in Eastern Europe. Increase advertising there, and focus discounts in this region over other areas. Product Category Focus: No product category sells at demonstrably greater quantities than another. Decisions to promote specific products should be based on other factors (i.e. inventory levels or profit margins). Discounts: Greatest impact on quantity can be realized at the 20% level.

As we can see, if we ask the right questions of our data and apply a robust process to answer those questions, the process of devising strategy becomes exponentially simpler. And the process doesn’t have to end here: additional examination of the impact of discounts on a regional basis could potentially yield even more concise recommendations, though additional checks (particularly with regard to collinearity) will be required to ensure the validity of the results.

Final Thoughts

Data science and statistics, the use of which was once considered a competitive advantage, is quickly becoming a baseline requirement for any business that wants to succeed. As more and more information floods the marketplace, land will soon fall under the horizon, and the question of whether an organization sinks or swims will be irrelevant without a strong navigator.

References

The Jupyter Notebook and all resources used for this project can be found on Github.