The step function looks useful
some things which I noticed:
1) Don't use string values as yi - although it seems to be "allowed":
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 ) ));