BookmarkSubscribe
Choose Language Hide Translation Bar
shahin
Community Trekker

script for saving residuals from fit model

Hi,

I'm very new to JMP and have just started learning to script in order to analyze my data. I have tried to find an answer to this question in the scripting guide, but haven't found it.

Here is a script I saved. I would like to know where to insert the command "Save residuals" so that the residuals from the regression show up in the data table. I did it for principal components, but for this I just can't get it !

Fit Model(
Y( :JL ),
Effects( :TBL ),
Personality( Standard Least Squares ),
Emphasis( Minimal Report ),
Run Model(
:JL << {Plot Actual by Predicted( 0 ), Plot Regression( 1 ),
Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )}
)
);

Thanks !
0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
mpb
Super User mpb
Super User

Re: script for saving residuals from fit model

This should do it:

Fit Model(
	Y( :JL ),
	Effects( :TBL ),
	Personality( Standard Least Squares ),
	Emphasis( Minimal Report ),
	Run Model(
		:JL << {
			Plot Actual by Predicted( 0 ), 
			Plot Regression( 1 ), 
			[i][b]residuals(1),[/b][/i]
			Plot Residual by Predicted( 0 ), 
			Plot Effect Leverage( 0 )	
		}
	)
);

 

0 Kudos
3 REPLIES 3
Highlighted
mpb
Super User mpb
Super User

Re: script for saving residuals from fit model

This should do it:

Fit Model(
	Y( :JL ),
	Effects( :TBL ),
	Personality( Standard Least Squares ),
	Emphasis( Minimal Report ),
	Run Model(
		:JL << {
			Plot Actual by Predicted( 0 ), 
			Plot Regression( 1 ), 
			[i][b]residuals(1),[/b][/i]
			Plot Residual by Predicted( 0 ), 
			Plot Effect Leverage( 0 )	
		}
	)
);

 

0 Kudos
shahin
Community Trekker

Re: script for saving residuals from fit model

Thanks so much! it seems inconsistent to have to write "save" for pc but not residuals ... but it worked :)
0 Kudos
rickeychen
Community Trekker

Re: script for saving residuals from fit model

Hi, cannot see your script. Could you send me a copy please? Thanks!

0 Kudos