cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

How to ignore in case of no outliers in missing outliers jsl?

I have a explore outlier jsl that runs on a big database. Sometimes the explore outlier doesn't find any outlier (because the data is quite tightly distributed) and the jsl gives an error. How do I add a ignore or try statement in the following script to skip the explore outlier code?

dt1 = Current Data Table();
eo = dt1 << Explore Outliers(
	Y( :var1 ),
	K Sigma( 2 ),
	Robust Fit Outliers,
	Where(
		:x == 1
	),
	Invisible
);
eoRep = Report(eo);
table = eoRep[TableBox(1)];
colList = eoRep[StringColBox(1)];
// Loop over these columns . . .
nCols = NItems(colList << get);
for(c=1, c<=nCols, c++,
	// Select this column (described by a row)
	CMD = Expr( table << setSelectedRows({colTBD}) );
	SubstituteInto(CMD, Expr(colTBD), Eval(c));
	CMD;
	// Update dt2 for this column: Cells that were considered outliers are coloured red
	eo << ColorCells(1);
	eo << ChangeToMissing(1);
	);
1 REPLY 1
txnelson
Super User

Re: How to ignore in case of no outliers in missing outliers jsl?

I believe that you can bypass the processing by simply checking if zero outliers have been found

For( c = 1, c <= nCols, c++,
	If( (eoRep[Number Col Box( 3 )] << get)[c] != 0, 
	// Select this column (described by a row)
		CMD = Expr(
			table << setSelectedRows( {colTBD} )
		);
		Substitute Into( CMD, Expr( colTBD ), Eval( c ) );
		CMD;
	// Update dt2 for this column: Cells that were considered outliers are coloured red
		eo << ColorCells( 1 );
		eo << ChangeToMissing( 1 );
	)
);
Jim

Recommended Articles