Thursday, July 21, 2016

Heijunka in the Service Industry

The Banker’s dilemma.

It’s always desirable to have visibility on upcoming work to plan ahead and optimize resources. That’s why forecasts are so attractive and also dangerous: they’re equal parts trending analysis and wishful thinking [how could a business run with no predictions?].

In the Manufacturing Industry a build-to-stock model can be used to stack-up inventory based on a forecast with the purpose of leveling the load and thus gaining stability in the supply chain [what are the associated risks of a build-to-stock strategy?]. It is less common to find this scenario in the service industry as most of the work is on-demand. Either with the use of a forecasting tool or with solid customer orders at hand it is recommended to use a visual system to organize work.

Heijunka, usually translated as “level loading” is a lean system designed as a strategy to deal with “Mura” (unevenness) caused by demand fluctuation. This concept goes deep but in its basic form it can be described as follows: Sales provides demand, the demand is analyzed by Planning against Operations capacity until agreement is reached (1st loop); the Heijunka box/board is loaded for a certain time period (shift, day, week) and progress is measured, if the target is not met then Operations adjusts capacity (2nd loop) or/and the demand is renegotiated (3rd loop). The loops illustrate how the System learns and adjusts.

Fig1. Heijunka (basic) System flowchart

The Heijunka box/board resides at Operations (or where the job is administrated / happening). A typical arrangement of a Heijunka box looks like a cluster mailbox. The actual set-up and appearance varies widely, depending on the needs of the people using the box, but in its basic form one axis displays the time period and the other the products or services so both the total product/service load and mix are visible for every time slot.

Fig2. Example of a Heijunka box

Heijunka is the best tool I know to organize upcoming work in a Visual Management environment but I’ve always wonder its limits in the service industry. That got me to think in the Banker’s dilemma.

Ideally, requests for service would always come “leveled”: exact amount of work for the exact amount of resources. Picture yourself walking into a bank and the customer before you leaving the cashier window right as you approach and the same occurring for the customer after you. Of course, variation happens and the banker is faced with a dilemma: hiring 6 clerks at the expense of having half of them do nothing during low demand or hiring 2 clerks and make customers wait during peak hours. I believe there are countermeasures that could make any of these approaches manageable. 

Let’s imagine that the banker decides to split the difference and hires 4 clerks. During low demand hours the extra cashiers could flex-out, if properly trained and empowered, to do other value adding activities like assisting Customers on the phone or opening accounts. It is of great importance to properly identify the streams of revenue for the Company so employees don’t get buried under wasteful tasks when flexing [what does their value streams look like?]. During peak hours one countermeasure could be to increase the comfort of the customers on their wait time by offering restful seating, free coffee, climate control or other amenities that ease the pain of been trapped at the bank. Also, another employee, like a walk-around supervisor, could flex-in whenever needed. I’ve seen employees flexing work and comfort increasing tools been partially successful (better if combined) but I will venture that the situation can be furtherly improved by reflecting on Heijunka and its connection to Visual Management.

Let’s rethink the same scenario adding a simple idea: if we could somehow identify the specific service the customer requires beforehand, and make it visible for everybody, it would be easier to balance the load!

For the sake of simplicity, let’s assume the bank reflects deeply on their value creating activities and defines four value streams for its services. To avoid entering in the financial services details, let’s call them A, B, C and D types. Again for simplicity, let’s give types A and B an average completion of 5 minutes, C of 8min and D of 12min. Now let’s install one line for each type of customer to arrive. When there is one customer on each of the lines the total workload would be of 30min. The set-up would look something like this:

Fig3. Hypothetical configuration for the Banker’s dilemma.

An important question here is: if you’re in line for a transaction that should take 5 minutes for how long will you be willing to wait? If you’re not the patient kind, 15min might be close to unacceptable [how could these be confirmed?]. Assuming less than 15min is desirable, let’s analyze some scenarios:

Scenario 1: if all lines have 2 people waiting it might be time to flex-in an extra pair of hands.

Fig4. Demand scenario 1: A=3, B=3, C=3, D=3.

Scenario 2: If line D is empty, C has one Customer in line and A and B have three Customers waiting; it might be time to convert line D to serve customers from either A or B.

Fig5. Demand scenario 2: A=4, B=4, C=2, D=0.

In the same scenario, what would be the wisest think to do if also c=4? When would it be time to flex-out an employee? What could the signal be? These situations and more can be easily simulated with real people during a lean transformation. Once the system gets optimized, better comfort tools can be planned to enhance the Customer experience.

Finally, the Lean Sigma practitioners familiarized with Heijunka might wonder where the Heijunka box is. Like those giant chess boards played with real people, you can imagine the Customers entering each line position themselves inside a square of the Heijunka box. As time advances, picture the squares been cancelled until the clock runs out for the day.

Fig6. Heijunka box view of the Banker’s dilemma.

This reflection can be extended to any Customer facing business (like Supermarkets or Hospitals). It also provides an extreme case of the use of Heijunka that challenges the general belief that this tool can only be applied to certain environments (like Manufacturing). It proves to me that when dealing with true Lean Sigma tools, because they’re grounded on sound principles, the limits of their applications are the limits of our own creativity.

Monday, June 27, 2016

Multiple Regression. 

Reflections on a complex tool. 

Anybody with a basic math background knows the equation of a line is y = a + bx. We also know that the concept of Regression is to find a line that better adjusts or "fits" our data on a particular plane. Let us take, for example, y= 3+2x and add a random number from a normal distribution with a mean of 0 and s=5 to create some dispersion. There are many considerations for a sample size to be "enough" for Regression but let's take 40 as a rule of thumb (never less than 15). Those points on a graph could look like this: 

After fitting the regression line and adding a Confidence Interval (95%; green dotted lines in the image below), the graph will now show an area of probability where the true line is.

It can also be observed that approximately 95% of the variation in "y" could be explained by the variation in "x" (R-sq = 95%). Also,  S=5 (which we already knew) means the line equation +/- 2S should cover the area of where the value of "y" truly is at least 95% of the time (property of normal distribution). 

But this is all for the data that's already there. If we wanted to guess where the next value of "y" is going to fall using that same range for "x" then we use the Prediction Interval (95%; orange dotted lines in the image below).

This should be no surprise to anybody as it is obvious that your ability to predict where the next point is going to land depends on the overall variation of the system. Is like trying to throw an arrow with a shaking hand: most likely it will not land on the exact same place! 

Now let's add another axis using a different variable in an attempt to explain "y" better. This would add depth to our graph and we'll be working on a tridimensional space.

Because of software and time limitations, let's imagine: if you fit the line for "y" and "X1" and then extended across "X2" you have a plane (like ironing the wrinkles on the graph above). If the regression line remains at the exact same height it means that "X2" has no interaction with "X1". You can also add the Confidence and Prediction Intervals on the top and bottom of that plane. From here a lot of reflections can be made (some mindblowing): what's happening if the "X1" regression line twists across "X2" (like a helix)? what if it bends while traveling thru "X2"

This is only important where the regression equation is y = a + b(X1*X2). If there is no significant interaction and the equation is y = a + bX1 + cX2, then it could be seen as if the original regression with "X1" just gets tilted by the presence of "X2"... a much simpler case.

Anyway, multiple regression means that at least two variables are having a significant effect on the output been measured. The situation gets more complex as you add more "Xs" and they interact in different ways (like in real life, isn't it?) and even more if different types of variables are added (i.e. ordinal attributes). 

Regardless of how hard it gets, it is always beneficial to try to visualize it. The better the intuition, the fewer chances we are lost in the numbers.

Sunday, June 19, 2016

Non-parametric tools to compare two populations.
Pretty often you are looking at two data sets and wonder “if I use treatment B should I expect similar results than the ones obtained when using treatment A”. Next step, of course, you plot the data, pour yourself a cup of coffee and stare at the graphs from different angles. Unfortunately, they look oddly shaped and nothing seems to be wrong with the data collection. At this point, you uncross your fingers (crossed every time you expect the data to look Normal) and blame your bad luck. It might be one of those weird distributions that make everything more complicated.
The data could look like this:

Before you had look at the data you were thinking of performing the good old two sample t-test and be done with it. Now there are some doubts. If you look at the graph there seems to be a greater concentration of points on the lower end of dataset 1 but also one value lying higher than dataset 2; intuitively you would tend to expect a higher value from dataset 2 but is that statistically significant?   

You know that t-test uses an assumption of normality (actually T-student distribution which resembles normality in a “cautious” way) but also heard that is not absolutely necessary: for the most part, deviation from normality should not be that risky . So you go ahead and perform the test and the results come out like this:

Two-Sample T-Test and CI: dataset 1, dataset 2

Two-sample T for dataset 1 vs dataset 2

           N   Mean  StDev  SE Mean
dataset 1  40  12.13   2.21     0.35
dataset 2  40  12.61   1.59     0.25

Difference = μ (dataset 1) - μ (dataset 2)
Estimate for difference:  -0.482
95% CI for difference:  (-1.341, 0.376)
T-Test of difference = 0 (vs ≠): T-Value = -1.12 P-Value = 0.266 DF = 70

Based on those results you can conclude that both data sets came from the same population and thus treatment A is not different from treatment B. And that would be a wrong conclusion (you kind of saw that coming didn’t you?). One reason is that because of the skewness of the data sets, Mean or average is not the best statistic to measure central tendency. The use of Median seems to be better in this case. Another reason is that t-test is not too sensitive to deviations from normality but in this case that deviation is fairly high. The non-parametric way seems to be an option!
Three tools come to mind: Mann-Whitney; Kruskal-Wallis; Mood’s median test (statistician love putting their last names on everything).  
Mann-Whitney Test and CI: dataset 1, dataset 2

           N  Median
dataset 1  40  11.443
dataset 2  40  12.143

Point estimate for η1 - η2 is -0.716
95.1 Percent CI for η1 - η2 is (-1.293,-0.179)
W = 1357.0
Test of η1 = η2 vs η1 ≠ η2 is significant at 0.0115

Kruskal-Wallis Test: C5 versus C4

Kruskal-Wallis Test on C5

C4          N  Median  Ave Rank      Z
dataset 1  40   11.44      33.9  -2.53
dataset 2  40   12.14      47.1   2.53
Overall    80              40.5

H = 6.40  DF = 1  P = 0.011

Mood Median Test: C5 versus C4

Mood median test for C5
Chi-Square = 9.80    DF = 1    P = 0.002

                                 Individual 95.0% CIs
C4         N≤  N>  Median  Q3-Q1  -------+---------+---------+---------
dataset 1  27  13   11.44   2.11  (-------*---)
dataset 2  13  27   12.14   1.80                (----*-----------)
                                     11.40     12.00     12.60

Overall median = 11.75

A 95.0% CI for median(dataset 1) - median(dataset 2): (-1.54,-0.28)

In conclusion, in this example, the two data sets were in fact statistically different (that doesn’t mean they are practically different) so when distributions look crooked be careful with a t-test. Non-parametric analyses have a scary name but they actually are as simple as the parametric version (if not simpler).
By the way, the data did came from a distribution (Gamma) generated and analyzed with Minitab™ software (as you can obviously see).