Here is an example of one way of handling your issue. The way I have set it up, is that you select the ECID rows in your input data table that you want to examine, and then run the script. Check it out and see if it points you in a direction where you can make the finishing changes that you need.
Names Default To Here( 1 );
// Open Data Table: Probe.jmp
// → Data Table( "Probe" )
//dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );
dt = Data Table( "Modified_Probe_Input" );
// Only run if at least one ECID row has been selected
If( N Rows( dt << get selected rows() ) > 0,
// Create a new data table to place the results in
dtOutput = dt << subset( selected rows( 1 ), selected columns( 0 ) );
selRows = dt << get selected rows;
// Get column names for all continuous columns
colNames = dt << get column names( string );
Remove From( colNames, 1, 9 );
dtSum = dt << Summary(
invisible,
Group( :Bin ),
Mean( colNames ),
Std Dev( colNames ),
Freq( "None" ),
Weight( "None" ),
link to original data table(0)
);
dtSum << select where( :Bin != 1 );
Try( dtSum << delete rows );
For( i = 1, i <= N Items( colNames ), i++,
Mean = Column( dtSum, "Mean(" || colNames[i] || ")" )[1];
Stddev = Column( dtSum, "Std dev(" || colNames[i] || ")" )[1];
column( dtOutput, colNames[i]) << set name( column( dtOutput, colNames[i]) << get name || " Z Score" );
For( k = 1, k <= N Rows( dtOutput ), k++,
Column( dtOutput, colNames[i] )[k] = Abs( As Column( dtOutput, colNames[i] )[k] - Mean ) / Stddev
);
targetRows = dtOutput << get rows where( As Column( dtOutput, colNames[i] ) >= 3 );
Try( As Column( dtOutput, colNames[i] ) << color cells( "red", As List( targetRows ) ) );
);
);
close( dtSum, nosave );
Jim