cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Rehrig76
Level II

Please help me filter out +/- 6 sigma and then replot

Hi all,

 

In the data I'm trying to plot, I've got a couple spurious data points that are skewing the average and control limits.  I want to hide and exclude these data points, and then replot the data with my JMP script.  Here is the part of the script that is plotting the data, marking the data points outside of +/- 6 sigma, and is supposed to be filterin them out of the final plots:

rpt = Control Chart Builder(
	Size( 682, 464 ),
	Show Two Shewhart Charts( 0 ),
	Show Control Panel( 0 ),
	Show Capability( 0 ),
   Variables( Subgroup( :TEST_DATE ), Y( :INFL_WL_MED ) ),
   // Add a cusom warning test to mark points outside of +/- 6 sigma
   Customize Tests( Test 1( 6, "1" ) ),
   Chart( Position( 1 ), Limits( Sigma( Moving Range ) ), Warnings( Test 1( 1 ) ) ),
   By( :EPI_RUN, :TEST_SYSTEM )
);
 
// create the summaries table (contains a column showing test failures)
dt_sum = obj << save summaries;
 
// clear any existing row states
dt << clear row states();
 
// loop through each row in the summary table looking for failures
for each row( dt_sum,
   // if this row did not meet our criteria, select the corresponding row in the main table
   If( :Test Failures == "1",
       dt << Select Rows( Row() )
   )
);
 
// Hide exclude all of the selected rows.
dt << Hide and Exclude( 1 );
dt << clear select();

The script marks the data points outside +/- 6 sigma, but the outliers aren't getting getting filtered out, and the data isn't getting replotted.  Any help would be greatly appreciated. 

Thanks,

 

-Mike

1 REPLY 1
txnelson
Super User

Re: Please help me filter out +/- 6 sigma and then replot

You need to turn the Automatic Recalc option on.  This will force the Chart Builder to recalc when the Row States are changed.  Here is an example from the Scripting Index

     Help==>Scripting Index==>Control Chart Builder==>Automatic Recalc

Names Default To Here( 1 );
dt = Open(
	"$SAMPLE_DATA/Quality Control/Coating.jmp"
);
obj =
Control Chart Builder(
	Variables( Y( :Weight ), Subgroup( :Sample ) )
);
obj << Automatic Recalc( 1 );
dt << Select Rows( 5 ) << Exclude( 1 );
Jim