Mar 2 2019
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 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:
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.
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.”
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.
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” 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.