cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
shampton82
Level VII

Script to control the Profiler

I like adding buttons to my toolbar that run scripts that execute actions of common tasks I do vs having to dive multiple layers into an option menu.  My most recent goal is to add some buttons that would control steps i take in the profiler.  Specifically I'd like to click a button to have the profiler maximize desirability, one for set the profiler to a row, and one to save current profiler settings.  However, I couldn't find any syntax in the scripting library to work from.

 

So for exact details on what I'm trying to accomplish this is a description for the Max desirability button:

1.  Run an analysis 2. Create a prediction profiler 3.  Pred Pro red arrow-> add desirability 4. Adjust desirability 5. **Click button on toolbar with my macro to maximize desirability**

 

Thanks for any ideas!

 

Steve

3 REPLIES 3

Re: Script to control the Profiler

I do not see a way to send messages to the Prediction Profiler that is embedded in any fitting platform. The only messages I found are the ones that open or close it.

 

fit << Profiler( 1 );

fit << Profiler( 0 );

Maybe someone else knows how to send messages to the embedded object that accomplish the same tasks as the commands in the red triangle menu.

 

So you have to include the necessary arguments to the message that opens the profiler to get what you want. Here is an example:

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

launch = dt << Fit Model(
	Y( :weight ),
	Effects( :age, :sex, :height ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" )
);

fit = launch << Run;

fit << Profiler( 1,
	Confidence Intervals( 1 ),
	Desirability Functions( 1 ),
	Term Value(
		age( 12, Lock( 0 ), Show( 1 ) ),
		sex( "F", Lock( 0 ), Show( 1 ) ),
		height( 62.55, Lock( 0 ), Show( 1 ) )
	)
);
MathStatChem
Level VI

Re: Script to control the Profiler

This will get a reference to the profiler

 

pf = report(fit)["Prediction Profiler"] << get scriptable object;

Then you can send messages to the profiler, e.g.

 

pf << Maximize Desirability;
shampton82
Level VII

Re: Script to control the Profiler

Thanks for all the help!  Between these suggestions and this help from Jordan Hiller:

"Yes, you can get a reference to an already-open analysis. For example, this script will add a Press report to an open Fit Model:

 

Names Default To Here( 1 );

 

//Get ref to fit least squares object

fm = Current Report()[Outline Box( 1 )] << Get Scriptable Object;

 

//show press report

fm << Press( 1 );"

 

 

 

I have this script which works great, is now in my toolbar and  saving me clicks!

 

Names Default To Here( 1 );

dt=current data table();

pf = Current Report()["Prediction Profiler"] << get scriptable object;

pf << Maximize Desirability;