Choose Language Hide Translation Bar
Highlighted
powerpuff
Community Trekker

Response Limits

How can I extract the goal and importance of Response limits for all columns in a data table and put them in a new data table along with the column names? This is the script I am working on. I am able to extract out the Importance. Can anyone direct me as to how I can go ahead and extract the Goal from Response Limits? Thanks

 

dt = Open("C:\Users\MyFile.jmp");
resp = New Table( "ResponeLimits.jmp",
New Column( "ColName", Character, Nominal, width( 30 ) ),
New Column( "Goal", Character, Nominal, width( 30 ) ),
New Column( "Importance", Numeric, Nominal )
);
nc = N Col( dt );
For( i = 1, i <= nc, i++,
If( Column( dt, i ) << get data type() == "Numeric",
If( !Is Empty( x = Column( dt, i ) << get property(( "Response Limits" ),Show Limits(1) )),

resp << add rows( 1, N Row( resp ) );
//Try( Column( resp, "Goal" )[N Row( resp )] = x["Goal"] );
Try( Column( resp, "Importance" )[N Rows( resp )] = x["Importance"] );
Column( resp, "colname" )[N Rows( resp )] = Column( dt, i ) << get name;
)
)
);

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Response Limits

The issue is that the Goal value returned from the Response Limits is not a string.  If you use the Char() function to convert it to a string, it should work as you want

Try( Column( resp, "Goal" )[N Row( resp )] = char(x["Goal"] ));
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Response Limits

The issue is that the Goal value returned from the Response Limits is not a string.  If you use the Char() function to convert it to a string, it should work as you want

Try( Column( resp, "Goal" )[N Row( resp )] = char(x["Goal"] ));
Jim

View solution in original post

powerpuff
Community Trekker

Re: Response Limits

I have also been trying to extract the lower, middle and upper Desirability and Values in Response Limits into the same table as the rest of the data. Can anybody direct me as to how I can extract this data? Thanks

0 Kudos
txnelson
Super User

Re: Response Limits

See script below on how to extract the limits and desirability

names default to here(1);
dt=open("$SAMPLE_DATA\Big Class.jmp");

dt:Height << set property("Response Limits",
	{Goal( Maximize ), Lower( 50, 2 ), Middle( 60, 4 ), 
	Upper( 70, 6 ), Importance( 1 ),Show Limits( 1 )} );
	
// The list returned from the Response Limits is a complex
// list.  It requires special parsing to get the values out.

// Retrive the list
ResLimits = dt:Height << get property("Response Limits");

// To get the complete Lower element I have found that one 
// has to reference it in relationship to the absolute
// value of the list

LowerVals = ResLimits[2];
arg(LowerVals,2)
// Now, this element can be parsed using different functions
// in JMP.  I will use the Arg() function
LowerResLimit = arg(LowerVals, 1);
LowerResDesirability = arg(LowerVals, 2);
Jim
0 Kudos