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
- :
- How to get equation from fit model

Topic Options

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

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

Apr 14, 2017 5:37 PM
(2679 views)

When fitting a model in JMP, it must create an equation to predict the behavior of the response variable from the parameters. Where can that equation be found?

Thanks,

Matt

2 ACCEPTED SOLUTIONS

Accepted Solutions

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

Apr 14, 2017 6:33 PM
(5342 views)

Solution

Which platform are you using? If you are using Fit Model, under the red triangle you will find options to display the formula, or to save the prediction formula to the data table. This is for the standard least squres. Different personalities will have options for doing similar things.

Under Fit Y by X there is an option under the red triangles to save predicteds.

The Partitioning platform allows for the "Save Predicteds".

If you can provide which modeling platform you are using, and you can not find the red triangle option for the predicted formula, repost to the discussion group with the specifics and I am sure the answers will be provided.

Jim

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

Apr 17, 2017 5:34 PM
(5190 views)

Solution

Ah, excellent, thanks again. Using the formula from the new column works well.

10 REPLIES

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

Apr 14, 2017 6:33 PM
(5343 views)

Which platform are you using? If you are using Fit Model, under the red triangle you will find options to display the formula, or to save the prediction formula to the data table. This is for the standard least squres. Different personalities will have options for doing similar things.

Under Fit Y by X there is an option under the red triangles to save predicteds.

The Partitioning platform allows for the "Save Predicteds".

If you can provide which modeling platform you are using, and you can not find the red triangle option for the predicted formula, repost to the discussion group with the specifics and I am sure the answers will be provided.

Jim

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

Apr 15, 2017 9:34 AM
(2665 views)

Thanks very much, Jim. I'm using Fit Model and Show Prediction Expression appears to be what I'm looking for. Is it possible to copy this out as text? I have a number of expressions I need to implement in Python and they're all fairly complex, but none of the options seem to allow copy/paste.

Matt

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

Apr 15, 2017 9:54 AM
(2663 views)

Matt,

The "Show Prediction Expression" displays an image(Picture Box()), not a text field. However, it is a simple step, to generate the Prediction Formula and to capture it. See the script below

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
fm = 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 Effect Leverage( 1 )}
)
);
fm << prediction formula;
equation = Char( Column( dt, N Cols( dt ) ) << get formula );
Show( equation );
```

Jim

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

Apr 16, 2017 11:58 PM
(2625 views)

Hi Jim,

Unfortunately, my experience with JMP is entirely interactive (not programmatic), and I couldn't make this work. I tried replacing "$SAMPLE_DATA\Big Class.jmp" with my file, and everything inside Fit Model () with the script for my model, but that wasn't enough. There really isn't any way to get the expression(s) as text within the JMP GUI without writing a separate script?

Thanks,

Matt

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

Apr 17, 2017 5:13 AM
(2618 views)

You can easily do this interactively.

After you have run your Fit Model, go to the Red Triangle and select

Save Columns==?Prediction Formula

It will create a new column in your data table.

Go to the new data column

Go to the column header for the new column, and right click on it

Select

Formula

The formula editor will popup.

Double click on the blank space within the blue outline around the formula

It will popup a window you can copy from

Jim

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

Apr 17, 2017 5:34 PM
(5191 views)

Solution

Ah, excellent, thanks again. Using the formula from the new column works well.

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

Sep 1, 2017 6:57 AM
(928 views)

I'm working on something similar. I needed to get the published python code so I could save it as a .py and use it later.

```
dt = Open( "/Users/bywing/irisr.csv",End Of Field( Tab, CSV( 1 ) ) );//make sure preferences open CSV as standard CSV
model = dt << Fit Model(
Y( :Name ),
Effects( :Sepal length, :Sepal width, :Petal length, :Petal width ),
Personality( Nominal Logistic ),
Run
);
fd = model << Publish Probability Formulas;
fd << Generate Python Code;
Wait( 0 );
cw = Window( "Python Code Output" );
ed = cw[Script Box( 1 )];
code = ed << get text;
Save Text File( "irismodel.py", code ); // saves generated python code as python script);
Window( "Report: Formula Depot" ) << close window;
```

Note, this script is working with a CSV version of the Iris data, not a JMP table. not something operational, just a short POC

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

Apr 17, 2017 10:55 AM
(2611 views)

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

Apr 17, 2017 5:36 PM
(2593 views)

Thanks, Peter, I will try this next. I'm running JMP Pro 11.1.1.

Matt