cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
DavideGrossi
Level II

How to set the response limits using a variable in a JMP script

Hello,

 

I would like to use a JMP script to automatically set the desirability for a JMP column, based on the statistics of the column itself. I would like to do this because I have multiple metrics and I would like to combine them in a single desirability metric using the JMP profiler platform. I am a JMP 16.1 user.

Unfortunately the following code does not work - the response limits are set but the value is missing:

median = Col Quantile( :"A", 0.5);
limit1 = Col Quantile( :"A", 0.95);
limit2 = Col Quantile( :"A", 0.05);

low_limit = if(limit1<limit2, limit1, limit2);
upper_limit = if(limit1>limit2, limit1, limit2);

Data Table( "TS_Table" ):"A"n <<
Set Property(
	"Response Limits",
	{Goal( Maximize ), Lower( low_limit, 0.05 ), Middle( median, 1 ),
	Upper( up_limit, 0.05 ), Importance( 2 ), Show Limits( 1 )}
);

If I replace the variables with the an actual value, the setting of the response limits works fine.

Am I doing something wrong when I evaluate the variables in the set Property function?

 

Thanks in advance for the help

 

Davide

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to set the response limits using a variable in a JMP script

Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute will most likely be able to help you with this. 

 

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

low_limit = 50;
high_limit = 100;

Eval(Eval Expr(Column(dt, "height") << Set Property(
	"Response Limits",
	{Goal(Maximize), Lower(Expr(low_limit), 0.05), Middle(median, 1), Upper(Expr(high_limit), 0.05), Importance(2),
	Show Limits(1)}
)));
-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: How to set the response limits using a variable in a JMP script

Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute will most likely be able to help you with this. 

 

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

low_limit = 50;
high_limit = 100;

Eval(Eval Expr(Column(dt, "height") << Set Property(
	"Response Limits",
	{Goal(Maximize), Lower(Expr(low_limit), 0.05), Middle(median, 1), Upper(Expr(high_limit), 0.05), Importance(2),
	Show Limits(1)}
)));
-Jarmo
DavideGrossi
Level II

Re: How to set the response limits using a variable in a JMP script

Perfect, thank you for your help!

Re: How to set the response limits using a variable in a JMP script

The desirability values in this example appear to be for matching a target response, not maximizing a response.

DavideGrossi
Level II

Re: How to set the response limits using a variable in a JMP script

Thank you for pointing that out, Mark