Skip to content

Home / Statistical Tools / Control Charts / G Chart / G Chart How-To

G Chart How-To

This walkthrough builds a complete G chart from twenty-four rare events. Two things about this chart are unlike any other in Quantum XL, and this data shows both: the band is lopsided, and the only signal it can give you is good news.

The data is on this page rather than in a file to download. Press Copy for Excel, then paste it into a blank worksheet.

The data

Twenty-four surgical site infections on one ward, in the order they happened. Each value is the number of patients discharged between the previous infection and this one. Four of them are zero, which means an infection with no discharge between it and the one before.

Patients Between
3
21
1
14
6
0
0
1
23
1
15
0
13
12
1
8
3
8
0
4
101
1
13
8

Event 21 is the one to watch. Every other gap is between 0 and 23 patients; that one is 101.

Steps

  1. Put the data in Excel

    Press Copy for Excel above the table. In Excel, open a blank worksheet, click cell A1, and press Ctrl+V. The header lands in A1 and the twenty-four counts in A2:A25.

  2. Start the chart

    From the Excel ribbon: QXL Stat Tools Tab > Control Charts > Rare Event Charts > G Chart (Count Between Events).

  3. Give it the cells

    In the Data Selection window set Selected Range: to A1:A25. Leave Data in Columns selected and First Row/Column is Header checked. Press Next >.

  4. Check the data column

    The G Chart dialog opens on the Data tab. Check Patients Between in Data Columns (required).

    The column has to be a Count

    This dialog accepts only Count and DateTime columns. If Patients Between came in as Continuous, press Data Types and set it to Count. There is no subgroup group on this dialog at all: one row is one event.

  5. Finish

    Press Finish. Leave the other two tabs alone; their defaults are what this walkthrough uses. The chart is written to a new worksheet named G Chart and the Control Chart analysis pane opens on the right.

What you should see

One panel with twenty-four points, its Y axis titled Count Between Events.

Value
pHat 0.0819
CenterLine 7.12
UCL 76.39
LCL 0

Look at where the center line sits. It is 7.12, but the average of the twenty-four counts is 10.71. The center line is not the average: it is the median of the fitted distribution, the gap that half of all gaps should fall below. On this chart it will always sit below the mean.

Look at how far the two limits are. The upper limit is 69 counts above the center line and the lower limit is 7 counts below it, a ratio of about ten to one. That is not a mistake and not a rounding artifact. A gap can be as small as zero and has no ceiling, so the distribution behind the chart is lopsided and the band drawn from it is lopsided too.

Event 21 is out of control, and it is the good kind of signal. It plots at 101, above the upper limit of 76.39, and is drawn in a different color. It is the only marked point on the chart. On a G chart a point above the upper limit is a gap longer than the model expects, which means the events got rarer: 101 patients passed between infections where the fitted rate expects about 7. On this chart the lower limit is 0, so nothing can ever be marked for being too low, and every Rule 1 signal a G chart gives you is an improvement.

Where those numbers came from. The twenty-four counts average 10.71. From that, the event probability is estimated as

\[ \hat{p} = \frac{24 - 1}{24} \cdot \frac{1}{10.71 + 1} = 0.0819 \]

which says about one patient in twelve was an infection over this record. Note the leading fraction: without it the estimate would be 0.0854, and the small-sample correction that lowers it is deliberate. Every line on the chart is then a quantile of the geometric distribution with that probability. The center line is its median, and at the default Number of StDevs: of 3 the limits are its 0.135th and 99.865th percentiles, the same probabilities a 3-sigma normal band would cover. The formulas are on the Math Details page.

The zeros are not errors. Four of the counts are 0, at events 6, 7, 12 and 19: an infection with no discharge between it and the one before. Zero is inside the band, since the lower limit is zero, so none of them is marked.

Only one test is running

Unlike the variable charts, a G chart opens with Rule 1 only. Rules 2, 3 and 4 are present and unchecked, and so is Rule 9, the zero-count test that exists on no other chart. So a chart with no marked points here means nothing broke that single test; it does not mean every pattern test passed. See the Rules & Display section of the Options page.

Things to try next

  • Switch the zone lines on and see how uneven they are. On the Rules & Display tab tick Show 1-sigma / 2-sigma zone lines. The upper 1-sigma line lands at 20.57 and the upper 2-sigma line at 43.31, while the lower 1-sigma line is at 1.02 and the lower 2-sigma line is at 0. They are quantiles, not equal steps: a thirds rule would have put the upper 1-sigma line at 30.21, nine counts away from where it actually goes.
  • Turn on the pattern tests. Tick rules 2, 3 and 4 and rebuild. Nothing new is marked on this data, which is worth knowing: the single Rule 1 signal was not hiding a second pattern.
  • Supply the rate instead of estimating it. Type 0.08 into Historical pHat (optional): on the Limits & Splits tab. The center line moves to 7.32 and the upper limit to 78.25, and event 21 is still the only marked point. Use this when you have a known long-run rate and do not want a short record to set the limits.
  • Try Rule 9 on data that deserves it. This record's longest run of zeros is two, at events 6 and 7, and Rule 9 needs four in a row at its default. A ward with four consecutive zero gaps has had four infections back to back, which is exactly the cluster the Benneyan test exists to catch.
  • Feed it dates instead of counts. If you have the date of each infection rather than the gap, put the dates in the column and set its type to DateTime. Quantum XL differences them for you, in whole days, so the Y axis becomes Days Between Events. Remember that the first date only establishes the starting point: twenty-five dates give twenty-four counts.

See Also