The XBar-R pair of charts are the most commonly used charts in SPC. You will find the chart listed under may different names, including: XBar-R, XBar and Range, \(\bar{X}\) and R, Average-Range, and Mean-Range. A typical XBar-R chart consists of two graphs displayed one above the other. The top graph is the XBar chart, and the bottom graph is the R chart. The example below shows a typical XBar-R chart.

**XBar-R Chart – 1**

*The data used in the chart is pulled from the XBar-R chart example, Table 6-1, in the textbook Introduction to Statistical Quality Control 7th Edition, by Douglas Montgomery.*

The XBar-R chart is one of several chart types which fall under the general category known as **Shewhart ** **Variable Control Charts, **which is a general grouping of SPC chart types that work with quality data expressed as numeric values (i.e. 35.623412). The XBar-R chart monitors the trend of a critical process variable over time using a statistical sampling method that results in a subgroup of values at each subgroup interval. The XBar part of the chart plots the mean of each sample subgroup and the Range part of the chart monitors the difference between the minimum and maximum value in the subgroup. Superimposed control lines indicate whether or not the process being monitored is in or out of statistical control.

Statistically an XBar-R chart makes the most sense if you monitoring a process variable which can be sampled using a fixed subgroup size. The fixed subgroup size should be in the range of of 2-8 samples. For example, every 15 minutes you pull 7 items (out of 1000 produced in the same time period) off the line, measure them, and record the values as the samples for the subgroup at that sample interval. In that case the sample subgroup size would be 7. The XBar-R chart will still properly work for subgroup sizes greater than 8, but if the data is mostly normal about a mean and sigma value, the results should converge with that of a XBar-Sigma chart, which is generally used if the sample subgroup size is greater than 8. The XBar-R chart will not work if you use a subgroup size of 1, because that will always result in a R-value (range value) of 0.0 for every sub interval, since the minimum and maximum value for each subgroup is the same. If you look at the formulas for the control limits, you will see that it results in meaningless control limits. Also, if you are running crude tests of your SPC chart, and use a sample subgroup size of 2 to 8, but for each sub interval enter the same value, that too will fail for the same reason. Anything which results in a 0.0 Rbar range across all sample intervals is going to render the control limit calculations invalid. You can have a sample interval with a 0.0 range and that will most likely generate control limit violation for that sample interval in the R-chart. But all sample intervals can’t have 0.0 range. The Individual-Range chart (I-R chart for short) works around this limitation and you need to use it if you have a sample subgroup size of 1.

The initial setup of the chart typically involves establishing standardized control UCL (Upper Control Limit) and LCL (Lower Control Limit), and Target (Centerline) values, for both the Primary (XBar) and Secondary (Range) charts. These limits are calculated based on monitoring and sampling the process when it is running while “in control”. The formulas for XBar-R charts are listed below.

\(\Large{\bar{X_i}=\left(\frac{1}{M}\right)\sum_{j=1}^M X_j = \frac{(X_1 + X_2 + \cdots + X_M)}{M}}\)Each sample interval has M values, representing the sample subgroup size. The mean \({\bar{X_i}}\) or (XBar i value) for each sample interval is just the standard mean calculation using the data values (\(X_1, X_2, …, X_M\)) for that sample interval.

Let (\(\bar{X_1}, \bar{ X_2}, …, \bar{ X_M}\)) be the means of the N sample intervals. The \(\bar{\bar{X}}\) (mean of means, or XBarBar) is just the mean of the N \(\bar{X}\) ( or XBar), values.

Let* * (\(R_1, R_2, … R_n\)) * *be the ranges of the N sample intervals. Each range is calculated by taking the difference between the minimum and maximum value of the M sample values for each sample interval The average range \(\bar{R}\) (or RBar) is just the mean of these range values.

Assume that the test data in the chart above is such a run. You will find the raw sample data (5 samples per subinterval (M), 25 subintervals (N)) in the table section of the chart below in the Sample No1 to Sample No5 rows. The Mean row shows the calculated Mean (\({\bar{X_i}}\)) values for each sample interval. The Range row shows the calculated Range (\(R_i\)) value for each sample interval. These values are used to calculate the

\({\bar{\bar{X_i}}}\) and \({\bar{R}}\) values use in the charts Target, LCL and UCL formulas.

### Control Limits for the Xbar (top) chart

\(\Large{UCL= \bar{\bar{X}} + A_2 * \bar{R} }\\\) \(\Large{Target = \bar{\bar{X}}}\\\) \(\Large{LCL= \bar{\bar{X}} – A_2 * \bar{R}}\\\)where the constant* A*2 is tabulated for subgroup sizes 2-8 in the Table of **XBar-R Chart Factors** table below.

### Control Limits for the R (Range) – bottom chart

\(\Large{UCL= D_4 * \bar{R} }\) \(\Large{Target = \bar{R} }\) \(\Large{LCL= D_3 * \bar{R} }\)where the constants* D3 and D4 *are tabulated for various sample sizes in the **Table of XBar-R Chart Factors** table below.

** Table of XBar-R Chart Factors**

SubgroupSize | A2 | D3 | D4 |

2 | 1.88 | 0 | 3.267 |

3 | 1.023 | 0 | 2.574 |

4 | 0.729 | 0 | 2.282 |

5 | 0.577 | 0 | 2.114 |

6 | 0.483 | 0 | 2.004 |

7 | 0.419 | 0.076 | 1.924 |

8 | 0.373 | 0.136 | 1.864 |

9 | 0.337 | 0.184 | 1.816 |

15 | 0.223 | 0.348 | 1.652 |

20 | 0.18 | 0.414 | 1.586 |

25 | 0.153 | 0.459 | 1.541 |

**XBar-R Chart – 2 (Interactive)**

The initial chart represents a sample run where the process is considered to be in control. Therefore it is a suitable source of data to calculate the UCL, LCL and Target control limits. The control limit lines and values displayed in the chart are a result these calculations. What you don’t want to do is constantly recalculate control limits based on current data. Because once the process goes out of control, you will be incorporating these new, out of control values, into the control limit calculations, which will widen the control limits. Instead, as you move forward, you apply the previously calculated control limits to the new sampled data. When the process starts to go out of control, it should produce alarms when compared to the control limits calculated when the process was in control. You can simulate this using the interactive chart above.

When you select the **Simulate Data** button in the XBar-R Chart-2 chart above, the dialog below appears:

What it shows for the Mean value and Sigma value are the values calculated based on the current data. So if you simulate new sample intervals using these values, the result will be that the new values look like the old, and the process will continue to stay within limits. Even using these values, you will, however, get a random control limit violation on the order of every 1 in every 370 sample intervals. This is known as a false positive (alarm) and it is due to the probabilistic nature of SPC control charts. See the section on Average Run Length (ARL) for more details. But if you modify the Mean and/or the Sigma value slightly, you increase the odds, above that of the ARL value, that process exceeds the pre-established control limits and generates an alarm. So change the Mean value to 1.65, and the Sigma Value to 0.2. Now you are simulating the process has changed enough to alter the both the mean and variability of the process variable under measurement. Press the **Press to Add Data** button a couple of time to generated the simulated values, then exit the dialog by pressing OK. The new data values are appended to the existing data values, and you should be able to see the change starting at the 26th sample interval. Use the scrollbar at the bottom of the chart to scroll to the start of the simulated data. The picture below displays the simulation. Your picture may not look exactly the same, because the simulated data values are randomized, and your randomized simulation data will not match the values in the picture. But the general idea will be the same. You find a more generalized, and detailed discussion of how to work with the Interactive charts here:

If you want to try and plot your own data in the XBar-R chart, you should be able to do so using the Import Data option of the Interactive chart. Organize your data in a spreadsheet, where the rows represent sample intervals and the columns represent samples within a subgroup. Make sure you only highlight the actual data values, not row or column headings, as in the example below.

Copy the rectangle of data values from the spreadsheet and Paste them into the **Data input **box. By default, data values copied from a spreadsheet should be column delimited with the TAB character, and row delimited with the NEWLINE character. If so, our Data input box should be able to parse the data for chart use.

Select **OK**, and if the data parses properly you should see the resulting data in the chart. By default, data entered into the **Data input** box overwrites all of the existing data. That way you can create your own custom XBar-R chart, using only your own data. You start by entering in a batch of data

from an “in control” run of your process, and display the data in a new chart. Calculate new control limits based on this data, using the **Recalculate Limits** button. Should you want to enter in another batch of actual data from a recent run, and append it to the original data, go back to the **Import Data** menu option. This time select the Append checkbox instead of the default Overwrite data checkbox.

### General Issues with XBar-R Chart

**Normality of sampled data**

XBar-R charts generally assume that the underlying data approximates a normal distribution. That is to say that the values of the data can be characterized using a mean and sigma (standard deviation) value. Logically that forms the basis for looking for an out of control process by checking if average sample values for a sample interval are outside the 3-sigma limits of the process when it is under control. But real world sample data may not me strictly normal. There are a many different statistical distributions (normal, Poisson, binomial, hyper-geometric) which can be used to model the variation in sample data. In general, unless your data is extremely skewed, all of the averaging within sample intervals, and across sample intervals, will produce approximately normal results because of the Central Limit Theorem, which loosely states that sample subgroup means will produce a normal distribution about the overall population mean, even if the values within each sample subgroup are not normal.

**Variable sample subgroup size in XBar-R charts**

Many users want to cheat on the sampling within each sample interval, entering greater than, or less than, the fixed sample size specified in the setup. If this is a requirement, you should convert you chart to an XBar-Sigma chart,where this is an option. While it is possible to implement an XBar-R chart with variable sample size, it is not recommended. It will change the UCL and LCL control limits for the sample interval, for any change in the sample size, which is expected. This is because if you sample fewer than expected samples in a sample interval, the UCL, LCL control limits need to be wider to take into account the greater statistical variance inherent in a smaller sample subgroup size. But it will also shift the Target value in the Range chart, for any changes in sample size, which makes the chart harder to interpret. So if a varying sample subgroup size is an unchangeable aspect of your process, use the XBar-Sigma chart instead.