A scripted solution would detect and delete the By groups with zero observations. This example illustrates this approach. It opens up the Big Class data tables and adds two rows in a new age group with missing height data. It launches XmR control charts on height by age, so the last pair of charts is empty. It uses the Summarize() function to determine the number of height observations in each group, locates groups with a zero count, and then systematically removes the associated pair of charts from the bottom.
= Open( "$SAMPLE_DATA/Big Class.jmp" );
<< Add Rows(
:name = "Mark", :age = 29, :sex = "M" },
:name = "James", :age = 29, :sex = "M" }
;
= dt << Control Chart(
1 ),
3 ),
:height, Individual Measurement, Moving Range ),
:age )
;
( group size = Count( :height ), age group = By( :age ) );
= Loc( Not( group size ) );
= N Row( to be deleted );
( nr,
For( r = nr, r > 0, r--,
Report( cc[to be deleted[r]] ) << Delete;
;
;