Home / Statistical Tools / Control Charts / u Chart / How-To with GroupBy
How-To with GroupBy¶
This walkthrough charts blemishes on two upholstery lines in one run. GroupBy divides the rows by the value of a grouping column and charts each group separately, so each line gets its own worksheet, its own pooled defect rate and its own limits.
On a u chart that separation matters because one number, \(\bar{u}\), sets the whole band. Both lines below are in control on their own charts. Pooled into one chart, three of Line 2's ordinary batches are marked out of control.
If you have not built a plain u chart yet, start with the u Chart How-To and come back.
The data¶
Ten batches from each of two lines. Both lines ran the same batch sizes on the matching days, so the only thing that differs is the blemish counts.
| Line | Blemishes | Panels |
|---|---|---|
| Line 1 | 1 | 12 |
| Line 1 | 9 | 15 |
| Line 1 | 3 | 10 |
| Line 1 | 6 | 14 |
| Line 1 | 4 | 13 |
| Line 1 | 2 | 11 |
| Line 1 | 1 | 16 |
| Line 1 | 5 | 12 |
| Line 1 | 4 | 15 |
| Line 1 | 1 | 13 |
| Line 2 | 8 | 12 |
| Line 2 | 21 | 15 |
| Line 2 | 15 | 10 |
| Line 2 | 9 | 14 |
| Line 2 | 6 | 13 |
| Line 2 | 10 | 11 |
| Line 2 | 21 | 16 |
| Line 2 | 8 | 12 |
| Line 2 | 14 | 15 |
| Line 2 | 9 | 13 |
Line is the grouping column. It is neither a defects column nor an inspection size, and you do not check it in either slot.
Steps¶
-
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. Headers land in row 1 and the twenty batches in rows 2 through 21.
-
Start the chart
From the Excel ribbon: QXL Stat Tools Tab > Control Charts > Attribute Charts > C, U, and Laney's U'.
-
Give it the cells
In the Data Selection window set Selected Range: to A1:C21. Leave Data in Columns selected and First Row/Column is Header checked. Press Next >.
-
Fill the two data slots
On the Data tab, with Variant: on U, check Blemishes in Defects Column, then set Inspection Size to Column and choose Panels. Leave Line out of both.
-
Switch the calculation type to GroupBy
Change the calculation type from Excel to GroupBy. The GroupBy region appears below it.
-
Move Line into the GroupBy order
Select Line in Available Items and press
>. It moves into GroupBy Order as1.Do not switch back to Excel after this
Switching the calculation type back to Excel clears the GroupBy list without warning, and returning to GroupBy means building it again.
-
Finish
Press Finish.
What you should see¶
Two worksheets, not one, named U Chart - Line 1 and U Chart - Line 2, each with one panel of ten points.
| Line 1 | Line 2 | |
|---|---|---|
| u-bar | 0.2748 | 0.9237 |
| UCL at 12 panels | 0.7288 | 1.7560 |
| LCL at 12 panels | 0 | 0.0913 |
Both lines are in control. Not one point is marked on either chart.
Line 2 produces about 3.4 times as many blemishes per panel as Line 1, and that single difference reshapes its chart. Its center line is more than three times as high, its band is about two and a half times as wide, and its lower limit lifts off zero: at Line 1 three standard deviations below the center line is still negative and gets clamped, while at Line 2 it lands at 0.0913. A u chart only gains a usable lower limit once the rate and the inspection size are large enough, and here one line has one and the other does not.
Things to try next¶
-
Run it without GroupBy. Set the calculation type back to Excel and finish again. One worksheet, twenty points, one pooled rate for both lines:
Value u-bar 0.5992 UCL at 12 panels 1.2696 LCL 0 The pooled rate lands between the two lines, and now three points are marked: points 12, 13 and 17, which are Line 2's batches 2, 3 and 7. Nothing about either line changed between the two runs. Those three batches are ordinary for Line 2, all comfortably inside Line 2's own upper limits, and they are only signals against a rate that is the average of two lines and the true rate of neither. Line 1, meanwhile, is judged against a band nearly twice as wide as its own, so a real deterioration there would have to be large before the pooled chart noticed.
-
Compare the two sigma_Z values. Each worksheet reports one. They are 1.42 for Line 1 and 1.40 for Line 2 here, close enough to each other that the two lines are equally well described by the Poisson model even though their rates differ by more than three times. That is worth knowing: a difference in rate is not overdispersion, and GroupBy is the right tool for it. Overdispersion would show as a high \(\sigma_Z\) within a group, which is what the Laney U' Chart is for.
- Compare with a split instead. Split Control Limits also gives separate stretches their own estimate, but it divides one chart by position rather than by the value of a column. Use a split when one line changed over time, GroupBy when the rows describe different lines.
- Group by two columns. Add a second grouping column and it becomes
2.in GroupBy Order, subdividing what1.produced. Each combination needs at least two subgroups of its own.