Minitab Cookbook — Save 50%
Over 110 practical recipes to explore the vast array of statistics in Minitab 17 with this book and ebook
This article, by Isaac Newton, author of Minitab Cookbook, will help you understand the different process variations that can be done in control charts using Minitab. Control charts are very simple graphical tools which show us if measurements/results are stable over time. They look at the mean and variation of the data and check to see whether the observed data shows any patterns that would not be expected to occur if the data was purely random. This special cause variation is indicated by tests that look for these patterns. They are based on there being a low probability of these patterns occurring randomly. Minitab provides a wide range of control charts for different scenarios. These include the standard control charts for monitoring a process over time such as XbarR or IMR charts as well as multivariate control charts and charts to plot rare events. Now, we will look at using some of the more traditional charts, but also show the use of some of the newer charts in Minitab.
(For more resources related to this topic, see here.)
XbarR charts and applying stages to a control chart
As with all control charts, the XbarR charts are used to monitor process stability. Apart from generating the basic control chart, we will look at how we can control the output with a few options within the dialog boxes. XbarR stands for means and ranges; we use the means chart to estimate the population mean of a process and the range chart to observe how the population variation changes.
For more information on control charts, see Understanding Statistical Process Control by Donald J. Wheeler and David S. Chambers.
As an example, we will study the fill volumes of syringes. Five syringes are sampled from the process at hourly intervals; these are used to represent the mean and variation of that process over time.
We will plot the means and ranges of the fill volumes across 50 subgroups. The data also includes a process change. This will be displayed on the chart by dividing the data into two stages.
The charts for subgrouped data can use a worksheet set up in two formats. Here the data is recorded such that each row represents a subgroup. The columns are the sample points. The XbarS chart will use data in the other format where all the results are recorded in one column.
The following screenshot shows the data with subgroups across the rows on the left, and the same data with subgroups stacked on the right:
How to do it…
The following steps will create an XbarR chart staged by the Adjustment column with all eight of the tests for special causes:
 Use the Open Worksheet command from the File menu to open the Volume.mtw worksheet.
 Navigate to Stat  Control Charts  Variables charts for subgroups. Then click on XbarR….
 Change the drop down at the top of the dialog to Observations for a subgroup are in one row of columns:.
 Enter the columns Measure1 to Measure5 into the dialog box by highlighting all the measure columns in the left selection box and clicking on Select.
 Click on XbarR Options and navigate to the tab for Tests.
 Select all the tests for special causes.
 Select the Stages tab.
 Enter Adjustment in the Define Stages section.
 Click on OK in each dialog box.
How it works…
The R or range chart displays the variation over time in the data by plotting the range of measurements in a subgroup. The Xbar chart plots the means of the subgroups.
The choice of layout of the worksheet is picked from the dropdown box in the main dialog box. The All observations for a chart are in one column: field is used for data stacked into columns. Means of subgroups and ranges are found from subgroups indicated in the worksheet. The Observations for a subgroup are in one row of columns: field will find means and ranges from the worksheet rows.
The XbarS chart example shows us how to use the dialog box when the data is in a single column. The dialog boxes for both XbarR and XbarS work the same way.
Tests for special causes are used to check the data for nonrandom events. The XbarR chart options give us control over the tests that will be used. The values of the tests can be changed from these options as well. The options from the Tools menu of Minitab can be used to set the default values and tests to use in any control chart.
By using the option under Stages, we are able to recalculate the means and standard deviations for the pre and post change groups in the worksheet. Stages can be used to recalculate the control chart parameters on each change in a column or on specific values. A date column can be used to define stages by entering the date at which a stage should be started.
There's more…
XbarR charts are also available under the Assistant menu. The default display option for a staged control chart is to show only the mean and control limits for the final stage. Should we want to see the values for all stages, we would use the XbarR Options and Display tab. To place these values on the chart for all stages, check the Display control limit / center line labels for all stages box. See XbarS charts for a description of all the tabs within the Control Charts options.
Using an XbarS chart
XbarS charts are similar in use to XbarR. The main difference is that the variation chart uses standard deviation from the subgroups instead of the range. The choice between using XbarR or XbarS is usually made based on the number of samples in each subgroup. With smaller subgroups, the standard deviation estimated from these can be inflated. Typically, with less than nine results per subgroup, we see them inflating the standard deviation, which increases the width of the control limits on the charts. Automotive Industry Action Group (AIAG) suggests using the XbarR, which is greater than or equal to nine times the XbarS.
Now, we will apply an XbarS chart to a slightly different scenario. Japan sits above several active fault lines. Because of this, minor earthquakes are felt in the region quite regularly. There may be several minor seismic events on any given day. For this example, we are going to use seismic data from the Advanced National Seismic System. All seismic events from January 1, 2013 to July 12, 2013 from the region that covers latitudes 31.128 to 45.275 and longitudes 129.799 to 145.269 are included in this dataset. This corresponds to an area that roughly encompasses Japan.
The dataset is provided for us already but we could gather more uptodate results from the following link:
http://earthquake.usgs.gov/monitoring/anss/
To search the catalog yourself, use the following link:
http://www.ncedc.org/anss/catalogsearch.html
We will look at seismic events by week that create XbarS charts of magnitude and depth. In the initial steps, we will use the date to generate a column that identifies the week of the year. This column is then used as the subgroup identifier.
How to do it…
The following steps will create an XbarS chart for the depth and magnitude of earthquakes. This will display the mean, and standard deviation of the events by week:
 Use the Open Worksheet command from the File menu to open the earthquake.mtw file.
 Go to the Data menu, click on Extract from Date/Time, and then click on To Text.
 Enter Date in the Extract from Date/time column: section.
 Type Week in the Store text column in: section.
 Check the selection for Week and click on OK to create the new column.
 Navigate to Stat  Control Charts  Variable charts for Subgroups and click on XbarS.
 Enter Depth and Mag into the dialog box as shown in the following screenshot and Week into the Subgroup sizes: field.
 Click on the Scale button, and select the option for Stamp.
 Enter Date in the Stamp columns section.
 Click on OK.
 Click on XbarS Options and then navigate to the Tests tab.
 Select all tests for special causes.
 Click on OK in each dialog box.
How it works…
Steps 1 to 4 build the Week column that we use as the subgroup. The extracts from the date/time options are fantastic for quickly generating columns based on dates. Days of the week, week of the year, month, or even minutes or seconds can all be separated from the date.
Multiple columns can be entered into the control chart dialog box just as we have done here. Each column is then used to create a new XbarS chart. This lets us quickly create charts for several dimensions that are recorded at the same time. The use of the week column as the subgroup size will generate the control chart with mean depth and magnitude for each week.
The scale options within control charts are used to change the display on the chart scales. By default, the x axis displays the subgroup number; changing this to display the date can be more informative when identifying the results that are out of control. Options to add axes, tick marks, gridlines, and additional reference lines are also available. We can also edit the axis of the chart after we have generated it by doubleclicking on the x axis.
The XbarS options are similar for all control charts; the tabs within Options give us control over a number of items for the chart. The following list shows us the tabs and the options found within each tab:
 Parameters: This sets the historical means and standard deviations; if using multiple columns, enter the first column mean, leave a space, and enter the second column mean
 Estimate: This allows us to specify subgroups to include or exclude in the calculations and change the method of estimating sigma
 Limits: This can be used to change where sigma limits are displayed or place on the control limits
 Tests: This allows us to choose the tests for special causes of the data and change the default values. The Using IMR chart recipe details the options for the Tests tab.
 Stages: This allows the chart to be subdivided and will recalculate center lines and control limits for each stage
 Box Cox: This can be used to transform the data, if necessary
 Display: This has settings to choose how much of the chart to display. We can limit the chart to show only the last section of the data or split a larger dataset into separate segments. There is also an option to display the control limits and center lines for all stages of a chart in this option.
 Storage: This can be used to store parameters of the chart, such as means, standard deviations, plotted values, and test results
There's more…
The control limits for the graphs that are produced vary as the subgroup sizes are not constant; this is because the number of earthquakes varies each week. In most practical applications, we may expect to collect the same number of samples or items in a subgroup and hence have flat control limits.
If we wanted to see the number of earthquakes in each week, we could use Tally from inside the Tables menu. This will display a result of counts per week. We could also store this tally back into the worksheet.
The result of this tally could be used with a cchart to display a count of earthquake events per week.
If we wanted to import the data directly from the Advanced National Seismic System, then the following steps will obtain the data and prepare the worksheet for us:
 Follow the link to the ANSS catalog search at http://www.ncedc.org/anss/catalogsearch.html.
 Enter 2013/01/01 in the Start date, time: field.
 Enter 2013/06/12 in the End date, time: field.
 Enter 3 in the Min magnitude: field.
 Enter 31.128 in the Min latitude field and 45.275 in the Max latitude field.
 Enter 129.799 in the Min longitude field and 145.269 in the Max longitude filed.
 Copy the data from the search results, excluding the headers, and paste it into a Minitab worksheet.
 Change the names of the columns to C1 Date, C2 Time, C3 Lat, C4 Long, C5 Depth, C6 Mag. The other columns, C7 to C13, can then be deleted.
 The Date column will have copied itself into Minitab as text; to convert this back to a date, navigate to Data  Change Data Type  Text to Date/Time.
 Enter Date in both the Change text columns: and Store date/time columns in: sections.
 In the Format of text columns: section, enter yyyy/mm/dd.
 Click on OK.
 To extract the week from the Date column, navigate to Data  Date/Time  Extract to Text.
 Enter 'Date' in the Extract from date/time column: section.
 Enter 'Week' in the Store text column in: field.
 Check the box for Week and click on OK.
Over 110 practical recipes to explore the vast array of statistics in Minitab 17 with this book and ebook 
Using IMR charts
IMR charts are used to plot single values over time. Individuals charts are typically used when we have single measurements at a point of time or at every result. Examples might include the production of smaller volumes such as aircraft or perhaps aircraft engines. Other scenarios might include situations where data collection is automated and all results are captured. The individual values are plotted against the overall mean and the moving range tracks variation by looking at differences between the results. Unlike XbarR or XbarS, which use a sample or subgroup to estimate the mean and variation, an IMR chart estimates the short term variation from the average moving range. This is based on the successive differences between the individual values.
Here, we will use the values of temperature from the Oxford weather station to check the stability of temperature. Temperature is a seasonal value and we will look at the measurements separately by month. As the temperature data has been given to us in the form of the mean maximum daily temperature for each month, there are no logical subgroups into which to divide the data. We will therefore plot the temperature as individual values.
As temperatures show a high degree of seasonality across the year, it would not be sensible to plot all of the original temperature data as a control chart. Therefore, we will plot the temperature for a single month instead. In this recipe, we will plot the temperature for January from every year from the start of record keeping to the present day..
We will first split the worksheet by month, before running the IMR chart on the results for January.
Getting ready
The data for this example can be found on the MET office website at the following address:
http://www.metoffice.gov.uk/climate/uk/stationdata/oxforddata.txt
Copy the data into Minitab and label the columns Year, Month, T Max, T Min, AirFrost(days), Rain(mm), and Sun(Hours).
This data is also available from the Oxford weather.txt file or the Oxford Weather (Cleaned).mtw file.
How to do it...
The following steps will create a new worksheet for each month and then generate an IMR chart for mean maximum and minimum January temperatures:
 Go to the Data menu and click on Split Worksheet.
 Enter the Month column as By variables:.
 Click on OK.
 Select the worksheet for Month = 1 for the January temperatures.
 Navigate to Stat  Control Charts  Variables Charts for Individuals and click on IMR.
 Enter the columns for 'T Max' and 'T Min' as Variables.
 Click on the Scale button and enter Year in the Stamp columns field by selecting the options as shown in the following screenshot:
 Click on OK.
 Select the IMR options button, then choose the tab labeled Tests, and select Perform all tests for Special causes.
 Click on OK in each dialog box.
How it works…
Each column entered into the variables section for IMR charts will create a separate control chart. We have created charts for both the mean maximum temperatures and the mean minimum temperatures for January from the start of the data in 1853.
Results that break the rules for identifying special causes or unusual variation are flagged in red with the test that has been broken. In the results shown in the preceding screenshot, Test 1 is flagged up for years 1917 and 1963 on the moving range chart. This seems to indicate a large change in temperatures from 1916 to 1917 and 1962 to 1963. Notice the result in the individuals' chart for 1963. This corresponds to one of the coldest winters in the UK since records began.
Some care should be taken with the interpretation of the previous results as adjacent points are one year apart.
The use of the Scale option, Stamp, allows us to use a column in the worksheet for the x axis labels. By displaying the year instead of the row number as the index, we can identify the years which contain unusual results. If the graph is the active window pop up, text highlighting the year will be displayed when we hover the cursor over a point.
IMR charts, like most control charts, are an updating graph within Minitab. We can rightclick on the chart and click on Update Graph Now when new data is entered or click on Update Graph Automatically.
Timeweighted charts are more appropriate than IMR charts if we are interested in observing small changes. Advanced charts such as CUSUM or EWMA can be used to pick up on these smaller shifts in the process. See the example of the EWMA chart later as a comparison.
There's more…
As the dialog boxes in Minitab remember previous settings, we can easily generate the charts for the other months by selecting one of the other worksheets. Go back to the previous dialog box using CTRL + E, and all we need to do is click on OK to run the same settings on the new worksheet. This can be automated by the use of macros. The macro command Worksheet can be used to specify a worksheet to make it active.
Defaults for the tests used in control charts can be specified from Tools and Options, as shown in the following screenshot:
The preceding screenshot shows the location of the options. Here it is possible to pick the tests to be used by default and the values of those tests. While Minitab uses the most common values of these tests, often test 2 is set at 7 or 8 points in a row rather than 9. This would make the test more sensitive to a process shift at the cost of increasing the risk of a false alarm.
An alternative method of selecting the results of January for the IMR chart would be to use the Data Options button from the dialog box.
Here we can specify which rows to include or exclude from the study in the same manner as in the Subset Worksheet option.
Using CUSUM charts
A CUSUM chart is used to look for small shifts from a target. There are two types of CUSUM chart that Minitab will generate: Onesided CUSUM charts, which we will use here, or the twosided or Vmask CUSUM.
CUSUM charts like EWMA charts can be useful when subgrouping of the data for an Xbar chart is not feasible and the IMR chart is not sensitive enough. These may include scenarios where we have low production volumes, or where sampling can be prohibitively expensive or potentially destructive.
The data in this example looks at the fill volumes of syringes. There is a target volume of 15 ml. We will plot the CUSUM using a subgroup size of one to identify deviations from this target.
How to do it...
The following steps will generate a CUSUM for a target of 15 and a subgroup size of 1:
 Use Open Worksheet… from the File menu to open the Volume2.mtw worksheet.
 Navigate to Stat  Control Charts  TimeWeighted Charts and select CUSUM….
 Enter Volume and enter Subgroup size: as 1 and the target as 15.
 Click on OK to create the CUSUM.
How it works…
The default plan type is the onesided CUSUM. This plots two lines. The top line detects upwards shifts from the target and the lower CUSUM detects downward shifts. The type of CUSUM can be changed in CUSUM Options and the Plan/Type tab.
The values of h and k for the CUSUM plan affect the sensitivity of the CUSUM. In a onesided CUSUM, h, the decision interval is the number of standard deviations between the center line and the control limits. The value of k affects the drift to be detected. Default figures of h and k are 4 and 0.5.
The Plan/Type tab also has options to select Fast Initial Response (FIR) and the twosided CUSUM can be centered on a given subgroup.
The results can be compared with an IMR chart using a historical mean of 15. By looking at the cumulative sum away from target, the CUSUM becomes more sensitive at identifying the small shifts away from target.
Summary
In this article, you understood how control charts are used to monitor the stability of a process. Here, we looked at the use of the familiar XbarR, IMR charts, and also went on to look at the more complex Laney control charts and rare event charts.
Resources for Article:
Further resources on this subject:
 Reports and Statistics in OpenX Ad Server [Article]
 Excel 2010 Financials: Adding Animations to Excel Graphs [Article]
 Working with Different Types of Interactive Charts [Article]
Over 110 practical recipes to explore the vast array of statistics in Minitab 17 with this book and ebook 
About the Author :
Isaac Newton
It was probably inevitable that, after being gifted with the name Isaac, he discovered he was really good at mathematics and science.
Isaac Newton studied physics at Leicester University and is one of the few people to have an MPhys in Space Science and Engineering. MPhys degrees later changed to MSci after only two years. Yes, he has heard the joke or comment you are just thinking about. After a short stint of postgraduate studies at Birmingham University, he joined Minitab in 1999, where he has been helping the users of Minitab and taking training courses ever since.
Apart from introducing Minitab courses and the basic statistical tools, he has the pleasure of teaching reliability statistics, design of experiments, macro writing, and time series, among other subjects. Recently, he was extensively involved in mentoring others in their own projects and assisting them on getting the most out of their data.
Books From Packt
