cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Lichun
Level II

Outlier screen for automotive PAT(part average testing)

Hi Team,

 

I am using the Robust Fit outlier - quartile, the result is for both high & low screen , mean +/- 6 K(Sigma).

Now I am watching the leakage part only. I just need the outlier for mean + 6 K (Sigma).

Please tell me how to make it happen from JSL. Thanks.

Explore Outliers(
	Y(
		:icc_aux10_total_vcc_1.000, :icc_aux10_VCCAUX10_vcc_1.000, :icc_aux18_total_vcc_1.000,
		:icc_aux18_VCCAUX18_vcc_1.000, :icc_core_total_vcc_1.050, :icc_core_VCC_vcc_1.050,
		:icc_core_lp_total_vcc_1.000, :icc_core_lp_VCC_vcc_1.000, :iccio_b_total_vcc_1.000,
		:iccio_b_VCCIOB_vcc_1.000, :iccio_ltr_total_vcc_1.000, :iccio_ltr_VCCIOLTR_vcc_1.000
	),
	Robust Fit Outliers( K Sigma( 6 ), Huber( 0 ), Quartile( 1 ) ),
	SendToReport( Dispatch( {}, "Commands", OutlineBox, {Close( 0 )} ) )
);
1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Level X

Re: Outlier screen for automotive PAT(part average testing)

Above I was careful to say 'adapt this approach' :). Without speaking for others, when posting JSL snippets my intention is (usually) to encourage someone to figure out the code and then be able to go further for themselves.

 

If you change sigma to 2, you will have seen that there are only blue cells in the table (outliers on the low side), and the code isn't general enough to handle this and generates the error you saw.

 

Please find a more complete (untested . . . ) script that should cover all situations:

NamesDefaultToHere(1);

// Sample data
dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Explore outliers
eo = dt << Explore Outliers(Y( :height ));
eo <<  Robust Fit Outliers( K Sigma( 2 ), Huber( 0 ), Quartile( 1 ) );
eo << obj << Color Cells( :height );										// Blue (red) cells are 'low' ('high')

// Get the column script
colScript = :height << getScript;

// Initialise lists (which may or may not be updated by the subsequent code)
redRowList = {};
blueRowList = {};

// Find the location of the sub-expression 'Color Cells'. if there are no outliers, 'colorCellsExist' will be 0
subExpr = {};
for(i=1, i<=NArg(colScript), i++, InsertInto(subExpr, Head(Arg(colScript, i))));
colorCellsExist = Contains(subExpr, Expr(Color Cells));

// Find the row numbwrs of any high (red) cells or low (blue) cells (red is '35', blue is '37'):
// Need to handle situations in which there are only high outliers, only low outliers, both high and low
// outliers, or no outliers
if(
	colorCellsExist,
		// Get the 'Color Cells' expression in the column script
		cs = Arg(colScript, colorCellsExist);
		if(
			// If 'cs' is a list of lists, we have both high and low outliers . . .
			IsList(Arg(cs, 1)[1]),
					for(i=1, i<=NItems(Arg(cs, 1)), i++,
						if(
							(Arg(cs, 1)[i])[1] == 35, redRowList = (Arg(cs, 1)[i])[2];
							(Arg(cs, 1)[i])[1] == 37, blueRowList = (Arg(cs, 1)[i])[2];
							);
						);
			,
			// . . . or if 'cs' is not a list of lists, we have either high or low outliers (but not both)
			if(
				Arg(cs, 1)[1] == 35, redRowList = Arg(cs, 1)[2],
				Arg(cs, 1)[1] == 37, blueRowList = Arg(cs, 1)[2]
				);
			);
	);

Print("High: "||Char(redRowList)||"   Low: "||Char(blueRowList));

 

View solution in original post

6 REPLIES 6
Lichun
Level II

Re: Outlier screen for automotive PAT(part average testing)

Hi,

 

Follow my last post, i am using the robust fit outlier- default function is to screen high/low outlier, mean+/-6 sigma.

For some of itmes, that we only need to screen the outlier out of mean+6 sigma (like leakage item, low is good).

Can anyone tell me how to use the robust fit outlier for mean + 6 sigma only?

 

Thanks 

 

 

ian_jmp
Level X

Re: Outlier screen for automotive PAT(part average testing)

I ended up manipulating expressions. If there is not a better way, you should be able to adapt this approach:

NamesDefaultToHere(1);

// Sample data
dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Explore outliers
eo = dt << Explore Outliers(Y( :height ));
eo <<  Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) );
eo << obj << Color Cells( :height );		// Blue (red) cells are 'low' ('high')

// Get the row numbers of the red cells . . .

// (1) Get the column script
colScript = :height << getScript;
// (2) Find the 'Color Cells' expression in the column script
n = 1;
While(Head(Arg(colScript, n)) != Expr(Color Cells), n++);
cs = Arg(colScript, n);
// (3) Find the row numbwrs of the red cells (red is '35')
n = 1;
While((Arg(cs, 1)[n])[1] != 35, n++);
redRowList = (Arg(cs, 1)[n])[2];

Print(redRowList);
Lichun
Level II

Re: Outlier screen for automotive PAT(part average testing)

Hi Ian,

 

Thanks for your reply. 

 

1. Robust Fit outlier is for both direction, below formula is to mark red for row out of +1 sigma or -1 sigma .

    I would like to mark the row with +1 sigma only.

eo <<  Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) );

 

2. For your help to print the  collist, this is really I am looking for.

    the error I received was object not subscriptable in access or evaluation of 'Arg (cs,1) [n]/*###*/1]', Arg(cs,1)[n]/*###*/1]'

    Can you please review it again? thanks.

ian_jmp
Level X

Re: Outlier screen for automotive PAT(part average testing)

Using the red and blue colouring is just an indirect way of getting round the fact that (as far as I know), there is no direct way to ask JMP to do one-sided screening (on the high or low side, as required).

 

For me (using JMP 17.1 on a Mac), the code posted above does not generate an error. It prints:

 

{25, 27, 30, 37, 39, 40}

 

to the log, and this is a list of the row numbers containing outliers on the high side (the red cells in the table).

 

Lichun
Level II

Re: Outlier screen for automotive PAT(part average testing)

Hi Ian,

 

Sorry for late reply. Now I got JMP17 to run your script. No error as you mentioned. It show red/blue color respectively.

I try to change the sigma from 1 to 2,3,4,5,6 then the same error was found .

Any idea how to fix that?

 

Thanks.

 

ian_jmp
Level X

Re: Outlier screen for automotive PAT(part average testing)

Above I was careful to say 'adapt this approach' :). Without speaking for others, when posting JSL snippets my intention is (usually) to encourage someone to figure out the code and then be able to go further for themselves.

 

If you change sigma to 2, you will have seen that there are only blue cells in the table (outliers on the low side), and the code isn't general enough to handle this and generates the error you saw.

 

Please find a more complete (untested . . . ) script that should cover all situations:

NamesDefaultToHere(1);

// Sample data
dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Explore outliers
eo = dt << Explore Outliers(Y( :height ));
eo <<  Robust Fit Outliers( K Sigma( 2 ), Huber( 0 ), Quartile( 1 ) );
eo << obj << Color Cells( :height );										// Blue (red) cells are 'low' ('high')

// Get the column script
colScript = :height << getScript;

// Initialise lists (which may or may not be updated by the subsequent code)
redRowList = {};
blueRowList = {};

// Find the location of the sub-expression 'Color Cells'. if there are no outliers, 'colorCellsExist' will be 0
subExpr = {};
for(i=1, i<=NArg(colScript), i++, InsertInto(subExpr, Head(Arg(colScript, i))));
colorCellsExist = Contains(subExpr, Expr(Color Cells));

// Find the row numbwrs of any high (red) cells or low (blue) cells (red is '35', blue is '37'):
// Need to handle situations in which there are only high outliers, only low outliers, both high and low
// outliers, or no outliers
if(
	colorCellsExist,
		// Get the 'Color Cells' expression in the column script
		cs = Arg(colScript, colorCellsExist);
		if(
			// If 'cs' is a list of lists, we have both high and low outliers . . .
			IsList(Arg(cs, 1)[1]),
					for(i=1, i<=NItems(Arg(cs, 1)), i++,
						if(
							(Arg(cs, 1)[i])[1] == 35, redRowList = (Arg(cs, 1)[i])[2];
							(Arg(cs, 1)[i])[1] == 37, blueRowList = (Arg(cs, 1)[i])[2];
							);
						);
			,
			// . . . or if 'cs' is not a list of lists, we have either high or low outliers (but not both)
			if(
				Arg(cs, 1)[1] == 35, redRowList = Arg(cs, 1)[2],
				Arg(cs, 1)[1] == 37, blueRowList = Arg(cs, 1)[2]
				);
			);
	);

Print("High: "||Char(redRowList)||"   Low: "||Char(blueRowList));