cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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!

Recommended Articles