cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

How to hide and exclude cells instead of change to missing in jsl after explore outliers?

I am scripting Explore Outliers in jsl and it works great with k sigma algorithm. However the script I got from this jmp community changes the outliers to missing but how do I set them to hide and exclude instead?

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); //<<---------- this line here
	);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to hide and exclude cells instead of change to missing in jsl after explore outliers?

Just using << Exclude Rows might work

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
dt << Clear Row States;

obj = dt << Explore Outliers(Y(Column Group("Sensor Measurements")));
obj << Robust Fit Outliers;
wait(1);
obj << Exclude Rows;
dt << Clear Column Selection << clear select;
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: How to hide and exclude cells instead of change to missing in jsl after explore outliers?

Just using << Exclude Rows might work

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
dt << Clear Row States;

obj = dt << Explore Outliers(Y(Column Group("Sensor Measurements")));
obj << Robust Fit Outliers;
wait(1);
obj << Exclude Rows;
dt << Clear Column Selection << clear select;
-Jarmo
txnelson
Super User

Re: How to hide and exclude cells instead of change to missing in jsl after explore outliers?

There is not a way to exclude individual cells in a data table.  You can exclude individual rows, but that excludes all values for the given row.

Changing a cell's value to missing the typical way of handling the outlier issue.  

My typical method is to save the original data table, and then make a copy of it and then make the changes in that data table.  If you ever need to go back to the original values, it is readily available in the saved data table.

Jim