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
rverma
Level III

Select middle 90% range using quantiles

I have a Numeric Continuous column labeled as Height with several hundred height values. I want to exclude outliers by just using the middle 90% range of data. I am trying to script it in JSL by selecting all rows below 5% quantile and above 95% quantile and then exclude them. But I am not able to make it work by using script below. I will appreciate any guidance.

 

RowsBelow5PCTL = dt << get rows where( :HEIGHT < Col Quantile( :HEIGHT, .05 ) );

RowsAbove95PCTL = dt << get rows where( :HEIGHT > Col Quantile( :HEIGHT, .95 ) );
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Select middle 90% range using quantiles

I believe this will give you what you want;

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt << select where(
	:HEIGHT < Col Quantile( :Height, .05 ) | 
	:HEIGHT > Col Quantile( :Height, .95 )
);
dt << exclude;

Or if you need to have your above and below row number matrices, then this will work

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

RowsBelow5PCTL = dt << get rows where( :HEIGHT < Col Quantile( :HEIGHT, .05 ) );

dt << select rows(RowsBelow5PCTL);

RowsAbove95PCTL = dt << get rows where( :HEIGHT > Col Quantile( :HEIGHT, .95 ) );
dt << select rows(RowsAbove95PCTL);

dt << exclude;
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Select middle 90% range using quantiles

I believe this will give you what you want;

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt << select where(
	:HEIGHT < Col Quantile( :Height, .05 ) | 
	:HEIGHT > Col Quantile( :Height, .95 )
);
dt << exclude;

Or if you need to have your above and below row number matrices, then this will work

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

RowsBelow5PCTL = dt << get rows where( :HEIGHT < Col Quantile( :HEIGHT, .05 ) );

dt << select rows(RowsBelow5PCTL);

RowsAbove95PCTL = dt << get rows where( :HEIGHT > Col Quantile( :HEIGHT, .95 ) );
dt << select rows(RowsAbove95PCTL);

dt << exclude;
Jim
rverma
Level III

Re: Select middle 90% range using quantiles

Thank you very much.

Recommended Articles