cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
hogi
Level XII

step

The step function looks useful

 

hogi_1-1693555860881.png

 

some things which I noticed:

 

1) Don't use string values  as yi - although it seems to be "allowed":

hogi_0-1693555667660.png

 

2) Description - add-on:
Returns the yi argument corresponding to the largest xi which satisfies xi less than or equal to the x argument

- but only: IF there is another xi that is larger than x.

 

3) None of the yi values must be empty.


Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << New Column( "binning1",Character,	"Nominal",	Formula( Step( :weight, 0, "low", 90, "mid", 140, "high", 1000, "max" ) ));

dt << New Column( "binning2",Numeric,"Nominal",	Format( "Best", 9 ),Formula( Step( :weight, 0, 0, 90, 1, 140, 2 ) ));
	
dt << New Column( "binning3",Numeric,	"Nominal",	Format( "Best", 9 ),Formula( Step( :weight, 0, 0, 90, 1, 140, 2, 1000, . ) ));

dt << New Column( "binning_final",	Numeric,	"Nominal",	Format( "Best", 9 ),	Formula( Step( :weight, 0, 0, 90, 1, 140, 2, 1000, -1 ) ));
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: step

I think JMP Help's Scripting Guide gives much better idea of the function than scripting index

Scripting Guide > JSL Building Blocks > Conditional Functions > Step Function 

-Jarmo

View solution in original post

2 REPLIES 2
mmarchandTSI
Level V

Re: step

Interesting.  Step() seems to always choose the first string option, if one is given.

Show( Step( 500, 0, 1, 90, 2, 140, 3, 1000, "max" ) );	//"max"
Show( Step( 500, 0, 1, 90, 2, 140, "high", 1000, "max" ) );	//"high"
Show( Step( 500, 0, 1, 90, "mid", 140, 3, 1000, "max" ) );	//"mid"
jthi
Super User

Re: step

I think JMP Help's Scripting Guide gives much better idea of the function than scripting index

Scripting Guide > JSL Building Blocks > Conditional Functions > Step Function 

-Jarmo