cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

how can I get prediction profiler output estimation in a script?

Hi all,

I have an experiment with many outputs, and I want to get the values given by the prediction formula in a script to send them to a data table. Anybody know how to do that?

 

Thanks,

Jose Angel

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
statman
Super User

Re: how can I get prediction profiler output estimation in a script?

If you select the red triangle next to the Response>Save Columns>Prediction Formula, it will add a column to your data table that has the prediction formula.  If you right click on that column, and go to the Formula (it will have a check next to it) you can view the formula.

"All models are wrong, some are useful" G.E.P. Box

View solution in original post

Re: how can I get prediction profiler output estimation in a script?

The suggestion to save the model as a column formula is a good one. There are many ways to use it.

 

This example illustrates how you can directly get the value displayed in the profiler as another way:

 

Names Default to Here( 1 );

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

fit = dt << Fit Model(
	Y( :weight ),
	Effects( :age, :sex, :height ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		Profiler(
			1,
			Confidence Intervals( 1 ),
			Term Value(
				age( 12, Lock( 0 ), Show( 1 ) ),
				sex( "F", Lock( 0 ), Show( 1 ) ),
				height( 62.55, Lock( 0 ), Show( 1 ) )
			)
		),
		:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
		Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
		Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
		Box Cox Y Transformation( 0 )}
	)
);

fit rep = fit << Report;

prediction = Num( fit rep["Prediction Profiler"][AxisBox(1)][TextBox(2)] << Get Text );

View solution in original post

MathStatChem
Level VII

Re: how can I get prediction profiler output estimation in a script?

Try this in your script

 

rfit = fit << Report;

pf=rfit["Prediction Profiler"] << get scriptable object;

pf << Remember Settings;

dtout = (rfit["Prediction Profiler"]["Remembered Settings"][Table Box(1)]<< Make Into Data Table);

View solution in original post

3 REPLIES 3
statman
Super User

Re: how can I get prediction profiler output estimation in a script?

If you select the red triangle next to the Response>Save Columns>Prediction Formula, it will add a column to your data table that has the prediction formula.  If you right click on that column, and go to the Formula (it will have a check next to it) you can view the formula.

"All models are wrong, some are useful" G.E.P. Box
MathStatChem
Level VII

Re: how can I get prediction profiler output estimation in a script?

Try this in your script

 

rfit = fit << Report;

pf=rfit["Prediction Profiler"] << get scriptable object;

pf << Remember Settings;

dtout = (rfit["Prediction Profiler"]["Remembered Settings"][Table Box(1)]<< Make Into Data Table);

Re: how can I get prediction profiler output estimation in a script?

The suggestion to save the model as a column formula is a good one. There are many ways to use it.

 

This example illustrates how you can directly get the value displayed in the profiler as another way:

 

Names Default to Here( 1 );

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

fit = dt << Fit Model(
	Y( :weight ),
	Effects( :age, :sex, :height ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Minimal Report" ),
	Run(
		Profiler(
			1,
			Confidence Intervals( 1 ),
			Term Value(
				age( 12, Lock( 0 ), Show( 1 ) ),
				sex( "F", Lock( 0 ), Show( 1 ) ),
				height( 62.55, Lock( 0 ), Show( 1 ) )
			)
		),
		:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Scaled Estimates( 0 ),
		Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
		Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
		Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
		Box Cox Y Transformation( 0 )}
	)
);

fit rep = fit << Report;

prediction = Num( fit rep["Prediction Profiler"][AxisBox(1)][TextBox(2)] << Get Text );

Recommended Articles