Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: Script for Save Residuals data from Standard Least Squares fit model

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Oct 4, 2017 4:15 AM
(4675 views)

Hi,

I am trying to write a scirpt to save residuals data from "Standard Least Squares" fit model. So I do not have to use the save column option everytime. Could anyone help? Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I generated the 'Fit Model' code below by saving the script that JMP makes for you, and then added 'Residuals(1)':

```
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Fit Model(
Y( :height ),
Effects( :weight ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:height << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Plot Actual by Predicted( 1 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Box Cox Y Transformation( 0 )},
Residuals( 1 )
)
);
```

4 REPLIES 4

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I generated the 'Fit Model' code below by saving the script that JMP makes for you, and then added 'Residuals(1)':

```
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Fit Model(
Y( :height ),
Effects( :weight ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:height << {Summary of Fit( 1 ), Analysis of Variance( 1 ),
Parameter Estimates( 1 ), Plot Actual by Predicted( 1 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Box Cox Y Transformation( 0 )},
Residuals( 1 )
)
);
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Script for Save Residuals data from Standard Least Squares fit model

Highlighted
##

One other non-scripting option would be to go to Preferences > Platforms> Fit Least Squares and check the Residuals box. The residuals will then pop up in a new column for every model you fit in the Least Squares.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Script for Save Residuals data from Standard Least Squares fit model

Highlighted
##

The option described here seems to save residuals to the residual graph, which is generated by a Fit Model. I was wondering if it might be possible to save values (the leverage residuals) which are generated by each of the graphs corresponding to multiple covariates (or independent variables) of the Fit Model. Thank you for your help with this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Script for Save Residuals data from Standard Least Squares fit model