Methodology Glossary Tier 2 Statistical Process Control Introduction Statistical Process Control (SPC) is the application of statistical methods to monitor and analyse the variation present within a system or process. SPC assists in differentiating between ‘common cause’ and ‘special cause’ variation. These terms along with the concept of a ‘state of statistical control’ were used by Walter A. Shewhart, who pioneered SPC and the use of control charts in the early 1920s. ‘Common cause’ variation is that variation which is expected to exist within a stable process and is usually due to errors such as recording or measurement error. These sources of error will exist regardless of external factors, and will result in slight differences between measurements. Even two simultaneous measures of the same item are unlikely to give exactly the same result. ‘Special cause’ variation is the term given to variations caused by a factor other than those attributed to common causes. In other words, something has happened that has had an effect on the process and this should be investigated ‘Special cause’ variation could be the result of actions such as the implementation of a new policy, using new or damaged machinery or changes in staff numbers or skill. SPC has most frequently been applied to manufacturing lines. However, SPC also applies well to any process with a measureable output. For example, SPC has been used in the health service to identify possible outbreaks of infectious disease. SPC can assist with implementing continuous quality improvement and for this reason it is best used where the user has direct ‘control’ or a good understanding of the process. If you are unable to make changes in the process or don’t fully understand the causes of variation within a given system then it may be difficult to utilise the full potential of SPC. For an example of the theory behind statistical process control see Deming's famous Red Bead Experiment (http://www.maaw.info/DemingsRedbeads.htm), which helps to explain common cause variation. Charts used in SPC Central to SPC is the use of charts to monitor the variation within a process; there are a number of different charts that can be used. Run charts, also known as run-sequence plots, are the basic charts used in SPC, they consist of a central line (usually a historic average; see the describing numerical data Methodology Glossary paper for details on calculating averages) and the current data points, usually plotted against time. www.scotland.gov.uk/Topics/Statistics/About/Methodology/SPC Methodology Glossary Tier 2 Example Run chart A simple run chart showing data collected over time. The median of the observed data (73) is also shown on the chart as the ‘central line’. This chart shows a stable process with only common cause variation. Identifying ‘special cause’ variation using Run charts Run charts can be used to identify changes in a process which may be the result of a special cause. Typical indicators of a shift in the natural variability include unusually long "runs" of data points above or below the average line, repeating patterns in the data, and unusually long series of consecutively increasing or decreasing points. There exists a set of ‘rules’ with which run charts can be assessed. Where a chart is seen to follow the conditions of a certain rule the process is said to be ‘out of control’, or under the influence of ‘special cause’ variation. Three common identifiers of special causes are presented below along with examples: Shifts: If there are eight or more consecutive points on the same side of the centre line, that indicates that a special cause has influenced the process. Points on the centre line don't count; they neither break the string, nor add to it. Trends: Six consecutive points moving in the same direction indicate that a special cause is acting on the process to cause a trend. Flat line segments don't count; they neither break a trend, nor count towards it. Pattern: If there is a repeating arrangement of points that recurs eight or more times in a row, this may indicator a special cause has influenced the process.. www.scotland.gov.uk/Topics/Statistics/About/Methodology/SPC Methodology Glossary Tier 2 Example - Trend 10 8 8 6 6 Data 10 Year 2009 2007 2005 2003 2001 1999 1997 1995 1993 1991 1985 2009 2005 2007 2001 2003 1997 1999 1993 1995 1989 0 1991 0 1985 2 1989 4 2 1987 4 1987 Data Example - Shift Year Example - Pattern 10 Data 8 6 4 2 2009 2007 2005 2003 2001 1999 1997 1995 1993 1991 1989 1987 1985 0 Year To be able to fairly assess a run chart against these rules it is important that you have sufficient data points (usually said to be around 25 or more) and that the ordering of the points on the chart and any natural orderings are considered. If for example a chart was used to assess the number of cases of infection within a number of hospitals, then the ordering of the hospitals would affect whether the criteria for identifying special causes were met or not. It may be possible to detect special causes more accurately and quickly by using control charts. Control Charts, also known as Shewhart charts or process-behaviour charts are the most common tool used under SPC. Standard control charts are produced by calculating an average result for a time series of data, plotting this as the central line, as in run charts above, and then calculating control limits either side of this mean. These control limits are usually set at plus and minus three standard deviations from the central line. This range will account for approximately 99.7% of all natural, ‘common cause’, variation. www.scotland.gov.uk/Topics/Statistics/About/Methodology/SPC Methodology Glossary Tier 2 Example standard control chart This control chart shows a central line, upper and lower control limits and warning limits (the thin dashed red lines). Warning limits are usually set at plus and minus two standard deviations and indicate points where further investigation may be necessary, especially should a number of consecutive points fall between the warning and control limits. Producing Control Charts An important part of the control chart is obviously the setting of the limits used to identify points where the system is ‘out of control’. There are a number of formulae that are used to produce these limits, and each is dependant on the type of chart being used and certain characteristics of the data. Below are some of the most commonly seen formulae for calculating control limits: For “p-charts”, where the data are proportions the following formula is used: Control Limits = p 3 p (1 p ) n Where: p = historical average proportion n = number of opportunities A “c-chart” control chart is produced for count data with n observations each with a constant ‘area of opportunity’. Where counts are involved we the following formula is used: Control Limits = c 3 c Where: c = historical average count This formula assumes that the data follows a Poisson distribution, as the standard deviation of a Poisson distribution can be estimated by the square root of the mean. Where the data does not follow a Poisson distribution the following formula is used for counts: www.scotland.gov.uk/Topics/Statistics/About/Methodology/SPC Methodology Glossary Tier 2 Control Limits = 3 Where: = Mean value of the data = Standard Deviation of the data Identifying special cause variation using control charts If the process is in a ‘state of control’ then the sample means will fall within the control limits about 299 times out of 300 (where three standard deviations have been used for the limits). Any points where the sample means fall outside the control limits should be investigated further, as something may be affecting the system and the quality of outputs may be affected. Other Chart Types Run charts and Control charts are the most commonly used charts in SPC however there are a number of others that can be used under certain circumstances. For example where you are comparing performance in different areas with differing population sizes, a funnel plot may be most suitable. A funnel plot gets its name from the shape of the control limits; as they narrow as the population increases. This is the case because as the underlying population increases the estimates made should be more accurate and so less fluctuations and natural variation is expected to occur. Choosing which type of control chart to use (APHO, Technical Briefing – Statistical process control methods in public health intelligence, December 2007) Using SPC Statistical Process Control may be broadly broken down into three sets of activities: understanding the process; understanding the causes of variation; and elimination of the sources of special cause variation. www.scotland.gov.uk/Topics/Statistics/About/Methodology/SPC Methodology Glossary Tier 2 In understanding a process, the process is typically mapped out and the variations in the process are monitored using control charts, this is a continuous, ongoing activity. When excessive variation is identified by the control chart, additional effort is exerted to determine the causes of that variance. Once the causes of variation are understood, if it is wished for the process to return to a state of control then the cause of variation can be investigated further and removed. Once the process is back under control, the points outwith the limits should be disregarded in any future calculation of the central line and / or limits. It is important when using SPC to be aware that not every point identified by a control chart as ‘out of control’ will be the result of a special cause. As indicated above, by chance alone you would expect one in twenty points to fall outwith the two sigma limits and about one in three hundred points to fall outwith control limits based on three standard deviations. It is therefore important that when a point falls outwith the limits it is investigated in detail to decide whether it is the result of a ‘special cause’ or just a chance occurrence. This emphasises the need to have a good understanding of the process being measured under SPC to make full use of the technique. If you have any questions on using Statistical Process Control in the Public Sector please feel free to contact the Office of the Chief Statistician, Scottish government, who may be able to provide you with some support and / or advice: Analysts.Network@Scotland.gsi.gov.uk or 0300 244 1015 Related Paper Tier 1 Describing Numerical data www.scotland.gov.uk/Topics/Statistics/About/Methodology/SPC