Subscribe Bookmark RSS Feed

Make combined table from fit model

WHTseng

Occasional Contributor

Joined:

May 19, 2017

Hi All,

 

I am trying to output the Rsquare value from a fit model, the code is as below,

(I take Algae Mitscherlich.jmp for practice, but I believe the Rsquare doean't really mean anything. Sorry for that)

 

Eventually the code doesn't ouput a combined table, no matter what number I input into [outline box(4)][2].

Can someone indicate me what is wrong here?

 

Thank you very much for any reply.

dt_comb=Open( "$SAMPLE_DATA/Nonlinear Examples/Algae Mitscherlich.jmp" );

dt_comb<<Fit Model(
	Y( :Algae density ),
	Effects( :Mitscherlich, :equal alphas, :equal betas ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Effect Screening" ),
	Run()
);

dt_model = dt_comb << report;
dt_modelR = dt_model[outline box(4)][2] << make combined data table; 


 

 

1 ACCEPTED SOLUTION

Accepted Solutions
markbailey

Staff

Joined:

Jun 23, 2011

Solution

I see it now. You are using the wrong variable. Your script stores the reference to the analysis layer of the Fit Least Squares platform in the variable dt_model. You then send a message to this object to obtain the reference to the report layer but you did not store the result in another variable. You certainly did not store it in dt_model. So subscripting failed to yield a scriptable object that understood the message.

Learn it once, use it forever!
5 REPLIES
markbailey

Staff

Joined:

Jun 23, 2011

I recommend that you change your subscripting approach to this form:

dt_model["Summary of Fit"][TableBox(1)] << Make Combined Data Table;
Learn it once, use it forever!
WHTseng

Occasional Contributor

Joined:

May 19, 2017

Hi markbailey

Thanks for the reply, but the data table still doesn't come out.

I use Debug tool, the message below showing up,

Send Expects Scriptable Object in access or evaluation of 'Send' , dt_model["Summary of Fit"][Table Box( 1 )] << /*###*/Make Combined Data Table/*###*/

 

Do you have idea what I should modify the code?

markbailey

Staff

Joined:

Jun 23, 2011

I am sorry for your trouble. Perhaps there was more to your script than I realized and my example of the correct message send was not enough. Here is an example of a complete script that works. It should give you a better idea.

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

fm = bc << Fit Model(
	Y( :weight ),
	Effects( :age, :sex, :height ),
	Personality( "Standard Least Squares" ),
	Emphasis( "Effect Leverage" ),
	Run(
		:weight << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
		Parameter Estimates( 1 ), Plot Actual by Predicted( 1 ),
		Plot Regression( 0 ), Plot Residual by Predicted( 1 ),
		Plot Effect Leverage( 0 )}
	)
);

fmr = fm << Report;

fmr["Summary of Fit"][TableBox(1)] << Make Combined Data Table;
Learn it once, use it forever!
markbailey

Staff

Joined:

Jun 23, 2011

Solution

I see it now. You are using the wrong variable. Your script stores the reference to the analysis layer of the Fit Least Squares platform in the variable dt_model. You then send a message to this object to obtain the reference to the report layer but you did not store the result in another variable. You certainly did not store it in dt_model. So subscripting failed to yield a scriptable object that understood the message.

Learn it once, use it forever!
WHTseng

Occasional Contributor

Joined:

May 19, 2017

Thank you, markbailey !