Run chart: how to make one and test for runs

Updated

A run chart plots measurements in the order they were made, with a center line at the median. It is the quickest way to see whether a process behaves the same over time. Two counts of runs turn the picture into a test: they tell you whether the pattern you see (clusters, mixtures, trends or oscillation) is more than chance. A run chart needs no control limits and assumes nothing about the shape of the distribution.

When to use it

  • You have data in time order and want a first look before anything else.
  • You do not yet have enough data, or no sensible subgroups, for a control chart.
  • You changed something (a fixture, a supplier, a setting) and want to see whether the process moved.
  • You are about to run a capability study or a hypothesis test that assumes independent values, and you want to check that the values do not drift or cluster first.

How it works

Plot the values in time order and draw a horizontal line at their median. A run is a sequence of consecutive points on the same side of the median. A point exactly on the median counts with the points below it, the convention of common quality software and of StatLab; some textbooks skip such points instead.

Runs about the median. Let m be the number of points above the median, k the number on or below it, and N = m + k. If the order is random, the number of runs R has this mean and variance:

E(R) = 1 + 2mk / N Var(R) = 2mk(2mk − N) / (N²(N − 1))

Compute z = (R − E(R)) / √Var(R) and compare it with the standard normal distribution.

  • Too few runs (z negative, p = Φ(z) small): clustering. Points stay on one side for long stretches, as when a process shifts for a while.
  • Too many runs (z positive, p = 1 − Φ(z) small): mixtures. Points cross the median too often, as when samples alternate between two machines or cavities.

Runs up or down. A run up is a sequence of increases from one point to the next; a run down is a sequence of decreases. With N points, the number of runs up or down V has this mean and variance (a step to an equal value counts as a step down):

E(V) = (2N − 1) / 3 Var(V) = (16N − 29) / 90
  • Too few runs up or down: trends, such as drift from tool wear or warm-up.
  • Too many: oscillation, the sawtooth pattern of a process that is adjusted after every reading.

The usual cutoff is p < 0.05. These are normal approximations, which work well with about 20 or more points. The runs about the median are the same calculation as the one-sample runs test with the median as the reference value.

Example

A manual assembly station records its average cycle time each working day. The engineer plots 24 days.

Days 1–6Days 7–12Days 13–18Days 19–24
14.214.015.313.7
13.813.915.114.1
14.514.914.713.5
14.115.215.414.4
13.615.015.013.8
14.414.814.314.2

Cycle time in seconds, read down each column.

Run chart of daily average cycle time13.514.014.515.015.5Cycle time (s)CL=14.351471013161922Day
Run chart of daily average cycle time

The median is 14.35 s, halfway between the 12th and 13th sorted values, so 12 days fall above it and 12 below. Reading the sides in order gives 9 runs. Days 9 to 17 form one long run of 9 points above the median.

TestObservedExpectedSDzp
Runs about the median913.002.396−1.67clustering 0.047, mixtures 0.953
Runs up or down1615.671.9860.17trends 0.567, oscillation 0.433

How to read the results

  • Clustering, p = 0.047. There are fewer runs than chance would usually give. The chart shows where: days 9 to 17 all sit above the median. The maintenance log explains it. The station's parts feeder was out for a rebuild during those days, and a slower loaner unit took its place.
  • No mixtures. The p-value for mixtures is 0.953, so the points do not cross the median more than expected.
  • No trend or oscillation. Sixteen runs up or down is close to the 15.67 expected. Cycle time is not drifting, and nobody is overadjusting the station.
  • Act on the cause, not the statistic. The clustering test only says the order is not random. The useful finding is the feeder. Leave days 9 to 17 out of the baseline once you know why they differ, and mark the change on the chart.
  • Compare with control chart rules. Nine points in a row on one side of the center line is also Test 2 of the special-cause tests. On a run chart the line is the median, not the mean, but the idea is the same.

Common mistakes

  • Plotting data out of time order. Sorted data always look like a perfect trend, and data grouped by machine look like clusters. The order on the chart must be the order of production.
  • Reading patterns into short series. With 10 points, almost any pattern can happen by chance. Collect at least 20 before you trust the tests.
  • Treating a run chart as a control chart. A run chart has no limits, so it cannot flag a single point that is far out. When you need that, use an I-MR chart.
  • Explaining away a mixture. Too many crossings usually means two streams in one column, such as two cavities sampled in turn. Split the data by stream and look at each one.
  • Rounding too much. If the values are rounded so coarsely that many of them land exactly on the median, the runs lose information. Record the full resolution of the gage.

Frequently asked questions

What is the difference between a run chart and a control chart?

Both plot data in time order. A control chart adds limits calculated from the short-term variation, so it can judge single points as well as patterns. A run chart uses only the median and the order of the points, which makes it simpler and free of assumptions about the distribution, but less sensitive to isolated unusual values.

How many points do I need?

At least 20 for the run tests to be reliable; 24 to 30 is better. With fewer points you can still plot the chart and look at it, but treat the p-values with caution.

What counts as a run?

A run about the median is a stretch of consecutive points on the same side of the median, ended by a point on the other side. A run up or down is a stretch of consecutive increases or decreases. A single point can be a run on its own.

What do I do with points that fall on the median?

StatLab counts them with the points below the median, as common quality software does; some textbooks skip them instead. With one or two such points the two conventions give almost the same result. If many points land on the median, the data are probably rounded too coarsely; see the chunky-data check.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab