Mar 2 2019

# The Math Behind The Process Behavior Chart

Ever since asking Is SPC Obsolete? on this blog almost 6 years ago, multiple sources have told me that the XmR chart is a wonderful and currently useful process behavior chart, universally applicable, a data analysis panacea, requiring no assumption on the structure of the monitored variables. So I dug into it and this what I found.

## What’s an XmR chart?

Here is an example of what these charts look like:

### The X chart and the mR chart

The top chart shows individual measurements over time; the bottom one, a moving range based on the last two values. What makes this more than a plain times series charts — the likes of which are found in as unsophisticated a publication as USA Today — is the red dashed lines marking control limits.

*Misleading time series from USA Today*

## How control limits are set

The method for setting these limits is essential to the tool.

### The Recipe

The limits are multiples of the average of the moving range . What the literature tells you is that, for the chart of individual values, the limits are at:

and for the range at

### Concerns about the formulas

The readers are discouraged from worrying their heads with the provenance of these numbers, and the closest they get to an explanation is a reference to a table where such coefficients are kept, and this table was generated by a higher authority. No further explanation is found in the books I have seen by Douglas Montgomery, J.M. Juran, or Don Wheeler.

The assertion that these numbers are valid regardless of the data’s variation pattern strains credulity. Clearly, they did not come out of thin air. There is a theory behind them, that theory is based on assumptions about the data, and it is necessary for users to know these assumptions so that they can understand the domain of applicability of the technique, with its blurry boundaries.

You may still get some use out of the technique when the conditions are not fully met but you should do so knowingly. As discussed in an earlier comment, chemical engineers commonly apply formulas for perfect gases to gases they know aren’t perfect.

### The math of limit setting

Not finding this information for the XmR chart, I undertook to work it out myself, starting with the model implicit in the SPC literature, that a process variable *X* is the sum of a constant *C* with a white noise *W*. Formally, for the i-th measurement,

where the are independent Gaussian (also known as “Normal”) variables with 0 mean and standard deviation σ. Let us consider the differences between consecutive variables and :

As sums of two independent Gaussian variables with 0 mean and standard deviation σ, they are also Gaussian, with 0 mean and standard deviation . The range is the absolute value of this difference:

and follows the Half-Gaussian distribution. The mean of the range is:

and therefore:

which results in:

For the standard deviation of the moving range, we have:

This means that, for R, the upper control limit is:

This derivation confirms that the published coefficients are based on the assumption that the monitored variable is Gaussian. Of course, it doesn’t *prove* it but it is highly unlikely that any other distribution would produce the exact same coefficients.

## Interpretation

We need to consider the two charts separately.

### The X chart

The X chart is simply a plot of the raw time series and, as long as the model holds, 99.7% of the points will be within ±3σ of . This is now commonly described as saying that the “p-value” of checking against these limits is 0.3%.

Generally, the p-value of a sample statistic is the probability that it will be outside its limits when all the data are generated from the reference model. P-values are often used today because they are more general and less arbitrary than levels of significance, and easy to calculate. A 95% level of significance means and 99%, . Running multiple tests against the same data until you find one that gives you a “significant” difference is called p-hacking.

### The mR chart

The p-value of the mR chart, however, is higher, meaning that it is more prone to false alarms. In terms of , the mR chart’s upper control limit is

and the standard deviation of the differences is

If we plug these numbers into the formula for the cumulative distribution function of the half-gaussian, we get:

As can be easily verified with simulations, this yields an average of 1 false alarm for every 100 points, which is three times more than the X chart. If the process is unstable, there are so many genuine alarms for the engineering team to investigate that false alarms won’t be a problem.

If, on the other hand, it is so stable that it never goes out of control, the chart will still generate alarms and they will all be false. After two or three cases of assembling a task force to chase non-existent assignable causes, management will lose confidence in the chart.

## Don Wheeler’s reasons for plotting mR charts

XmR chart expert Don Wheeler offers the following, not-fully compelling reasons to plot mR charts:

- “The Moving Range Chart will, on occasion, provide new information in addition to reinforcing the message of the X Chart.”
- “Thus, the mR Chart is the secret handshake of those who know the correct way of computing limits for an X Chart. Omit it and your readers cannot be sure that you are a member of the club.”
- “The mR Chart allows you and your audience to check for the problem of chunky data. This is a problem that occurs when the data have been rounded to the point that the variation is lost in the round-off.”

### New information?

The mR chart is indeed a summary of the X chart and, as such, may provide new information. The questions are whether it is worth the trouble to maintain it and whether there are no other tools from time series analysis to get the same information more easily.

### Club membership

The point of visualizing and analyzing quality characteristics is to troubleshoot a process, not to secure the approval of others or prove membership in any club. The inventors of these techniques didn’t have professional societies looking over their shoulders and checking their work for conformity to standards. The same problems should be addressed in the same spirit today.

### Chunky data

“Chunky data” is a real problem. I remember a case where operators had manually measured the thickness of a plate at its four corners, with calipers that gave four significant digits, which they had rounded to two. Unfortunately, the information we were looking for was in the digits they had rounded off. We didn’t, however, need an mR chart to find out. It was visible in the paper spreadsheet. The risk of this happening is almost entirely eliminated in automatic data acquisition from sensors, instruments, and IIoT devices.

Lonnie Wilson

March 2, 2019@ 9:21 amMichel,

Sweet derivation, not sure I could do those anymore. However, long ago i learned those fudge factors were based on the normal distribution and I am sure I could find it in some book of mine. However the person who said “…that the X-mR chart is a wonderful and currently useful process behavior chart, universally applicable, a data analysis panacea, and requiring no assumption on the structure of the monitored variables….” is not living in any world I have seen that might create data usable on a conrol chart. A few years ago, like maybe 20…Donald Wheeler started hard selling the XmR and as Wheeler is a really bright guy, he could use it properly for for variety of data. That however is not true for eveyone. The interpretation of any control chart IS NOT INDEPENDENT of the raw data used. However in my practical experience the underlying assumption of normality is infrequently a limitation to process improvement. This is due to two factors. Both the quality of the data and the quality of the process analyzed are so far from “good” that you do not need a very sharp instrument to make progress. However if you continue to work with that data and work with that process, it is important to understand the limitations of the tools you are using. You can carve a turkey with a 10″ kitchen knife or a surgeon’s scalpel ….. likewise you can take out an appendix with a either tool. If you are going to use these tools, it usually works best if you understand them. I find that thought to be not only revolutionary but couinter cultural to many trying to solve problems today…..

Nice posting

My 2 cents worth

Judy Dayhoff

March 2, 2019@ 9:58 pmHow about averaging 5 or more data points and using the central limit theorem to make the average from a normal distribution?

Michel Baudin

March 5, 2019@ 5:05 pmThis is just about working out the math behind a tool other people recommend. It’s about understanding it, not promoting or discouraging its use.

Lonnie Wilson

March 15, 2019@ 8:37 amI read this comment and I said, “Who is this guy and where has Michel Baudin gone??” I have known Michel for about 10 years mostly through blog postings and later when he proposed to exchange books we had respectively written. To me he was a very practical, hands on type of guy, so all this discussion of the math theory as it applied to a process improvement tool — totally threw me off. I could not believe what I was reading and I went on a journey to find my friend Michel. Lo and behold I found him in his bio, which obviously I had not read carefully enough, — it says, “trained in …. applied math”.

So now that I have found my friend I will bow out of this discussion, because although all this theory is interesting, when it comes to process improvements, it is largely, not completely, but largely irrelevant.

Renaud Anjoran

March 3, 2019@ 12:20 pmOh, yes, data are assumed to be normally distributed. Not the *underlying* data, but the means of those data (that’s why it’s called “Xbar” or “Xm”. See https://en.wikipedia.org/wiki/Central_limit_theorem.

I am not sure it’s true in the vast majority of cases, but I would tend to believe it’s true in most cases.

Or did I miss something? I am certainly no authority on this topic.

Matt Kelly

March 5, 2019@ 2:59 pmGreat read Michael. I am currently doing similar calculations in my Customer Analytics course. I also want to use these equations as they may help me with a school project I am working on involving an inefficient cleaning process. I will be back for more, Thanks !

Scott Hindle

March 14, 2019@ 4:40 amIn this free-to-access paper , Dr. Wheeler delves into the robustness of the d2 values that leads to the scaling factor of 2.66 (where 3/1.128=2.66) stated towards the start of this paper.

Hence, while the normal distribution provides the theoretical value of 1.128 for d2, Wheeler discusses what departures from normality mean in practice, not theory, where we have a limited no. of data and not an infinite amount.

I find XmR charts tremendously useful. The trick is in knowing how to use them to good effect. The “way of thinking” is the hard part I find. For example, how frequent should data be collected to achieve a meaningful, insightful XmR chart? The importance of this question is, I think, too little appreciated. Get the answer wrong and the XmR chart can be more problematic than helpful.

Michel Baudin

March 14, 2019@ 4:17 pmIf you don’t mind, I prefer to call the distribution “gaussian” rather than “normal” because of the implication in everyday speech that every other distribution is, in some way “abnormal.”

What I show in my post is that you can derive the control limits of the XmR chart straight from the properties of the gaussian distribution without introducing the or .

In his paper, Wheeler considers a limited range of distributions. They are all unimodal and just have nonzero skewness and kurtosis. The universe of possible product characteristics, however, is not this restrictive. Following are a few examples you might encounter: