Your Training Partner
Techniques Toolbox
Run chart of the defects found each week in acceptance testing over 25 weeks. The median of weeks 1 to 13 is 15 defects and extends to the right. A checklist for the requirements review comes into use in week 14. From week 16 to week 25, nine points in a row fall below the median. The point of week 22 falls on the median and does not count.

Run chart

A run chart is a line chart that plots a measurement in time order and takes its median as the centre line. The team reads it with probability rules. A long series of points on one side of the median or a series of points that rise or fall without a break signals non-random variation. So do too few or too many alternations around the median and a point far from all the others. The chart needs neither control limits nor an assumption about the distribution of the data. The team can read it from about a dozen points. It takes its name from its runs. A run is a sequence of consecutive points on the same side of the median.

Goal

The run chart is a monitoring chart: it plots each value of a measurement in date order and shows where it falls relative to the median. It shows whether the measurement has changed and from which point.

Descriptive statistics summarise a period and ignore the order of its values. A mean before a change and a mean after it say that an indicator has fallen. They say neither when the fall starts nor whether it lasts. Perla, Provost and Murray show three units that have the same mean and the same standard deviation before and after an improvement. In the first, the gain holds. In the second, the fall had started before the change. In the third, the gain fades. Only the order of the points tells the three stories apart.

The deliverable is the annotated chart: the dated points, the median of the baseline period, the changes introduced, the rule that gave a signal and the point where it fired. From it the team reads the effect of a change and decides whether to keep the change, correct it or drop it.

A control chart plots the same points with the mean and control limits. The run chart replaces the mean with the median and has no limits. It does not say whether the process is stable: that question belongs to the control chart.

Usage

When to use it

  • Improvement under way: follow the indicator point by point and see whether the change works before the baseline is long enough for control limits.
  • Before-and-after comparison: show when the effect starts.
  • Before calculating control limits: a series that gives a signal cannot be the baseline of a control chart.
  • A worrying value this week: check whether it extends a shift or a trend before asking anyone to explain it.
  • After an improvement: in the Control phase of a DMAIC project, check that the gain holds.

When not to use it

  • A question of stability or predictability: the run chart does not settle it. Draw a control chart.
  • Measurements with no time order: a batch measured at one time has no chronology. Describe its distribution with a histogram.

Description

The elements

The horizontal axis carries the time order: days, weeks or successive cases when each request or each delivery gives one value. The vertical axis carries the measurement: a count, a rate, a lead time.

The centre line is the median: the value that leaves as many points above it as below it. Each point has an even chance of falling above the median. The reading rules rest on this probability. An extreme value does not move the median.

The baseline period covers the points recorded before the change. The team calculates the median from these points only. If the period shows no signal, the team freezes the median and extends it over the following points. The annotations place the changes introduced and the known events on the time axis: a new procedure, a migration, a reduced team during the holidays. A target line may be added. The rules ignore it.

A run is a sequence of consecutive points on the same side of the median. A point on the median neither extends nor breaks the current run. The number of runs is one more than the number of times the line crosses the median. The useful observations are the points that do not fall on the median. The thresholds of the rules depend on their number.

Building the run chart

  1. Define the measurement, the time unit and the rule set. The team writes down what it counts, within which scope and at what interval: the defects found per week in user acceptance testing (UAT) or the lead time of each request in order of closure. Outside IT, a cantonal administration can plot the processing time of each case file. The definition stays the same for the whole period of monitoring. A definition that changes produces a shift that the rule reports as an effect. A raw count also depends on the volume processed. When the volume varies from one period to the next, the team plots a rate, for example the defects per 100 test cases run. If half the values or more fall at 0 or 100%, the median sits on the boundary. The team then plots the time elapsed between two events. Finally, the team chooses the rule set before data collection begins.
  2. Record the values. The values come from a system, an export or a check sheet kept at the workstation. Each value keeps its date.
  3. Plot the points. The team plots one point per period in time order and joins each point to the previous one.
  4. Calculate the median of the baseline period. The team sorts the values of the period and takes the middle value. For an even number of values, the median is the mean of the two middle values. The team draws the median as a horizontal line and marks the date of the change on the axis.
  5. Check the baseline period. The team applies the rules to the points of the period alone. Without a signal, it freezes the median and extends it to the right. A signal shows that the period already contains a change. The team looks for its cause before it takes the period as the baseline.
  6. Plot the new points and apply the rules. The team reads each new point against the frozen median.
  7. Interpret the signal. A signal shows that something has changed. It does not show what. The team checks the date of the signal against the annotations: the change introduced, another modification of the process, a new way of counting. The reading takes judgement and knowledge of the context. Once the target is reached, Anhøj and Olesen recommend that the team calculate a new median from the points after the change or take the target as the new median.

The rules of Perla, Provost and Murray

Rules 1 to 3 look for patterns that chance alone produces with a probability below 5%. Rule 4 is a matter of judgement.

Shift
6 points in a row below the median
Trend
5 points that rise
Too few runs
4 runs for 20 points
Too many runs
20 runs for 20 points
Astronomical point
1 point far from all the others
The patterns that the rules of Perla, Provost and Murray look for. Each panel fires its own rule and no other. Shift: 6 points in a row below the median. Trend: 5 points that rise. Too few runs: 4 runs for 20 points. The lower limit is 6. Too many runs: 20 runs for 20 points. The upper limit is 16. Astronomical point: 1 point far from all the others.
RuleSignalHow to count
1. Shift6 or more consecutive points all above or all below the medianA point on the median is skipped. It does not count and does not break the run.
2. Trend5 or more consecutive points all rising or all fallingTwo equal values in a row count as one point.
3. RunsFewer runs than the lower limit or more runs than the upper limitThe limits depend on the number of useful observations.
4. Astronomical pointA point obviously different from all the othersThe team judges. The highest value in a series is not astronomical for that reason alone.
The reading rules of Perla, Provost and Murray: the pattern that gives a signal and how to count the points.

Too few runs means that the points stay on one side of the median for a long time. Most often the level has changed. Too many runs means that the points change side more often than chance does, for example when the series alternates the values of two teams.

Useful observationsLower limitUpper limit
12311
20616
23717
301121
Limits for the number of runs by number of useful observations in Table 1 of Perla, Provost and Murray. A number of runs below the lower limit or above the upper limit gives a signal.

The table in the article covers 10 to 60 useful observations. It rests on the tables of Swed and Eisenhart (1943). Rules 1 and 3 need more than ten points. With three or four points, no rule applies. The chart already shows the level and the direction.

The rules of Anhøj and Olesen

The published rule sets do not use the same thresholds. Anhøj notes that there is no general agreement on what makes a run unusually long. Anhøj and Olesen used simulation to measure the false-signal rate of several rules. They keep two. The thresholds of both grow with the number n of useful observations.

  • Shift: signal if the longest run exceeds log2(n) + 3 rounded to the nearest integer. In a spreadsheet: ROUND(LOG(n,2)+3,0).
  • Crossings: signal if the line crosses the median fewer times than the 5th percentile of a binomial distribution with parameters n − 1 and 0.5. In a spreadsheet: BINOM.INV(n-1,0.5,0.05).
Useful observationsLongest run without a signal (maximum)Crossings without a signal (minimum)
1062
1273
2076
2387
30810
Thresholds of the Anhøj and Olesen rules by number of useful observations. The values come from their Table 1. A run longer than the maximum or a number of crossings below the minimum gives a signal.

Perla's shift threshold of 6 points does not change with the length of the series. The more points the series has, the more likely a false signal becomes. The Anhøj and Olesen thresholds grow with n. Each rule keeps a false-signal rate close to 5% whatever the number of points. Together the two rules raise it a little. Anhøj and Olesen require at least 12 points before the team draws the median and recommend 20.

Their simulation also tests a trend rule. A drift of 0.3 standard deviations per point triggers it in about 20% of series of 100 points. The shift and crossings rules detect the same drift with near certainty from 20 points on.

In 2015 Anhøj compares the rules of Perla, his own rules and those of Carey on simulated series. He measures their diagnostic value by the positive likelihood ratio: how many times more likely a signal is with a real shift than without one. For a shift of two standard deviations, this ratio is 2 to 4 with Perla's rules and about 10 with Anhøj's or Carey's. Anhøj's example is the monthly count of hospital-acquired urinary tract infections in one hospital over a period without targeted action. Perla's rules find a shift and a trend in this series. Anhøj's and Carey's rules read it as random variation. Anhøj recommends choosing the rule set before data collection begins. The rules of Perla and those of Anhøj do not combine: each added test makes a false signal more likely.

The run chart and the control chart

Run chartControl chart
Centre lineMedianMean
LimitsNoneControl limits calculated from the variation of the process
Question settledHas the measurement changed?Is the process stable?
Data requiredAbout a dozen useful observations to apply the rulesA baseline to calculate the limits
Vocabulary of the signalRandom or non-random variationCommon cause or special cause
What separates the run chart from the control chart: the centre line, the limits, the question settled, the data required and the vocabulary of the signal.

Perla, Provost and Murray reserve the terms "common cause", "special cause", "stable" and "unstable" for the control chart. On one of their series, the run chart gives no signal. The Shewhart chart drawn on the same data detects special causes. Anhøj and Olesen advise drawing the run chart before the control chart: a signal can come from values that depend on one another. This dependence invalidates the control chart.

The simulations of Anhøj and Olesen also measure sensitivity. For a shift in level of up to two standard deviations, the shift and crossings rules react more often than a control chart that applies only the three-sigma rule. However, no counting rule reacts to an isolated point far from the others. Only the astronomical point rule can pick it up.

Test 4 of the control chart looks for eight successive values on the same side of the centre line. The shift rule looks for the same pattern around the median from six points. In the example of the defects found in acceptance testing, an individuals chart calculates its centre line and its limits from the thirteen baseline weeks. Its mean moving range is 2.5. The chart places its centre line at 15.08 defects and its limits at 8.43 and 21.73. No point crosses the limits. The shift rule fires in week 21 and test 4 in week 23.

The run chart and its neighbours

The histogram shows the distribution of the same values and loses their order. In exploratory data analysis, the NIST handbook describes the same plot without a median or rules under the name run-sequence plot. On this plot the analyst looks for a shift in level or in spread and for outliers.

Common mistakes

Reacting to the last point. A high value at the end of the series calls for an explanation, then for a correction. If the value gives no signal, the correction adds variation to the process instead of removing it.

Talking about a trend without a rule. A team announces that defects are rising after three points that rise. The trend rule needs five.

Recalculating the median at each point. The median then follows the data and erases the shift it was meant to show. The example of the defects in acceptance testing shows this: against the median of all 25 weeks, no run reaches six points.

Choosing the rules while reading the chart. A team that tries several rule sets ends up finding a signal. The team writes down the chosen set before the first value.

AI considerations

An assistant writes the R or Python script that draws the run chart and applies the chosen rule set in a few minutes. The analyst checks in the script that the median covers the baseline period only, that the points on the median are skipped and that the count of useful observations excludes them. A script written in a hurry calculates the median over the whole series.

A language model given a pasted column of values estimates the number of runs and crossings without computing it. It can be wrong without saying so. The analyst has the script print the side of each point, the runs and the crossings, then checks two or three counts on the chart.

Asked "is there a change?", a model may try several rules until one reacts, then declare the process "stable" in the vocabulary of the control chart. The analyst gives it the rule set fixed in advance and asks for one answer per rule.

The model suggests causes for the signal. It does not know the release calendar, the absence of a tester or the change in the way of counting. Its causes remain hypotheses for the team to check against the annotations on the chart.

Examples

The run chart in the example shows a shift below the frozen median after a change. A team records the defects found in acceptance testing every week. In week 14 it introduces a checklist for the requirements review. Weeks 1 to 13 form the baseline period. Their median is 15.

WeekDefectsSideWeekDefectsSide
116+1413−
217+1516+
313−1612−
414−1714−
515on the median1811−
618+1912−
712−2010−
813−2113−
916+2215on the median
1017+2312−
1114−2411−
1213−2513−
1318+
Defects found in acceptance testing per week and the side of each point against the baseline median of 15. Illustrative values.
A shift below the median after the checklistRun chart of the defects found each week in acceptance testing over 25 weeks. The median of weeks 1 to 13 is 15 defects and extends to the right. A checklist for the requirements review comes into use in week 14. From week 16 to week 25, nine points in a row fall below the median. The point of week 22 falls on the median and does not count.8101214161820Defects12345678910111213141516171819202122232425WeekBaseline median: 15Checklist for the requirements reviewFrozen median6th point: signal9 points below the medianOn the median: does not count A shift below the median after the checklistRun chart of the defects found each week in acceptance testing over 25 weeks. The median of weeks 1 to 13 is 15 defects and extends to the right. A checklist for the requirements review comes into use in week 14. From week 16 to week 25, nine points in a row fall below the median. The point of week 22 falls on the median and does not count.8101214161820Defects135791113141719212325WeekBaseline median: 15Checklist for therequirements reviewFrozen median6th point: signal9 points below the medianOn the median: does not count
Run chart of the defects found per week in acceptance testing. The median of weeks 1 to 13 is 15. After the team introduces the checklist in week 14, nine points in a row fall below the median from week 16 to week 25. The shift rule fires in week 21 with the sixth point. The point of week 22 falls on the median and does not count.
CheckPerla, Provost and MurrayAnhøj and Olesen
Baseline period (12 useful observations)7 runs against limits of 3 to 11. Longest run: 2 points. No signal6 crossings against a minimum of 3. Longest run: 2 points against a maximum of 7. No signal
Shift (23 useful observations)9 points below the median from week 16 to week 25. The 6th falls in week 21. SignalLongest run: 9 points against a maximum of 8. Signal
TrendAt most 4 points rising or falling (weeks 3 to 6 and weeks 7 to 10). No signalNo rule
Runs or crossings10 runs against limits of 7 to 17. No signal9 crossings against a minimum of 7. No signal
Astronomical pointHighest value: 18 (weeks 6 and 13). It stays within the spread of the others. No signalNo rule
The run chart read with each of the two rule sets. Both sets reach the same verdict: a shift below the median after week 14.

The mean falls from 15.08 defects before the checklist to 12.67 after it. These two figures do not show that the series stays below the median from week 16 on.

Visualisations

The run chart of the example and the patterns of the rules are drawings: the position of the points against the median carries the information. The rules, their thresholds, the comparison with the control chart, the data and how each rule set reads them are made of rows and columns. They are tables.

Cost

DimensionLevelRationale
PreparationLowDefine the measurement, the time unit and the rule set. Retrieve about a dozen baseline values from past records or start recording them. Without a history, weekly recording takes three months before the first reading.
ExecutionLowA spreadsheet draws the chart in a few minutes.
DocumentationLowThe annotated chart, the baseline median, the chosen rule set and the date of each signal.

Tooling

Paper and a pencil are enough. On the team's wall, the chart gains one point a week.

A spreadsheet draws the run chart as a line chart. The baseline median is added as a second series that repeats the same value in every period. The MEDIAN function calculates it over the cells of the baseline period. The team counts the runs and the crossings from a column that records the side of each point.

Jacob Anhøj's R package qicharts2 draws the run chart and applies the Anhøj and Olesen rules. Minitab's run chart tests rest on p-values and look for clustering, mixtures, trends and oscillation. This set differs from those of Perla and Anhøj. Minitab counts a point on the median with the points below it. The rules of Perla and Anhøj skip it.

Sources

Rummler's Performance Matrix
All techniques
Running the Swamp