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
OliverPickburn
Level III

Basic Scripting - Combining Models (JMP 16)

Hi All,

Hoping someone can help me out with what feels like a fairly basic question on scripts. I have a data table from which I have run a number of models (for various outputs) and saved the models I am happy with as scripts. I now want to combine those models into a single model report and include a profiler showing all outputs (to enable multivariable optimization) Critically I want to retain the model performance info form each model report so cannot just use Save column / Prediction formula/Profiler.

If I simply copy and paste the model scripts together I invariable get a Syntax error (typically Unexpected Fit Model or similar when I run the new script

My JSL scripting knowledge is pretty minimal but this seems like it should be doable I  can just get the syntax right.....

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: Basic Scripting - Combining Models (JMP 16)

Search for Fit Group in the scripting index.  Here is an example:

 

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

NewWindow("My Models",
	fg = FitGroup(
		Fit Model(
			Y( :weight ),
			Effects( :age, :sex, :height ),
			Personality( "Standard Least Squares" ),
			Emphasis( "Minimal Report" ),
			Run(
				:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
				Parameter Estimates( 1 ), Scaled Estimates( 0 ),
				Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
				Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
				Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
				Box Cox Y Transformation( 0 )}
			)
		), // <--- note the comma
		Fit Model(
			Y( :weight ),
			Effects( :age, :sex, :height, :age * :sex, :age * :height, :sex * :height ),
			Personality( "Standard Least Squares" ),
			Emphasis( "Minimal Report" ),
			Run(
				:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
				Parameter Estimates( 1 ), Scaled Estimates( 0 ),
				Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
				Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
				Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
				Box Cox Y Transformation( 0 )}
			)
		);		
	)
);

// turn on the fit group profiler
fg << profiler(1);
-Dave

View solution in original post

2 REPLIES 2
David_Burnham
Super User (Alumni)

Re: Basic Scripting - Combining Models (JMP 16)

Search for Fit Group in the scripting index.  Here is an example:

 

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

NewWindow("My Models",
	fg = FitGroup(
		Fit Model(
			Y( :weight ),
			Effects( :age, :sex, :height ),
			Personality( "Standard Least Squares" ),
			Emphasis( "Minimal Report" ),
			Run(
				:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
				Parameter Estimates( 1 ), Scaled Estimates( 0 ),
				Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
				Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
				Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
				Box Cox Y Transformation( 0 )}
			)
		), // <--- note the comma
		Fit Model(
			Y( :weight ),
			Effects( :age, :sex, :height, :age * :sex, :age * :height, :sex * :height ),
			Personality( "Standard Least Squares" ),
			Emphasis( "Minimal Report" ),
			Run(
				:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
				Parameter Estimates( 1 ), Scaled Estimates( 0 ),
				Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
				Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
				Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
				Box Cox Y Transformation( 0 )}
			)
		);		
	)
);

// turn on the fit group profiler
fg << profiler(1);
-Dave
OliverPickburn
Level III

Re: Basic Scripting - Combining Models (JMP 16)

Thanks for this Dave, that did the job!